guest@dotshare [~/groups/wms/dwm] $ ls My-old-dwm-configh/ | cat

My old dwm config.h (raw, dl)

defektz Jul 14, 2012 (wms/dwm)
  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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
/* See LICENSE file for copyright and license details. */
#include "im-grid.c"
#include "push.c"
#include "X11/XF86keysym.h"
#include "togglefullscreen.c"

/* appearance */
static const char font[]            = "-*-ohsnap.icons-medium-*-*-*-11-*-*-*-*-*-*-*";

#define NUMCOLORS 9
static const char colors[NUMCOLORS][ColLast][9] = {
    // border     foreground background
    { "#1A1A1A", "#268bd2", "#020202" },  // gray
    { "#4C4C4C", "#6c71c4", "#020202" },  // white
    { "#B3354C", "#B3354C", "#020202" },  // light red
    { "#1C678C", "#1C678C", "#020202" },  // blue
    { "#684D80", "#684D80", "#020202" },  // magenta
    { "#877C43", "#877C43", "#020202" },  // yellow
    { "#608040", "#586e75", "#020202" },  // green
    { "#337373", "#337373", "#020202" },  // cyan
    { "#A64286", "#A64286", "#020202" },  // light cyan
};
static const char normbordercolor[]	 = "#6c71c4";
static const char normbgcolor[]		 = "#232323";
static const char normfgcolor[]		 = "#586e75";
static const char selbordercolor[]	 = "#6c71c4";
static const char selbgcolor[]		 = "#6c71c4";
static const char selfgcolor[]		 = "#6c71c4";
static const unsigned int borderpx       = 1;                // border pixel of windows
static const unsigned int snap           = 5;                // snap pixel
static const unsigned int systrayspacing = 1;                // space between systray icons
static const Bool showsystray            = True;             // False means no systray
static const Bool showbar                = True;             // False means no bar
static const Bool topbar                 = True;             // False means bottom bar
static Bool useicons                     = True;             // False means use ascii symbols
static const char scratchpadname[]       = "Scratchpad";

/* layout(s) */
static const float mfact      = 0.50;     // factor of master area size [0.05..0.95]
static const Bool resizehints = False;    // True means respect size hints in tiled resizals
static const int nmaster      = 1;        // default number of clients in the master area

static const Layout layouts[] = {
    // icon                                    symbol    arrange function
    { "/home/simon/dwm/icons/tile.xbm",     "þ",      tile },
    { "/home/simon/dwm/icons/bstack.xbm",   "ü",      bstack },
    { "/home/simon/dwm/icons/float.xbm",    "ý",      NULL },     // no layout function means floating behavior
    { "/home/simon/dwm/icons/monocle.xbm",  "ÿ",      monocle },
    { "/home/simon/dwm/icons/grid.xbm",     "ú",      imgrid },
};

static const MonocleNumberedIcon monoclenumberedicons[] = {
	{ "/home/simon/dwm/icons/monocle0.xbm" },
	{ "/home/simon/dwm/icons/monocle1.xbm" },
	{ "/home/simon/dwm/icons/monocle2.xbm" },
	{ "/home/simon/dwm/icons/monocle3.xbm" },
	{ "/home/simon/dwm/icons/monocle4.xbm" },
	{ "/home/simon/dwm/icons/monocle5.xbm" },
};

/* tagging */
static const Tag tags[] = {
        // name       layout           mfact    nmaster
        { "ett",        &layouts[3],     -1,      -1 },
        { "warez",        &layouts[3],     -1,      -1 },
        { "pr0n",        &layouts[3],     -1,      -1 },
        { "mirkk",        &layouts[1],     -1,      -1 },
        { "internet",        &layouts[4],   0.22,      -1 },
        { "23",        &layouts[0],   0.65,      -1 },
        { "dope",        &layouts[2],     -1,      -1 },
};

