Skip to content

Instantly share code, notes, and snippets.

@joshua-mcintosh
Created September 17, 2012 22:09
Show Gist options
  • Save joshua-mcintosh/3740086 to your computer and use it in GitHub Desktop.
Save joshua-mcintosh/3740086 to your computer and use it in GitHub Desktop.
My config.h for dwm -- check date and git history for more
/* See LICENSE file for copyright and license details. */
/* appearance */
//static const char font[] = "-*-stlarch-*-*-*-*-*-10-*-*-*-*-*-*" "," "Inconsolata for Powerline:Medium:pixelsize=10:antialias=true:hinting=true";
static const char font[] = "-*-stlarch-*-*-*-*-12-*-*-*-*-*-*-*" "," "-*-terminus-*-*-*-*-12-*-*-*-*-*-*-*";
#define NUMCOLORS 5
static const char colors[NUMCOLORS][ColLast][9] = {
/* border foreground background */
/* gaia2 */
{ "#444444", "#bbbbbb", "#222222" }, // 1 = normal
{ "#005577", "#eeeeee", "#005577" }, // 2 = selected
{ "#F54844", "#F54844", "#6D9F99" }, // 3 = urgent
{ "#93C724", "#bbbbbb", "#6D9F99" }, // 4 = occupied
{ "#444444", "#51FF00", "#222222" }, // 5 = success
};
static const unsigned int systrayspacing = 1; // systray spacing
static const unsigned int borderpx = 1; // border pixel of windows
static const unsigned int gappx = 2; // gap pixel between windows
static const unsigned int snap = 2; // snap pixel
static const Bool showbar = True; // False means no bar
static const Bool showsystray = True; // False means no systray
static const Bool topbar = True; // False means bottom bar
static const unsigned int marginbottom = 16; // margin for bottom bars
/* layout(s) */
static const float mfact = 0.63; // factor of master area size [0.05..0.95]
static const int nmaster = 1; // number of clients in master area
static const Bool resizehints = True; // True means respect size hints in tiled resizals
static const Layout layouts[] = {
/* symbol gaps arrange function */
{ "", True, tile }, // first entry is default
{ "", True, bstack },
{ "", True, chat },
{ "", False, monocle },
{ "", False, NULL }, // no layout function means floating behavior
};
/* tagging */
static const Tag tags[] = {
/* name layout mfact nmaster*/
{ "", &layouts[3], -1, -1 },
{ "", &layouts[3], -1, -1 },
{ "", &layouts[0], 0.8, -1 },
{ "", &layouts[3], -1, -1 },
{ "", &layouts[3], -1, -1 },
};
static const Rule rules[] = {
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, True, -1 },
{ "Firefox", NULL, NULL, 1<<1, False, -1 },
{ "Surf", NULL, NULL, 1<<1, False, -1 },
{ "luakit", NULL, NULL, 1<<1, False, -1 },
{ "dzen2", NULL, NULL, ~0, True, -1 },
{ "URxvt", "bashrun2", NULL, ~0, True, -1 },
{ "Skype", NULL, NULL, 1 << 1, False, -1 },
};
/* key definitions */
#define MODKEY Mod4Mask
#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 *lockcmd[] = { "slimlock", NULL };
static const char *halt[] = { "dmenu_shutdown", NULL };
static const char *term[] = { "urxvtc", NULL };
static const char *browsercmd[] = { "firefox", NULL };
static const char *dmenucmd[] = { "dmenu_menu", NULL };
static const char *skype[] = { "skype", NULL };
static const char *volup[] = { "amixer", "-q", "sset", "Master", "5%+", "unmute", NULL };
static const char *voldown[] = { "amixer", "-q", "sset", "Master", "5%-", "unmute", NULL };
static const char *volmute[] = { "amixer", "-q", "sset", "Master", "toggle", NULL };
static const char *mpdplay[] = { "mpc", "toggle", NULL };
static const char *mpdnext[] = { "mpc", "next", NULL };
static const char *mpdprev[] = { "mpc", "prev", NULL };
static const char *mpdstop[] = { "mpc", "stop", NULL };
static Key keys[] = {
/* modifier key function argument */
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = term }},
{ Mod1Mask|ControlMask, XK_l, spawn, {.v = lockcmd } },
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_p, spawn, {.v = browsercmd } },
{ MODKEY, XK_s, spawn, {.v = skype } },
{ MODKEY, XK_Escape, spawn, {.v = halt } },
{ 0, 0x1008ff13, spawn, {.v = volup } },
{ 0, 0x1008ff11, spawn, {.v = voldown } },
{ 0, 0x1008ff12, spawn, {.v = volmute } },
{ 0, 0x1008ff14, spawn, {.v = mpdplay } },
{ 0, 0x1008ff17, spawn, {.v = mpdnext } },
{ 0, 0x1008ff16, spawn, {.v = mpdprev } },
{ 0, 0x1008ff15, spawn, {.v = mpdstop } },
{ MODKEY|ShiftMask, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ 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|ShiftMask, XK_q, quit, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0] } },
{ MODKEY, XK_b, setlayout, {.v = &layouts[1] } },
{ MODKEY, XK_c, setlayout, {.v = &layouts[2] } },
{ MODKEY, XK_m, setlayout, {.v = &layouts[3] } },
{ MODKEY, XK_f, setlayout, {.v = &layouts[4] } },
{ 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 } },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3)
TAGKEYS( XK_5, 4)
};
/* 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[4]} },
{ ClkStatusText, 0, Button2, spawn, {.v = term } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
};
// vim: set ts=4 :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment