guest@dotshare [~/groups/wms/dwm] $ ls my-dwm/ | cat

my dwm (scrot) (+6 likes)

bollovan Jul 15, 2011 (wms/dwm)

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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/* MIT/X Consortium License */

/* appearance */
//static const char font[] = "-*-terminus-*-*-*-*-*-*-*-*-*-*-*-*";
//static const char font[]   = "-artwiz-cureextra-*-*-*-*-*-*-*-*-*-*-*-*";
static const char font[]   = "-*-terminusmod-medium-r-normal-*-*-*-*-*-*-*-*-*";
//static const char font[]   = "-*-neep-medium-r-semicondensed-*-*-*-*-*-*-*-*-";
#define BOTTOM_GAP 20
static const unsigned int gappx = 5;
#define NUMCOLORS 8 
static const char colors[NUMCOLORS][ColLast][8] = {
// border foreground background
{ "#212121", "#696969", "#121212" }, // 0 = normal
{ "#696969", "#E0E0E0", "#121212" }, // 1 = selected
{ "#212121", "#CF4F88", "#121212" }, // 2 = red
{ "#212121", "#53A6A6", "#121212" }, // 3 = green
{ "#212121", "#FBB600", "#121212" }, // 4 = yellow
{ "#212121", "#47959E", "#121212" }, // 5 = cyan
{ "#212121", "#7E62B3", "#121212" }, // 6 = magenta
{ "#212121", "#C0C0C0", "#121212" }, // 7 = white
};

static const unsigned int borderpx  = 1;        /* border pixel of windows */
static const unsigned int snap      = 4;        /* snap pixel */
static const Bool showbar           = True;     /* False means no bar */
static const Bool topbar            = True;     /* False means bottom bar */

#define TAG_MAIN        1 << 0
#define TAG_WWW         1 << 1
#define TAG_GAMES       1 << 2
#define TAG_IRC         1 << 3
#define TAG_CODE        1 << 4
#define TAG_IM          1 << 5
#define TAG_MEDIA       1 << 6
#define TAG_MISC        1 << 7
#define TAG_ETC         1 << 8
static const Rule rules[] = {
	/* class           instance             title   tags mask     isfloating   monitor */
	{ "Gimp",           NULL,                NULL,   TAG_MISC,      True,        -1 },
	{ "Vimprobable",    NULL,                NULL,   TAG_WWW,      False,        -1 },
	{ "Tabbed",         NULL,                NULL,   TAG_WWW,      False,        -1 },
	{ "Skype",          NULL,                NULL,   TAG_IM,        True,        -1 },
	{ "Filezilla",      NULL,                NULL,   TAG_MISC,      True,        -1 },
	{ "MPlayer",        NULL,                NULL,   TAG_MEDIA,     True,        -1 },
	{ "VLC",            NULL,                NULL,   TAG_MEDIA,    False,        -1 },
	{ "Smplayer",       NULL,                NULL,   TAG_MEDIA,    False,        -1 },
	{ "Truecrypt",      NULL,                NULL,   TAG_ETC,       True,        -1 },
	{ "Zenity",         NULL,                NULL,   0,             True,        -1 },
	{ "Keepassx",       NULL,                NULL,   TAG_MISC,      True,        -1 },
	{  NULL,            NULL,        "scratchpad",   0,             True,        -1 },
	{ "Pidgin",         NULL,                NULL,   TAG_IM,        True,        -1 },
	{ "Chromium",       NULL,                NULL,   TAG_WWW,       True,        -1 },
	{ "Deluge",         NULL,                NULL,   TAG_ETC,       True,        -1 },
	{ "Geeqie",         NULL,                NULL,   0,             True,        -1 },
	{ "GThumb",         NULL,                NULL,   0,             True,        -1 },
	{ "Wicd",           NULL,                NULL,   0,             True,        -1 },
	{ "Codeblocks",     NULL,                NULL,   TAG_CODE,     False,        -1 },
	{ "net-minecraft",  NULL,                NULL,   TAG_GAMES,    False,        -1 },
	{  NULL,            NULL, "cb_console_runner",   TAG_CODE,      True,        -1 },
	{  NULL,            NULL,           "weechat",   TAG_IRC,      False,        -1 },
	{ "Geany",          NULL,                NULL,   TAG_CODE,     False,        -1 },
	{ "Evince",         NULL,                NULL,   0,             True,        -1 },
};

/* tags & layouts */
static const char      *tags[] = { "½ main", "Ñ www", "¾ game", "Â irc", "5-code", "Ï im", "7-media", "8-misc", "9-etc" };
static const int initlayouts[] = { 0, 0, 1, 0, 2 }; 

