guest@dotshare [~/groups/wms/monster] $ ls Monster-II/ | cat

Monster II (scrot) (+6 likes)

Shinryuu Jan 17, 2013 (wms/monster)

config.def.h(raw, dl)

SCROT

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/* see LICENSE for copyright and license */

#ifndef CONFIG_H
#define CONFIG_H

/** modifiers **/
#define MOD1            Mod1Mask
#define MOD4            Mod4Mask
#define MOD5            Mod5Mask
#define CONTROL         ControlMask
#define SHIFT           ShiftMask

/** generic settings **/
#define MASTER_SIZE     0.76
#define SHOW_PANEL      True
#define TOP_PANEL       True
#define PANEL_HEIGHT    16
#define DEFAULT_MODE    TILE
#define ATTACH_ASIDE    True
#define FOLLOW_WINDOW   False
#define FOLLOW_MOUSE    False
#define CLICK_TO_FOCUS  True
#define FOCUS_BUTTON    Button3
#define BORDER_WIDTH    3
#define FOCUS           "#181818"
#define UNFOCUS         "#141414"
#define MINWSZ          50
#define DEFAULT_DESKTOP 0
#define DESKTOPS        3

/**
 * open applications to specified desktop with specified mode.
 * if desktop is negative, then current is assumed
 */
static const AppRule rules[] = { \
    /*  class     desktop  follow  float */
    { "Pidgin",     1,     False,  True  },
    { "Gimp",       2,     False,  True  },
    { "dwb",       -1,     True,   True  },
    { "mplayer",   -1,     True,   False },
    { "Thunar",    -1,     True,   True  },
    { "PSX",       -1,     True,   True  },
    { "nitrogen",  -1,     True,   True  },
    { "wine",      -1,     True,   True  },
    { "winecfg",   -1,     True,   True  },
    { "Steam",      2,     False,  True  },
    { "hl2_linux",  2,     False,  True  },
    { "scratchpad", -1,    False,  True  },
};

/* helper for spawning shell commands */
#define SHCMD(cmd) {.com = (const char*[]){"/bin/sh", "-c", cmd, NULL}}

/**
 * custom commands
 * must always end with ', NULL };'
 */
static const char *menucmd[]	   = { "dmenu_run", "-fn", "terminus 9", NULL};
static const char *gtkmenucmd[]	   = { "mygtkmenu", "/home/shn/.menu", NULL };
static const char *filecmd[]	   = { "thunar", NULL };
static const char *termcmd[]	   = { "termite", NULL };
static const char *webcmd[]	   = { "dwb", NULL };
static const char *lolicmd[]       = { "lolictrl", NULL };
static const char *mpdcmd[]        = { "lolimpdnu", NULL };
static const char *voldowncmd[]	   = { "dvol", "-d", "2", NULL };
static const char *volupcmd[]	   = { "dvol", "-i", "2", NULL };

#define DESKTOPCHANGE(K,N) \
    {  MOD1,             K,              change_desktop, {.i = N}}, \
    {  MOD1|ShiftMask,   K,              client_to_desktop, {.i = N}},

/**
 * keyboard shortcuts
 */
