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

Monster (scrot) (+5 likes)

Shinryuu Sep 12, 2012 (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
/* see LICENSE for copyright and license */

#ifndef CONFIG_H
#define CONFIG_H

/** modifiers **/
#define MOD1            Mod1Mask    /* ALT key */
#define MOD4            Mod4Mask    /* Super/Windows key */
#define CONTROL         ControlMask /* Control key */
#define SHIFT           ShiftMask   /* Shift key */

/** generic settings **/
#define MASTER_SIZE     0.58
#define SHOW_PANEL      True      /* show panel by default on exec */
#define TOP_PANEL       True      /* False means panel is on bottom */
#define PANEL_HEIGHT    16        /* 0 for no space for panel, thus no panel */
#define DEFAULT_MODE    TILE      /* initial layout/mode: TILE MONOCLE BSTACK GRID FLOAT */
#define ATTACH_ASIDE    True      /* False means new window is master */
#define FOLLOW_WINDOW   False     /* follow the window when moved to a different desktop */
#define FOLLOW_MOUSE    False     /* focus the window the mouse just entered */
#define CLICK_TO_FOCUS  True      /* focus an unfocused window when clicked  */
#define FOCUS_BUTTON    Button3   /* mouse button to be used along with CLICK_TO_FOCUS */
#define BORDER_WIDTH    1         /* window border width */
#define FOCUS           "#ff950e" /* focused window border color    */
#define UNFOCUS         "#444444" /* unfocused window border color  */
#define MINWSZ          50        /* minimum window size in pixels  */
#define DEFAULT_DESKTOP 0         /* the desktop to focus initially */
#define DESKTOPS        4         /* number of desktops - edit DESKTOPCHANGE keys to suit */

/**
 * 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  },
    { "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", "-*-terminusmodx-medium-r-normal-*-12-*-*-*-*-*-*-*", NULL};
static const char *filecmd[]	   = { "thunar", NULL };
static const char *termcmd[]	   = { "urxvtc", NULL };
static const char *webcmd[]	   = { "dwb", NULL };
static const char *lolicmd[]       = { "lolictrl", NULL };
static const char *gtkmenucmd[]	   = { "mygtkmenu", "/home/shn/.menu", NULL };
static const char *dropterm[]      = { "/bin/sh", "-c", "scratchpad.sh", NULL };
static const char *weecmd[]        = { "urxvtc", "-e", "weechat-curses", NULL };
static const char *mpdcmd[]        = { "urxvtc", "-e", "ncmpcpp", 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}},
    {  MOD1,             XK_q,          spawn,             {.com = dropterm}},
    {  MOD1,             XK_w,          spawn,             {.com = weecmd}},
    {  MOD1,             XK_n,          spawn,             {.com = mpdcmd}},
    {  MOD1,             XK_p,          spawn,             {.com = menucmd}},
    {  MOD1,             XK_1,          spawn,             {.com = webcmd}},
    {  MOD1,             XK_3,          spawn,             {.com = filecmd}},
    {  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_Return,     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,  50,   0,   0 }}}, /* move down*/ 
    {  CONTROL,          XK_Up,         moveresize,        {.v = (int []){   0, -50,   0,   0 }}}, /* move up */
    {  CONTROL,          XK_Right,      moveresize,        {.v = (int []){  50,   0,   0,   0 }}}, /* move right */
    {  CONTROL,          XK_Left,       moveresize,        {.v = (int []){ -50,   0,   0,   0 }}}, /* move left  */
    {  MOD4,             XK_k,          moveresize,        {.v = (int []){   0,   0,   0,  50 }}}, /* height grow   */
    {  MOD4,             XK_i,          moveresize,        {.v = (int []){   0,   0,   0, -50 }}}, /* height shrink */
    {  MOD4,             XK_l,          moveresize,        {.v = (int []){   0,   0,  50,   0 }}}, /* width grow    */
    {  MOD4,             XK_j,          moveresize,        {.v = (int []){   0,   0, -50,   0 }}}, /* width shrink  */
       DESKTOPCHANGE(    XK_F1,                             0)
       DESKTOPCHANGE(    XK_F2,                             1)
       DESKTOPCHANGE(    XK_F3,                             2)
       DESKTOPCHANGE(    XK_F4,                             3)
};

