/* See LICENSE file for copyright and license details. */ #include "X11/XF86keysym.h" /* appearance */ static const char font[] = "-nil-profont-medium-r-normal--12-120-72-72-c-60-iso8859-1"; static const char normbordercolor[] = "#333333"; static const char normbgcolor[] = "#051121"; static const char normfgcolor[] = "#FFFFFF"; static const char selbordercolor[] = "#1793D1"; static const char selbgcolor[] = "#1793D1"; static const char selfgcolor[] = "#FFFFFF"; static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int gappx = 3; /* gap pixel between windows */ static const unsigned int snap = 32; /* snap pixel */ static const Bool showbar = True; /* False means no bar */ static const Bool topbar = True; /* False means bottom bar */ /* tagging */ static const char *tags[] = { "term", "www", "dev", "design", "files", "media", "im" }; #define TAG_TERM 1 << 0 #define TAG_WWW 1 << 1 #define TAG_DEV 1 << 2 #define TAG_DESIGN 1 << 3 #define TAG_FILES 1 << 4 #define TAG_MEDIA 1 << 5 #define TAG_IM 1 << 6 static const Rule rules[] = { /* class instance title tags mask isfloating monitor */ { "Gimp", NULL, NULL, TAG_DESIGN, True, -1 }, { "Dwb", NULL, NULL, TAG_WWW, False, -1 }, { "Firefox", NULL, NULL, TAG_WWW, True, -1 }, { "Skype", NULL, NULL, TAG_IM, True, -1 }, { "Gftp", NULL, NULL, TAG_WWW, False, -1 }, { "MPlayer", NULL, NULL, 0, True, -1 }, { "Vlc", NULL, NULL, TAG_MEDIA, False, -1 }, { "Zenity", NULL, NULL, 0, True, -1 }, { "Pidgin", NULL, NULL, TAG_IM, True, -1 }, { "Transmission-gtk", NULL, NULL, TAG_WWW, False, -1 }, { "Gpicview", NULL, NULL, 0, False, -1 }, { "Wicd", NULL, NULL, 0, True, -1 }, { "Geany", NULL, NULL, TAG_DEV, False, -1 }, { "Epdfview", NULL, NULL, 0, False, -1 }, { "Pcmanfm", NULL, NULL, TAG_FILES, False, -1 }, { "pygtk-shutdown", NULL, NULL, 0, True, -1 }, }; /* layout(s) */ static const float mfact = 0.55; /* 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 */ #include "fibonacci.c" #include "grid.c" static const Layout layouts[] = { /* symbol arrange function */ { "[]=", tile }, /* first entry is default */ { "><>", NULL }, /* no layout function means floating behavior */ { "[M]", monocle }, { "[@]", spiral }, { "[\\]", dwindle }, { "HHH", grid }, { "TTT", bstack }, { .symbol = NULL, .arrange = NULL}, }; /* 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} }, /* commands */ static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; static const char *termcmd[] = { "urxvtc", NULL }; static const char *pcmanfmcmd[] = { "pcmanfm", NULL }; static const char *geanycmd[] = {"geany", NULL }; static const char *powercmd[] = { "pygtk-shutdown", NULL }; static const char *tmuxcmd[] = { "urxvtc", "-title", "tmux", "-e", "tmux", 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 *imcmd[] = { "pidgin", NULL }; static const char *browsercmd[] = { "dwb", NULL }; static const char *mpc_next[] = { "mpc", "next", NULL }; static const char *mpc_prev[] = { "mpc", "prev", NULL }; static const char *mpc_play[] = { "mpc", "play", NULL }; static const char *mpc_stop[] = { "mpc", "stop", NULL }; static const char *screencmd[] = {"screenshot.sh", NULL} static Key keys[] = { /* modifier key function argument */ { MODKEY, XK_p, spawn, {.v = dmenucmd } }, { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, { Mod4Mask, XK_t, spawn, {.v = tmuxcmd } }, { Mod4Mask, XK_p, spawn, {.v = pcmanfmcmd } }, { Mod4Mask, XK_i, spawn, {.v = imcmd } }, { 0, XF86XK_HomePage, spawn, {.v = browsercmd} }, { MODKEY, XK_e, spawn, {.v = geanycmd } }, { MODKEY, XK_End, spawn, {.v = powercmd } }, { MODKEY, 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} }, /* Layout switching */ { Mod4Mask|ShiftMask, XK_t, setlayout, {.v = &layouts[0]} }, { Mod4Mask|ShiftMask, XK_f, setlayout, {.v = &layouts[1]} }, { Mod4Mask|ShiftMask, XK_m, setlayout, {.v = &layouts[2]} }, { Mod4Mask|ShiftMask, XK_s, setlayout, {.v = &layouts[3]} }, { Mod4Mask|ShiftMask, XK_w, setlayout, {.v = &layouts[4]} }, { Mod4Mask|ShiftMask, XK_g, setlayout, {.v = &layouts[5]} }, { Mod4Mask|ShiftMask, XK_b, setlayout, {.v = &layouts[6]} }, { MODKEY, XK_space, nextlayout, {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 } }, /* move/resize */ { MODKEY, XK_Down, moveresize, {.v = (int []){ 0, 25, 0, 0 }}}, { MODKEY, XK_Up, moveresize, {.v = (int []){ 0, -25, 0, 0 }}}, { MODKEY, XK_Right, moveresize, {.v = (int []){ 25, 0, 0, 0 }}}, { MODKEY, XK_Left, moveresize, {.v = (int []){ -25, 0, 0, 0 }}}, { MODKEY|ShiftMask, XK_Down, moveresize, {.v = (int []){ 0, 0, 0, 25 }}}, { MODKEY|ShiftMask, XK_Up, moveresize, {.v = (int []){ 0, 0, 0, -25 }}}, { MODKEY|ShiftMask, XK_Right, moveresize, {.v = (int []){ 0, 0, 25, 0 }}}, { MODKEY|ShiftMask, XK_Left, moveresize, {.v = (int []){ 0, 0, -25, 0 }}}, /* mlutimedia keys */ { 0, XF86XK_AudioLowerVolume, spawn, {.v = voldowncmd } }, { 0, XF86XK_AudioMute, spawn, {.v = voltogglecmd } }, { 0, XF86XK_AudioRaiseVolume, spawn, {.v = volupcmd } }, { 0, XF86XK_AudioPlay, spawn, {.v = mpc_play } }, { 0, XF86XK_AudioNext, spawn, {.v = mpc_next } }, { 0, XF86XK_AudioPrev, spawn, {.v = mpc_prev } }, { 0, XF86XK_AudioStop, spawn, {.v = mpc_stop } }, { 0, XK_Print, spawn, {.v = screencmd} }, 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, nextlayout, {0} }, { ClkLtSymbol, 0, Button3, prevlayout, {0} }, { 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, {0} }, };