static const float mfact       = 0.55;  /*  factor of master area size [0.05..0.95]         */
static const Bool resizehints  = False; /*  True means respect size hints in tiled resizals */

//#include "bstack.c"
//#include "bstackhoriz.c"
//#include "pidgin-grid.c"
static const Layout  layouts[] = {
	/* symbol     arrange function   */
	{ "þ",      bstack },  /* first entry is default */
	{ "ú",      monocle },
	{ "ý",      NULL },
	{ "ÿ",      tile },
	{ "û",      bstackhoriz },
//	{ "[P}",    pidgin },
};

/*  key definitions  */
#define TAGKEYS(KEY,TAG) \
	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },


/* commands */
static const char  *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", colors[0][ColBG], "-nf", colors[0][ColFG], "-sb", colors[1][ColBG], "-sf", colors[1][ColFG], NULL };
static const char   *termcmd[] = { "urxvtc", NULL };
static const char    *irccmd[] = { "urxvtc", "-e", "'tmux", "-e", "weechat-curses'", NULL };
static const char    *wwwcmd[] = { "chromium", NULL };
static const char   *tmuxcmd[] = { "urxvtc", "-title", "tmux", "-e", "tmux", NULL };
static const char    *padcmd[] = { "urxvtc", "-title", "scratchpad", "-geometry", "70x20+504+12", NULL };
static const char   *wicdcmd[] = { "urxvtc", "-title", "scratchpad", "-geometry", "70x20+504+12", "-e", "wicd-curses", NULL };

#define ZSHCMD(cmd) { .v = (const char*[]){ "/bin/zsh", "-c", cmd, NULL } }

#define MODKEY Mod4Mask
#define ALT    Mod1Mask
static Key keys[] = {
	/*   modifier                   key        function        argument                */
	{ 0,                            XK_Menu,   spawn,          {.v = dmenucmd }        },
	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd }         },
	{ MODKEY|ShiftMask,             XK_i,      spawn,          {.v = irccmd }          },
	{ MODKEY,                       XK_w,      spawn,          {.v = wicdcmd }         }, 
	{ ControlMask|ALT,              XK_t,      spawn,          {.v = tmuxcmd }         },
  	{ ControlMask|MODKEY,           XK_p,      spawn,          {.v = padcmd }          },
        { ControlMask|ALT,              XK_q,      spawn,          ZSHCMD("oblogout")      },
	{ MODKEY,                       XK_b,      togglebar,      {0}                     },
	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 }              },
	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 }              },
        { MODKEY,                       XK_s,      swapfocus,      {0}                     },
	{ MODKEY|ControlMask,           XK_j,      pushdown,       {0}                     },
	{ MODKEY|ControlMask,           XK_k,      pushup,         {0}                     },
	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05}            },
	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05}            },
	{ MODKEY,                       XK_Return, zoom,           {0}                     },
	{ MODKEY,                       XK_Tab,    view,           {0}                     },
	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0}                     },
	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[1]}      },
	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]}      },
        { MODKEY|ShiftMask,             XK_t,      setlayout,      {.v = &layouts[3]}      },
	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[2]}      },
 	{ MODKEY,                       XK_space,  setlayout,      {0}                     },
	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0}                     },
	{ MODKEY,                       XK_0,      view,           {.ui = ~0 }             },
	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 }             },
	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 }              },
	{ MODKEY,                       XK_period, focusmon,       {.i = +1 }              },
	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 }              },
	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 }              },
  	{ MODKEY|ControlMask,           XK_Left,   tagcycle,       {.i = -1 }              },
	{ MODKEY|ControlMask,           XK_Right,  tagcycle,       {.i = +1 }              },
	{ 0,                            XF86XK_HomePage,          spawn,     ZSHCMD("chromium") },
	{ 0,                            XF86XK_AudioPlay,         spawn,     ZSHCMD("mpc toggle") },
	{ 0,                            XF86XK_AudioPrev,         spawn,     ZSHCMD("mpc prev") },
	{ 0,                            XF86XK_AudioNext,         spawn,     ZSHCMD("mpc next") },
	{ 0,                            XF86XK_AudioStop,         spawn,     ZSHCMD("mpc stop") },
	{ 0,                            XF86XK_AudioLowerVolume,  spawn,     ZSHCMD("amixer -c 1 set PCM 1dB-") },
	{ 0,                            XF86XK_AudioRaiseVolume,  spawn,     ZSHCMD("amixer -c 1 set PCM 1dB+") },
	{ 0,                            XF86XK_AudioMute,         spawn,     ZSHCMD("amixer -c 1 set PCM toggle") },
	{ 0,                            XF86XK_Sleep,             spawn,     ZSHCMD("slimlock") },
	{ 0,                            XK_Print,                 spawn,     ZSHCMD("scrot -cd 5 'dwm-%H:%M-%d-%m-%Y.png' -e 'mv $f /home/derp/scrots && mirage  ~/scrots/$n'") },
	{ MODKEY,                       XK_Print,                 spawn,     ZSHCMD("import $HOME/scrots/dwm-$(date%H:%M-%d-%m-%Y.png) ") },
	  TAGKEYS(                        XK_1,                      0)
	  TAGKEYS(                        XK_2,                      1)
	  TAGKEYS(                        XK_3,                      2)
	  TAGKEYS(                        XK_4,                      3)
	  TAGKEYS(                        XK_5,                      4)
	  TAGKEYS(                        XK_6,                      5)
	  TAGKEYS(                        XK_7,                      6)
	  TAGKEYS(                        XK_8,                      7)
	  TAGKEYS(                        XK_9,                      8)
	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
};