static Key keys[] = {
    /* modifier		key            function           argument */
    {  CONTROL,         XK_d,          spawn,             {.com = lolicmd}},
    {  CONTROL,         XK_l,          spawn,             {.com = mpdcmd}},
    {  MOD1,            XK_p,          spawn,             {.com = menucmd}},
    {  MOD1,            XK_1,          spawn,             {.com = webcmd}},
    {  MOD1,            XK_3,          spawn,             {.com = filecmd}},
    {  MOD1,            XK_dead_acute, spawn,             {.com = volupcmd}},
    {  MOD1,            XK_plus,       spawn,             {.com = voldowncmd}},
    {  MOD1|SHIFT,      XK_Return,     spawn,             {.com = termcmd}},
    {  MOD1,            XK_b,          togglepanel,       {NULL}},
    {  MOD1,            XK_BackSpace,  focusurgent,       {NULL}},
    {  MOD1|SHIFT,      XK_c,          killclient,        {NULL}},
    {  MOD1,            XK_j,          next_win,          {NULL}},
    {  MOD1,            XK_k,          prev_win,          {NULL}},
    {  MOD1,            XK_h,          resize_master,     {.i = -10}}, /* decrease size in px */
    {  MOD1,            XK_l,          resize_master,     {.i = +10}}, /* increase size in px */
    {  MOD1,            XK_o,          resize_stack,      {.i = -10}}, /* shrink   size in px */
    {  MOD1,            XK_i,          resize_stack,      {.i = +10}}, /* grow     size in px */
    {  MOD1|CONTROL,    XK_h,          rotate,            {.i = -1}},
    {  MOD1|CONTROL,    XK_l,          rotate,            {.i = +1}},
    {  MOD1|SHIFT,      XK_h,          rotate_filled,     {.i = -1}},
    {  MOD1|SHIFT,      XK_l,          rotate_filled,     {.i = +1}},
    {  MOD1,            XK_Tab,        last_desktop,      {NULL}},
    {  MOD1,            XK_m,          swap_master,       {NULL}},
    {  MOD1|SHIFT,      XK_j,          move_down,         {NULL}},
    {  MOD1|SHIFT,      XK_k,          move_up,           {NULL}},
    {  MOD1|SHIFT,      XK_t,          switch_mode,       {.i = TILE}},
    {  MOD1|SHIFT,      XK_m,          switch_mode,       {.i = MONOCLE}},
    {  MOD1|SHIFT,      XK_b,          switch_mode,       {.i = BSTACK}},
    {  MOD1|SHIFT,      XK_g,          switch_mode,       {.i = GRID}},
    {  MOD1|SHIFT,      XK_f,          switch_mode,       {.i = FLOAT}},
    {  MOD1|CONTROL,    XK_r,          quit,              {.i = 0}}, /* quit with exit value 0 */
    {  MOD1|CONTROL,    XK_q,          quit,              {.i = 1}}, /* quit with exit value 1 */
    {  CONTROL,         XK_Down,       moveresize,        {.v = (int []){   0,  40,   0,   0 }}}, /* move down*/ 
    {  CONTROL,         XK_Up,         moveresize,        {.v = (int []){   0, -40,   0,   0 }}}, /* move up */
    {  CONTROL,         XK_Right,      moveresize,        {.v = (int []){  40,   0,   0,   0 }}}, /* move right */
    {  CONTROL,         XK_Left,       moveresize,        {.v = (int []){ -40,   0,   0,   0 }}}, /* move left  */
    {  MOD5,		XK_k,          moveresize,        {.v = (int []){   0,   0,   0,  40 }}}, /* height grow   */
    {  MOD5,		XK_i,          moveresize,        {.v = (int []){   0,   0,   0, -40 }}}, /* height shrink */
    {  MOD5,		XK_l,          moveresize,        {.v = (int []){   0,   0,  40,   0 }}}, /* width grow    */
    {  MOD5,		XK_j,          moveresize,        {.v = (int []){   0,   0, -40,   0 }}}, /* width shrink  */
       DESKTOPCHANGE(   XK_F1,                             0)
       DESKTOPCHANGE(   XK_F2,                             1)
       DESKTOPCHANGE(   XK_F3,                             2)
};

/**
 * mouse shortcuts
 */
static Button buttons[] = {
    {  MOD1,    Button1,     mousemotion,   {.i = MOVE}},
    {  MOD1,    Button3,     mousemotion,   {.i = RESIZE}},
    {  CONTROL,	Button3,     spawn,         {.com = gtkmenucmd}},
};
#endif

/* vim: set expandtab ts=4 sts=4 sw=4 : */

CLICK TO VIEW

x