/* window rules */
static const Rule rules[] = {
        // class                  instance  title                  tags mask  isfloating  iscentred   monitor
        {  NULL,                  NULL,     "tmux",                1 << 0,    False,                  -1 },
        { "Dwb",                  NULL,      NULL,                 1 << 1,    False,                  -1 },
        { "Firefox",              NULL,      NULL,                 1 << 1,    False,                  -1 },
        { "OperaNext",            NULL,      NULL,                 1 << 1,    False,                  -1 },
        { "Opera",                NULL,      NULL,                 1 << 1,    False,                  -1 },
        { "Cr3",                  NULL,      NULL,                 1 << 2,    False,                  -1 },
        { "Lazarus",              NULL,      NULL,                 1 << 3,    True,       False,      -1 },
        { "Skype",                NULL,      NULL,                 1 << 4,    False,                  -1 },
        {  NULL,                  NULL,     "Weechat",             1 << 4,    False,                  -1 },
        { "Gimp",                 NULL,      NULL,                 1 << 6,    True,                   -1 },
        { "Xsane",                NULL,      NULL,                 1 << 6,    True,       False,      -1 },
        { "Gsimplecal",           NULL,      NULL,                 0,         True,       False,      -1 },
        { "Lxappearance",         NULL,      NULL,                 0,         True,                   -1 },
        { "mplayer2",             NULL,      NULL,                 0,         True,                   -1 },
        { "Nitrogen",             NULL,      NULL,                 0,         True,                   -1 },
        { "Qalculate-gtk",        NULL,      NULL,                 0,         True,                   -1 },
        { "Qalculate",            NULL,      NULL,                 0,         True,                   -1 },
        { "Qpass",                NULL,      NULL,                 0,         True,                   -1 },
        { "URxvt",                NULL,      NULL,                 0,         False,                  -1 },
        { "Stardict",             NULL,      NULL,                 0,         True,                   -1 },
        { "Zenity",               NULL,      NULL,                 0,         True,                   -1 },
};

/* key definitions */
#define MODKEY Mod1Mask
#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} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static const char *addresscmd[]    = { "urxvt", "-title", "abook", NULL };
static const char *browsercmd[]    = { "luakit", NULL };
static const char *calendarcmd[]   = { "gsimplecal", NULL };
static const char *cpucmd[]        = { "/home/simon/bin/cpu_control.sh", NULL };
static const char *dictcmd[]       = { "stardict", NULL };
static const char *dmenucmd[]      = { "dmenu_run", "-i", "-fn", font, "-nb", colors[0][ColBG], "-nf", colors[0][ColFG],
                                       "-sb", colors[1][ColBG], "-sf", colors[1][ColFG], NULL };
static const char *fancmd[]        = { "/home/simon/bin/fan_control.sh", NULL };
static const char *imcmd[]         = { "pidgin", NULL };
static const char *irccmd[]        = {"urxvt", "-title", "Weechat", "-e", "weechat-curses", NULL };
static const char *logoutcmd[]     = { "sudo", "killall", "X", NULL };
static const char *menucmd[]       = { "mygtkmenu", "/home/simon/.menu", NULL };
static const char *monitorcmd[]    = { "/home/simon/bin/monitor-dwm.sh", NULL };
static const char *passcmd[]       = { "qpass", NULL };
static const char *reloadcmd[]     = { "/home/simon/bin/dwm-reload.sh", NULL };
static const char *scratchpadcmd[] = { "urxvt", "-title", scratchpadname, "-geometry", "70x9+400+10", NULL };
static const char *screenoffcmd[]  = { "xset", "dpms", "force", "off", NULL };
static const char *shutdowncmd[]   = { "/home/simon/bin/dmenu-powerbutton", NULL };
static const char *termcmd[]       = { "urxvt", NULL };
static const char *tmuxcmd[]       = { "urxvt", "-title", "tmux", "-e", "tmux", "attach", NULL };
static const char *voldowncmd[]    = { "amixer", "-q", "set", "Master", "2dB-",  NULL };
static const char *voltogglecmd[]  = { "amixer", "-q", "set", "Master", "toggle",  NULL };
static const char *volupcmd[]      = { "amixer", "-q", "set", "Master", "2dB+",  NULL };
static const char *wificmd[]       = { "urxvt", "-e", "sudo", "wifi-select", "wlan0", NULL };

static const char *playcmd[]       = { "player_control", "pause", NULL };
static const char *prevcmd[]       = { "player_control", "prev", NULL };
static const char *nextcmd[]       = { "player_control", "next", NULL };