/* button definitions */
/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
	/* click                event mask      button          function        argument */
	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
	{ ClkTagBar,            0,              Button1,        view,           {0} },
	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      

CLICK TO VIEW

x

dwm-status(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
# file:         ~/.bin/dwm-status
# description:  status script for dwm's statusbar
# vim: ft=zsh: fdm=marker:
#!/bin/zsh
date_format="%H:%M, %A %d %B"

internet_checker()  # {{{
{
        if host google.com &> /dev/null ; then
        echo "ON" ; else
        echo "OFF"
        fi
} # }}}

gmail_website_checker() { # {{{
        if host mail.google.com &> /dev/null ; then
        echo "ON"; else 
        echo "OFF"
        fi
} # }}}

gmail_notify() # {{{
{
        if [[ $(internet_checker) == ON ]]  ; then
                . $HOME/backup/gmail # $username and $password here
                curl -s https://"$username":"$password"@mail.google.com/mail/feed/atom &> ${HOME}/.mailcache
                fullcount=$(awk -F '</?fullcount>' 'NF>1{print $2}' ${HOME}/.mailcache)
                if [[ "$fullcount" == '0' ]] ; then
                        echo -e "  \x06Ê \x07no new emails\x01"
                elif [[ "$fullcount" == '1' ]] ; then
                        echo -e "  \x05Ê 1\x07 new email\x01"
                else echo -e "  \x05Ê \x05${fullcount}\x01 \x07new emails\x01"
                fi
        fi
} # }}}

date_get() # {{{
{
        date_command=$(date +"$date_format")
        echo -e " \x06É \x03${date_command}\x01"
} # }}}

mpd_check() # {{{
{
         if mpc &> /dev/null && [[ $(mpc | wc -l) != 1 ]]; then
         echo "ON" ; else
         echo "OFF"
         fi
} # }}}

check_mpd_pause() { # {{{
        if [[ $(mpc | awk 'NR==2 {print $1}') == "[paused]" ]] ; then
        echo " ç"
        fi
}      # }}}

mpd_details() { # {{{{
        if [[ $(mpd_check) == ON ]] ; then
        echo -e "\x07ê \x06$(mpc | head -1)\x01\x03$(check_mpd_pause)\x01 \x08$(mpc | awk 'NR==2 {print $3}')\x01"
        fi
} # }}}

# main
xsetroot -name "$(mpd_details)$(gmail_notify) $(date_get)"
 

x

Notes

Simple dwm setup.Patches are bottom stack,trayer patch(from arch bbs),statuscolors and others(can’t think of all of them right now).The weird symbols in tags,layouts and status script are custom glyphs from the font which have icons in them.
The font in the terminal is iris from sgi fonts at size 10.The font in the bars are terminusmod from arch linux AUR which adds boldface to the 12 point terminus font and also has icons.

Comments

iimblack said about 5 years ago

If you could post more details about your setup, such as what patches and in what order they were applied, that would be awesome.

bollovan said about 5 years ago

I can’t really remember,my dwm.c is a mess.I have many patches applied,like pertag,uselessgap,fancybar and others but they don’t work,though dwm compiles without errors.
I first used jasonwryan’s dwm.c and config.h and then applied other patches,but forgot in what order.

gorgatron said about 5 years ago

how does the statusbar get launched?

bollovan said about 5 years ago

@gorgatron
Which one?

gorgatron said about 5 years ago

The top one. Did you put that info in xinitrc?

bollovan said about 5 years ago

It’s the script dwm-status, which gets launched in another script called dwm-start which starts dwm and launches that script.

while true; do
“$HOME/.bin/dwm-status” &
sleep 1;
done &

Kodiak said about 4 years ago

bollovan, if you would be so kind, could you share the normal and bold versions of “iris”? I’ve been looking and looking for it and it seems it’s not in existence anymore on SGI’s website, or in any distro’s repos.

Thanks.