/**
 * 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

wmrun.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
#!/usr/bin/env bash

wm=monsterwm
ff="/tmp/$RANDOM.monsterwm.fifo"

tags=('\ue010 null' '\ue011 web' '\ue012 foo' '\ue062')
layouts=('\ue002' '\ue001' '\ue003' '\ue005' '\ue006') 

[[ -p $ff ]] || mkfifo -m 600 "$ff"

function statusbar {
    # Date
    date=$(date +"%H:%M")
    # Memory usage
    mem=$(free -m | awk '/buffers\/cache/ {print $3 MB}')
    # Volume
    vol=$(amixer get Master | egrep -o '[0-9]{1,3}%' | sed -e 's/%//')
    # Music status
    music="$(mpc current -f "%artist% - %title%")"
    if [ -z "$music" ]; then music="stopped" mstat="\ue0ae"
    else
    mstat="$(mpc | sed -rn '2s/\[([[:alpha:]]+)].*/\1/p')"
    [ "$mstat" == "paused" ] && mstat="\ue059" || mstat="\ue0aa"
    fi
    # HDD
    root=$(df -h|awk '/root/ {print $5}')
    home=$(df -h|awk '/home/ {print $5}')

    echo "\r \f4$mstat\fr $music \f4\\ue09f\fr $root \f4\\ue0b2\fr $home \f4\ue020\fr $mem \f4\\ue05d\fr $vol \f4\ue015\fr $date "
}

while read -t 1 -r wmout || true; do
    if [[ $wmout =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]]; then
        read -ra desktops <<< "$wmout"

        tmp=
        for desktop in "${desktops[@]}"; do
            IFS=':' read -r d w m c u <<< "$desktop"
            # Tags labels
            label=${tags[$d]}
            # Current desktop color and enclosing char (yes/no)
            ((c)) && fg="9" bg="2" lc="\u4 " rc=" \ur" && layout=${layouts[$m]} || fg="1" bg="0" lc=" " rc=" "
            # Has windows ?
            ((w)) && ((! c)) && fg="1" lc="\u6 " rc=" \ur"
            # Urgent windows ?
            ((u)) && fg="1" bg="3" lc="\u4 " rc=" \ur"

            tmp+="\f$fg\b$bg$lc$label$rc\fr\br"
        done
        # Merge the clients indications and the tile mode
        tmp+=" $layout"
    fi
    echo "$tmp $(statusbar)"
done < "$ff" | bar &

#while :; do "$wm" || break; done | tee -a "$ff"
$wm > "$ff"

rm $ff
 

x

config.deh.h_for_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
/* 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 2
/* 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       "-Misc-Stlarch-Medium-R-Normal--10-100-75-75-C-80-ISO10646-1","-*-termsyn-medium-r-*-*-11-*-*-*-*-*-*-*"
/* Color palette */
#define COLOR0	0x151515 /* Background */
#define COLOR1	0xddeedd /* Foreground */
#define COLOR2	0x282830 /* Black'n'Gray */
#define COLOR3	0xcc0f16 /* Red */
#define COLOR4	0x92b03e /* Green */
#define COLOR5	0xdc7802 /* Orange */
#define COLOR6	0x007799 /* Blue */
#define COLOR7	0x7d1b66 /* Magenta */
#define COLOR8	0x426870 /* Cyan */
#define COLOR9	0xeeeeee /* White */
 

x

Notes

Hey! I updated all configurations to be more simple, bar is now called via wmrun.sh script which launches monsterwm as well so need to use a seperate script for a panel. I changed 2 colors from bar (blue=green, orange=blue) as well so I didn’t bother to post a new monsterwm setup because of minimal changes. Also I changed my wallpaper for the new shot. You can still grab the previous wallpaper from comments and also from here http://ompldr.org/vZms2aA

I also included bar’s config.def.h file and you can obtain bar with this “git clone git://github.com/LemonBoy/bar.git” command.

I won’t update this configuration from now on to avoid complex situations. I’d rather make a new configuration but there won’t be anything like that for a long time because this setup works pretty damn well, comments are always welcome ;)

Comments

Him said about 4 years ago

Very nice, the bright colours fit very well with the dark scheme.

flynn said about 4 years ago

Nice,wallpaper?

Shinryuu said about 4 years ago

Hi flynn here’s the wallpaper, http://ompldr.org/vZms2aA/bigspace.png, I made it by with Xyne’s konify script and did that Space Invader thing by myself.

flynn said about 4 years ago

Hi Shinryuu,
lovely,thanks.