/* See LICENSE file for copyright and license details. */ #include /* appearance */ static const unsigned int borderpx = 2; /* border pixel of windows */ static const unsigned int snap = 32; /* snap pixel */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ static const char *fonts[] = { "monospace:size=10" }; static const char dmenufont[] = "monospace:size=10"; static const char col_gray1[] = "#222222"; static const char col_gray2[] = "#444444"; static const char col_gray3[] = "#bbbbbb"; static const char col_gray4[] = "#eeeeee"; static const char col_cyan[] = "#005577"; static const char col_red[] = "#ff0000"; static const char *colors[][3] = { /* fg bg border */ [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, [SchemeSel] = { col_gray4, col_cyan, col_red }, }; /* tagging */ static const char *tags[] = { "TTY", "WEB", "DEV", "SBX", "GAM", "MED", "SYS", "SRV", "ETC" }; static const Rule rules[] = { /* xprop(1): * WM_CLASS(STRING) = instance, class * WM_NAME(STRING) = title */ /* class instance title tags mask isfloating monitor */ { "feh", NULL, NULL, 0, 1, -1 }, { "zenity", NULL, NULL, 0, 1, -1 }, }; /* layout(s) */ static const float mfact = .5; /* factor of master area size [0.05..0.95] */ static const int nmaster = 1; /* number of clients in master area */ static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ static const Layout layouts[] = { /* arrange function */ { tile }, /* first entry is default */ { monocle }, }; /* key definitions */ #define MODKEY Mod4Mask #define TAGKEYS(KEY,TAG) \ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ #define CMD(...) {__VA_ARGS__, NULL} /* commands */ static const char *dmenucmd[] = CMD("dmenu_run", "-i", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4); static const char *termcmd[] = CMD("alacritty"); static const char *lockcmd[] = CMD("lock"); static const char *wwwcmd[] = CMD("bookmarks"); static const char *pwwwcmd[] = CMD("bookmarks", "-p"); static const char *calccmd[] = CMD("alacritty", "-epython"); static const char *prtsccmd[] = CMD("sh", "-c", "magick import png:- | xclip -sel c -t image/png && xclip -sel c -o | feh -"); static const char *spkdefcmd[] = CMD("wpdef", "s"); static const char *spklcmd[] = CMD("vol", "s", "-5"); static const char *spkrcmd[] = CMD("vol", "s", "+5"); static const char *spkmutecmd[] = CMD("vol", "s", "m"); static const char *micdefcmd[] = CMD("wpdef", "m"); static const char *miclcmd[] = CMD("vol", "m", "-5"); static const char *micrcmd[] = CMD("vol", "m", "+5"); static const char *micmutecmd[] = CMD("vol", "m", "m"); static const char *pausecmd[] = CMD("playerctl", "play-pause"); static const char *prevcmd[] = CMD("playerctl", "previous"); static const char *nextcmd[] = CMD("playerctl", "next"); static const char *stopcmd[] = CMD("playerctl", "stop"); static const char *lbrtcmd[] = CMD("light", "-1"); static const char *rbrtcmd[] = CMD("light", "+1"); static const char *passselectcmd[] = CMD("nohup", "pass", "select"); static const char *passopencmd[] = CMD("pass", "openurl"); static const char *passusercmd[] = CMD("pass", "printuser"); static const char *passpasscmd[] = CMD("pass", "printpass"); static const char *passotpcmd[] = CMD("pass", "printotp"); static const Key keys[] = { /* modifier key function argument */ { MODKEY, XK_r, spawn, {.v = dmenucmd } }, { MODKEY, XK_Return, spawn, {.v = termcmd } }, { MODKEY, XK_x, spawn, {.v = lockcmd } }, { MODKEY, XK_b, spawn, {.v = wwwcmd } }, { MODKEY|ShiftMask, XK_b, spawn, {.v = pwwwcmd } }, { 0, XF86XK_Calculator, spawn, {.v = calccmd } }, { 0, XK_Print, spawn, {.v = prtsccmd } }, { MODKEY, XK_v, spawn, {.v = spkdefcmd } }, { 0, XF86XK_AudioLowerVolume, spawn, {.v = spklcmd } }, { 0, XF86XK_AudioRaiseVolume, spawn, {.v = spkrcmd } }, { 0, XF86XK_AudioMute, spawn, {.v = spkmutecmd } }, { MODKEY|ShiftMask, XK_v, spawn, {.v = micdefcmd } }, { ShiftMask, XF86XK_AudioLowerVolume, spawn, {.v = miclcmd } }, { ShiftMask, XF86XK_AudioRaiseVolume, spawn, {.v = micrcmd } }, { ShiftMask, XF86XK_AudioMute, spawn, {.v = micmutecmd } }, { 0, XF86XK_AudioMicMute, spawn, {.v = micmutecmd } }, { 0, XF86XK_AudioPlay, spawn, {.v = pausecmd } }, { 0, XF86XK_AudioPrev, spawn, {.v = prevcmd } }, { 0, XF86XK_AudioNext, spawn, {.v = nextcmd } }, { 0, XF86XK_AudioStop, spawn, {.v = stopcmd } }, { 0, XF86XK_MonBrightnessDown, spawn, {.v = lbrtcmd } }, { 0, XF86XK_MonBrightnessUp, spawn, {.v = rbrtcmd } }, { MODKEY, XK_p, spawn, {.v = passselectcmd } }, { MODKEY|ShiftMask, XK_p, spawn, {.v = passopencmd } }, { MODKEY, XK_u, spawn, {.v = passusercmd } }, { MODKEY, XK_i, spawn, {.v = passpasscmd } }, { MODKEY, XK_o, spawn, {.v = passotpcmd } }, { MODKEY, XK_j, focusstack, {.i = +1 } }, { MODKEY, XK_k, focusstack, {.i = -1 } }, { MODKEY, XK_h, setmfact, {.f = -0.05 } }, { MODKEY, XK_l, setmfact, {.f = +0.05 } }, { MODKEY, XK_equal, setmfact, {.f = 1.5 } }, { MODKEY|ShiftMask, XK_z, zoom, {0} }, { MODKEY|ShiftMask, XK_c, killclient, {0} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0] } }, { MODKEY, XK_m, setlayout, {.v = &layouts[1] } }, { MODKEY, XK_space, togglefloating, {0} }, { MODKEY, XK_f, togglefullscr, {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) 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 ClkTagBar, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ static const Button buttons[] = { /* click event mask button function argument */ { ClkClientWin, MODKEY, Button1, movemouse, {0} }, { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, { ClkTagBar, 0, Button1, view, {0} }, };