config.def.h_bar(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* The height of the bar (in pixels) */
#define BAR_HEIGHT  16
/* The width of the bar. Set to -1 to fit screen */
#define BAR_WIDTH   -1
/* Offset from the left. Set to 0 to have no effect */
#define BAR_OFFSET 0
/* Choose between an underline or an overline */
#define BAR_UNDERLINE 1
/* The thickness of the underline (in pixels). Set to 0 to disable. */
#define BAR_UNDERLINE_HEIGHT 3
/* Default bar position, overwritten by '-b' switch */
#define BAR_BOTTOM 0
/* The fonts used for the bar, comma separated. Only the first 2 will be used. */
#define BAR_FONT	"-*-stlarch-medium-r-normal-*-10-*-*-*-*-*-*-*","-*-cure.se-medium-r-normal-*-11-*-*-*-*-*-*-*"
/* Some fonts don't set the right width for some chars, pheex it */
#define BAR_FONT_FALLBACK_WIDTH 4
/* Color palette */
#define COLOR0	0x111111 /* Background */
#define COLOR1	0xc4c4c4 /* Foreground */
#define COLOR2	0x283B5D /* Blue */
#define COLOR3	0x852a52 /* Red */
#define COLOR4	0xadbd00 /* Green */
#define COLOR5	0xec9d08 /* Orange */
#define COLOR6	0x6b0f38 /* Magenta */
#define COLOR7	0x212122 /* Black'n'Gray I */
#define COLOR8	0x333333 /* Black'n'Gray II */
#define COLOR9	0xdedede /* White */
 

x

wmrun.sh(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#!/usr/bin/env sh

: "${wm:=monsterwm}"
: "${ff:="/tmp/${wm}.fifo"}"
[ -p "$ff" ] || mkfifo -m 600 "$ff"

# spawn a statusbar
while read -t 60 -r line || true; do
    echo "$line" | grep -qEx "(([[:digit:]]+:){4,6}[[:digit:]]+ ?)+" && prev="$line" || line=
    statusinfo.sh ${line:-$prev}
done < "$ff" | bar &

"$wm" > "$ff"
 

x

statusinfo.sh(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env sh

# expects a line from monsterwm's output as argument ("$1")
# prints formatted output to be used as input for bar
# reference: bar by LemonBoy -- https://github.com/LemonBoy/bar

# desktop status
for desk; do
    d="${desk%%:*}" desk="${desk#*:}" # desktop id
    w="${desk%%:*}" desk="${desk#*:}" # window count
    l="${desk%%:*}" desk="${desk#*:}" # layout mode
    c="${desk%%:*}" desk="${desk#*:}" # is current desktop
    u="$desk"                         # has urgent hint

    # desktop id
    case "$d" in
        0) d=" term" ;; 1) d=" web" ;;
        2) d=" img" ;;
    esac

    # current desktop
    if [ $c -ne 0 ]
    then bg="\b7" un="\u6" fg="\f9"
        case "$l" in
            0) s="" ;; 1) s="" ;; 2) s="" ;;
            3) s="" ;; 4) s="" ;;
        esac && s="\b8\u8 $s \br\ur"
    fi

    # has urgent hint or no windows
    [ $u -ne 0 ] && un="\u2"
    [ $w -eq 0 ] && w="-"

    in="$in$bg$fg$un $d \f8[$w] \ur\br\fr"
    unset bg fg un
done


# music status
music="$(mpc current -f "%artist% - [%title%|%file%]")"
if [ -z "$music" ]; then music="nothing to see here" mstat=""
else
    mstat="$(mpc | sed -rn '2s/\[([[:alpha:]]+)].*/\1/p')"
    [ "$mstat" == "paused" ] && mstat="" || mstat=""
fi

# volume status
if [ "$(amixer get Master | sed -nr '$ s:.*\[(.+)]$:\1:p')" == "off" ]
then vol="[m]" vstat=""
else
    vol="$(amixer get PCM | sed -nr '$ s:.*\[(.+%)].*:\1:p')"
    if   [ "${vol%\%}" -le 10 ]; then vstat=""
    elif [ "${vol%\%}" -le 20 ]; then vstat=""; else vstat=""; fi
fi

# date and time
date="$(date +"%R")" dstat=""

# symbols
arrow=""

printf '%s %s %s' "$in" "$arrow " "$s" "\r"
printf ' \\b7\\u6\\f1 %s \\br\\ur\\fr %s' "$mstat" "$music" "$vstat" "$vol" "$dstat" "$date "
printf '\n'
 

x

Notes

I’ve been fiddling with my monsterwm setup for a while to get it to look more comfortable and darkish. I think this version looks a bit more “professional” vs. previous version. I changed my terminal from urxvt to termite a long time ago so here’s my termite.cfg as well (you can still copy colors to other terminals), http://ix.io/41a/ Here’s my wallpaper I made out from vector image as well, http://ompldr.org/vaDN4aA/yoko.png

Comments

acslater said about 11 years ago

What music player is this? It’s nice!

Shinryuu said about 11 years ago

Hey! It’s called DeadBeeF

Ghoul said about 11 years ago

Hey! I love it, I’m setting up my laptop to match (but writing everything in C to save battery life on idle).

How’d you get DeadBeeF to look like that, and can you share? :)

Shinryuu said about 11 years ago

I use my own personal mod of Clearlooks called “Clearlooks_penis” to get that dark layout (it breaks gimp color choosing at the moment), if you want to show album art - right click some of the column headers and add “Album art” column. My columns goes like this “Album Art” “Artist” “Title” “Duration” and “Track”. When you right click any of the columns you’ll see “Group by” option, go there and click “custom” section and type “%b” which stands for album. You can easily grap my colors with “zenity –color-selection” command, just be sure to install zenity package first :)

Ghoul said about 11 years ago

Thanks :)

bluepedro said about 11 years ago

Can I get a copy of your Yoko wallpaper? Ompldr is dead, thus your second link doesn’t work. :/

candidate said about 10 years ago

hey, would you be able to share your gtk theme? i attempted to mod a gtk to get a good looking deadbeef but i can’t get it right - yours is awesome! thanks in advance