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

Monster III (scrot) (+1 likes)

DjDexter Feb 10, 2013 (wms/monster)

config.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/* see LICENSE for copyright and license */

#ifndef CONFIG_H
#define CONFIG_H

#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        "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*"
/* 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 */

/** 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 assumed2
 */
static const AppRule rules[] = { \
    /*  class     desktop  follow  float */
    { "Pidgin",      1,    False,  True  },
    { "Gimp",        2,    False,  True  },
    { "SDL_App",    -1,    True,   True  },
    { "MPlayer",    -1,    True,   True  },
    { "Thunar",     -1,    True,   True  },
    { "snes9x-gtk", -1,    True,   True  },
    { "nitrogen",   -1,    True,   True  },
    { "wine",       -1,    True,   True  },
    { "winecfg",    -1,    True,   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[]	   = { "gmrun", "-fn", "terminus 9", NULL};
static const char *filecmd[]	   = { "urxvt", "-e", "mc", NULL };
static const char *termcmd[]	   = { "urxvt", "-pe", "tabbed", NULL };
static const char *webcmd[]	       = { "firefox", NULL };
static const char *mpdprev[]       = { "ncmpcpp", "prev", NULL };
static const char *mpdnext[]       = { "ncmpcpp", "next", NULL };
static const char *mpdpause[]      = { "ncmpcpp", "toggle", 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 */
    {  MOD4,            XK_p,          spawn,             {.com = menucmd}},
    {  MOD4,            XK_1,          spawn,             {.com = webcmd}},
    {  MOD4,            XK_3,          spawn,             {.com = filecmd}},
    {  MOD4,            XK_F10,        spawn,             {.com = mpdprev}},
    {  MOD4,            XK_F11,        spawn,             {.com = mpdnext}},
    {  MOD4,            XK_Escape,     spawn,             {.com = mpdpause}},
    {  MOD4|SHIFT,      XK_Return,     spawn,             {.com = termcmd}},
    {  MOD4,            XK_b,          togglepanel,       {NULL}},
    {  MOD4,            XK_BackSpace,  focusurgent,       {NULL}},
    {  MOD4|SHIFT,      XK_c,          killclient,        {NULL}},
    {  MOD4,            XK_j,          next_win,          {NULL}},
    {  MOD4,            XK_k,          prev_win,          {NULL}},
    {  MOD4,            XK_h,          resize_master,     {.i = -10}}, /* decrease size in px */
    {  MOD4,            XK_l,          resize_master,     {.i = +10}}, /* increase size in px */
    {  MOD4,            XK_o,          resize_stack,      {.i = -10}}, /* shrink   size in px */
    {  MOD4,            XK_i,          resize_stack,      {.i = +10}}, /* grow     size in px */
    {  MOD4|CONTROL,    XK_h,          rotate,            {.i = -1}},
    {  MOD4|CONTROL,    XK_l,          rotate,            {.i = +1}},
    {  MOD4|SHIFT,      XK_h,          rotate_filled,     {.i = -1}},
    {  MOD4|SHIFT,      XK_l,          rotate_filled,     {.i = +1}},
    {  MOD4,            XK_Tab,        last_desktop,      {NULL}},
    {  MOD4,            XK_m,          swap_master,       {NULL}},
    {  MOD4|SHIFT,      XK_j,          move_down,         {NULL}},
    {  MOD4|SHIFT,      XK_k,          move_up,           {NULL}},
    {  MOD4|SHIFT,      XK_t,          switch_mode,       {.i = TILE}},
    {  MOD4|SHIFT,      XK_m,          switch_mode,       {.i = MONOCLE}},
    {  MOD4|SHIFT,      XK_b,          switch_mode,       {.i = BSTACK}},
    {  MOD4|SHIFT,      XK_g,          switch_mode,       {.i = GRID}},
    {  MOD4|SHIFT,      XK_f,          switch_mode,       {.i = FLOAT}},
    {  MOD4|CONTROL,    XK_r,          quit,              {.i = 0}}, /* quit with exit value 0 */
    {  MOD4|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)
//       DESKTOPCHANGE(   XK_F4,                             3)
};

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

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

CLICK TO VIEW

x

.monsterwmbar.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
#!/usr/bin/env bash
 
wm="monsterwm"
ff="/tmp/monsterwm.fifo"
 
tags=('term' 'web' 'foo')
 
layouts=('[]=' '[ ]' 'TTT' '[#]')
 
conky -c $HOME/.conkyrc-monster | dzen2 -h 18 -x 320 -ta r -e -p -fn &
 
# Check if it's a pipe, otherwise create it
[[ -p $ff ]] || mkfifo -m 600 "$ff"
 
while read -t 60 -r wmout || true; do
desktops=( $(cut -d"|" -f1 <<< "$wmout") )
title="$(cut -d"|" -f2- <<< "$wmout")"
 
if [[ "${desktops[@]}" =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]]; then
unset tmp
 
for desktop in "${desktops[@]}"; do
IFS=':' read -r d w m c u <<< "$desktop"
 
# Tags labels
label="${tags[$d]}"
 
# Is this the current desktop ? save the layout
((c)) && fg="#fefefe" bg="#204a87" && layout="${layouts[$m]}" \
|| fg="#b3b3b3" bg=""
 
# Has windows ?
((w)) && fg="#fce94f"
 
# Urgent windows ?
((u)) && fg="#ef2929"
 
tmp+="^fg($fg)^bg($bg) $label ^bg()^fg()"
done
fi
 
# Merge the clients indications, the tile and the info
echo "$tmp $layout $title"
done < "$ff" | dzen2 -w 320 -h 18 -ta l -e -p &
 
while :; do "$wm" || break; done | tee -a "$ff"
 

x

.conkyrc-monster(raw, dl)

1
2
3
4
5
6
7
8
9
out_to_console yes
out_to_x no
background no
update_interval 2
total_run_times 0
use_spacer none

TEXT
${cpu cpu}% :: ${execi 250 sysctl |grep hw.sensors.lmtemp0 |head -n1 | sed 's/^.*\=//'}c :: $memperc% ($mem) :: ${downspeed fxp0} K/s :: ${upspeed fxp0} K/s :: $mpd_artist $mpd_title ${time %a %b %d %I:%M%P}
 

x

Notes

This is a simple monsterwm configuration “config.h” of this, is based in the Shinryuu’s config.

Bar is dzen with parssing fifo date to monsterwm :), and using a conky for other info.

To launch this in .xinitrc or different script only add this:

bash $HOME/.monsterwmbar.sh

.Xdefaults config: http://ompldr.org/vZ3ozMA/.Xdefaults

Wallpaper: http://ompldr.org/vaDZpbw/wall_mokou_lol_smoke_wtf.png

Comments

zerdnem said about 4 years ago

noob question, what is the MOD5 key? lel

Shinryuu said about 4 years ago

@zerdnem
I believe it’s Alt_Gr (ISO_Shift_3) key

zerdnem said about 4 years ago

@Shinryuu
oh the right alt key, thanks