static Key keys[] = {
   // modifier                       key                       function          argument
    { Mod4Mask,                      XK_a,                     spawn,            {.v = addresscmd } },
    { Mod4Mask,                      XK_b,                     spawn,            {.v = browsercmd } },
    { Mod4Mask,                      XK_d,                     spawn,            {.v = dmenucmd } },
    { 0,                             XK_Menu,                  spawn,            {.v = dictcmd } },
    { Mod4Mask,                      XK_p,                     spawn,            {.v = imcmd } },
    { Mod4Mask,                      XK_i,                     spawn,            {.v = irccmd } },
    { MODKEY|ShiftMask,              XK_e,                     spawn,            {.v = logoutcmd } },
    { Mod4Mask,                      XK_space,                 spawn,            {.v = menucmd } },
    { 0,                             XF86XK_Display,           spawn,            {.v = monitorcmd } },
    { Mod4Mask,                      XK_h,                     spawn,            {.v = passcmd} },
    { MODKEY|ShiftMask,              XK_r,                     spawn,            {.v = reloadcmd} },
    { 0,                             XK_F12,                   togglescratch,    {.v = scratchpadcmd} },
    { 0,                             XF86XK_Launch1,           spawn,            {.v = screenoffcmd } },
    { 0,                             XF86XK_PowerOff,          spawn,            {.v = shutdowncmd } },
    { MODKEY,                        XK_Return,                spawn,            {.v = termcmd } },
    { Mod4Mask,                      XK_t,                     spawn,            {.v = tmuxcmd } },
    { 0,                             XF86XK_AudioLowerVolume,  spawn,            {.v = voldowncmd } },
    { 0,                             XF86XK_AudioMute,         spawn,            {.v = voltogglecmd } },
    { 0,                             XF86XK_AudioRaiseVolume,  spawn,            {.v = volupcmd } },
    { Mod4Mask,                      XK_w,                     spawn,            {.v = wificmd } },

    { Mod4Mask,                      XK_Down,                  spawn,            {.v = playcmd } },
    { Mod4Mask,                      XK_Left,                  spawn,            {.v = prevcmd } },
    { Mod4Mask,                      XK_Right,                 spawn,            {.v = nextcmd } },

    { MODKEY,                        XK_Down,                  focusstack,       {.i = +1 } },
    { MODKEY,                        XK_Up,                    focusstack,       {.i = -1 } },
    { MODKEY,                        XK_Left,                  setmfact,         {.f = -0.01} },
    { MODKEY,                        XK_Right,                 setmfact,         {.f = +0.01} },
    { MODKEY|ShiftMask,              XK_Return,                zoom,             {0} },
    { Mod1Mask,                      XK_Tab,                   view,             {0} },
    { Mod4Mask,                      XK_c,                     killclient,       {0} },
    { MODKEY|ShiftMask,              XK_Left,                  incnmaster,       {.i = +1 } },
    { MODKEY|ShiftMask,              XK_Right,                 incnmaster,       {.i = -1 } },
    { MODKEY|ShiftMask,              XK_Down,                  pushdown,         {0} },
    { MODKEY|ShiftMask,              XK_Up,                    pushup,           {0} },
    { MODKEY,                        XK_t,                     setlayout,        {.v = &layouts[0]} },
    { MODKEY,                        XK_b,                     setlayout,        {.v = &layouts[1]} },
    { MODKEY,                        XK_f,                     setlayout,        {.v = &layouts[2]} },
    { MODKEY,                        XK_m,                     setlayout,        {.v = &layouts[3]} },
    { MODKEY,                        XK_g,                     setlayout,        {.v = &layouts[4]} },
    { MODKEY,                        XK_space,                 setlayout,        {0} },
    { MODKEY|ShiftMask,              XK_space,                 togglefloating,   {0} },
    { MODKEY,                        XK_eacute,                view,             {.ui = ~0 } },
    { MODKEY|ShiftMask,              XK_eacute,                tag,              {.ui = ~0 } },
    { MODKEY|ShiftMask,              XK_f,                     togglefullscreen, {0} },
    TAGKEYS(                         XK_plus,                                    0)
    TAGKEYS(                         XK_ecaron,                                  1)
    TAGKEYS(                         XK_scaron,                                  2)
    TAGKEYS(                         XK_ccaron,                                  3)
    TAGKEYS(                         XK_rcaron,                                  4)
    TAGKEYS(                         XK_zcaron,                                  5)
    TAGKEYS(                         XK_yacute,                                  6)
//    TAGKEYS(                         XK_aacute,                                  7)
//    TAGKEYS(                         XK_iacute,                                  8)
};

#include "tilemovemouse.c"
/* 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} },
    { ClkWinTitle,          0,              Button1,        focusstack,     {.i = +1 } },
    { ClkWinTitle,          0,              Button3,        focusstack,     {.i = -1 } },
    { ClkClientWin,         MODKEY,         Button1,        tilemovemouse,  {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,      {0} },
    { ClkRootWin,           0,              Button3,        spawn,          {.v = menucmd } },
    { ClkStatusText,        0,              Button1,        spawn,          {.v = calendarcmd } },
    { ClkStatusText,        0,              Button3,        spawn,          {.v = cpucmd } },
    { ClkStatusText,        MODKEY,         Button3,        spawn,          {.v = fancmd } },
};

CLICK TO VIEW

x

Notes

DWM 6.0 config.h
using these patches:
01-dwm-6.0-statuscolors.diff
02-dwm-6.0-pertag2.diff
03-dwm-6.0-scratchpad-stay.diff
04-dwm-6.0-xbm_layout_icons.diff
05-dwm-6.0-cflags.diff
06-dwm-6.0-monocle_no_borders.diff
07-dwm-6.0-centred-floating.diff
08-dwm-6.0-save_floats.diff