config.h (13128B)
1 /* See LICENSE file for copyright and license details. */ 2 3 /* Allow use of special keys */ 4 #include <X11/XF86keysym.h> 5 6 /* appearance */ 7 static const unsigned int borderpx = 2; /* border pixel of windows */ 8 static const unsigned int snap = 32; /* snap pixel */ 9 static const int padbar = 8; /* adjusts the bars padding */ 10 static const int showbar = 1; /* 0 means no bar */ 11 static const int topbar = 1; /* 0 means bottom bar */ 12 static const unsigned int gappih = 0; /* horiz inner gap between windows */ 13 static const unsigned int gappiv = 0; /* vert inner gap between windows */ 14 static const unsigned int gappoh = 0; /* horiz outer gap between windows and screen edge */ 15 static const unsigned int gappov = 0; /* vert outer gap between windows and screen edge */ 16 static int smartgaps = 1; /* 1 means no outer gap when there is only one window */ 17 //static const char *fonts[] = { "みかちゃん:style=Regular:size=16", 18 static const char *fonts[] = { "あんずもじ:style=Regular:size=20", 19 "Go Mono:style=bold:size=16", 20 "Source Han Sans JP:style=Medium:size=16", 21 "Source Han Sans CN:style=Medium:size=16", 22 "Source Han Sans KR:style=Medium:size=16" }; 23 static const char dmenufont[] = "Go Mono:style=bold:size=16"; 24 static const char col_gray1[] = "#000000"; 25 static const char col_gray2[] = "#1b1b1b"; 26 static const char col_gray3[] = "#666666"; 27 static const char col_gray4[] = "#999999"; 28 static const char col_cyan[] = "#444444"; 29 static const char col_red[] = "#e6404e"; 30 static const char *colors[][3] = { 31 /* fg bg border */ 32 [SchemeNorm] = { col_gray3, col_gray1, col_gray1 }, 33 [SchemeSel] = { col_gray4, col_gray1, col_cyan }, 34 [SchemeWarn] = { col_gray3, col_red, col_gray1 }, 35 [SchemeUrgent] = { col_red, col_gray1, col_gray1 }, 36 }; 37 38 /* tagging */ 39 static const char *tags[] = { "壹", "貳", "參", "肆", "伍", "陸", "漆", "捌", "玖" }; 40 #define TAG_WEB (1 << 0) 41 42 static const Rule rules[] = { 43 /* xprop(1): 44 * WM_CLASS(STRING) = instance, class 45 * WM_NAME(STRING) = title 46 */ 47 /* class instance title tags mask isfloating monitor */ 48 { "Chromium", 0, 0, TAG_WEB, 0, -1 }, 49 { "firefox", 0, 0, TAG_WEB, 0, -1 }, 50 { 0, 0, "gf2", 1 << 2, 0, -1 }, 51 { "mgba-sdl", 0, 0, 0, 1, -1 }, 52 { "Matplotlib", 0, 0, 0, 1, -1 }, 53 { 0, "spterm", 0, SPTAG(0), 1, -1 }, 54 { 0, "spcal", 0, SPTAG(1), 1, -1 }, 55 { 0, "spkeys", 0, SPTAG(2), 1, -1 }, 56 { 0, "sun-awt-X11-XFramePeer", 0, 0, 1, -1 }, 57 }; 58 59 /* layout(s) */ 60 static const float mfact = 0.60; /* factor of master area size [0.05..0.95] */ 61 static const int nmaster = 1; /* number of clients in master area */ 62 static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ 63 static int fakefullscreen = 1; 64 65 #include "gaps.c" 66 #include "layouts.c" 67 #include "custom.c" 68 69 static const Layout layouts[] = { 70 /* symbol arrange function */ 71 { "[]=", tile }, /* first entry is default */ 72 { "[M]", monocle }, 73 { "M[]", deck }, 74 { "---", horizgrid }, 75 { "===", bstackhoriz }, 76 { "TTT", bstack }, 77 { "|M|", centeredmaster }, 78 { "><>", NULL }, /* no layout function means floating behavior */ 79 { NULL, NULL }, /* terminator for {next,prev}layout() */ 80 }; 81 82 /* key definitions */ 83 #define MODKEY Mod1Mask 84 #define ALTKEY Mod1Mask 85 #define SUPKEY Mod4Mask 86 #define TAGKEYS(KEY,TAG) \ 87 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 88 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 89 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 90 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 91 92 /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 93 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 94 95 #define BOOKMARKS "xdotool type $(grep -v -e '#' -e '^$' ~/doc/urls | dmenu -i -l 20 | cut -f 1 -d ' ')" 96 #define EMOJI "xdotool type $(cat ~/.local/share/emoji | dmenu -i -l 20 | cut -d ' ' -f 1)" 97 #define RSS "sfeed_dmenu blogs soft videos | plumb; pkill -HUP status" 98 99 /* commands */ 100 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 101 static const char *dmenucmd[] = { "dmenu_run", "-i", "-m", dmenumon, "-fn", dmenufont, NULL }; 102 static const char *termcmd[] = { "vtgl", NULL }; 103 static const char *sterm[] = { "vtgl", "-z", "36", NULL }; 104 static const char *browser[] = { "browser", NULL }; 105 static const char *dpcon[] = { "displaycon", NULL }; 106 static const char *mpdnext[] = { "mpdnext", NULL }; 107 static const char *mpdprev[] = { "mpdprev", NULL }; 108 static const char *mpdtog[] = { "mpdtoggle", NULL }; 109 static const char *music[] = { "st", "-z", "32", "ncmpcpp", NULL }; 110 static const char *pass[] = { "passmenu", NULL }; 111 static const char *scrotum[] = { "screenshot", NULL }; 112 static const char *search[] = { "surfraw_menu", NULL }; 113 static const char *sysact[] = { "sysact", NULL }; 114 static const char *tpadtg[] = { "trackpad", "toggle", NULL }; 115 static const char *voldn[] = { "volume", "-2%", NULL }; 116 static const char *voltg[] = { "volume", "toggle", NULL }; 117 static const char *volup[] = { "volume", "+2%", NULL }; 118 119 /* scratchpads */ 120 const char *spcmd0[] = {"st", "-n", "spterm", "-g", "120x34", NULL }; 121 const char *spcmd1[] = {"st", "-n", "spcal", "-z", "24", "calcurse", NULL }; 122 const char *spcmd2[] = {"st", "-n", "spkeys", "-g", "80x50", "/bin/sh", "-c", "man ~/.config/keybinds.1", NULL }; 123 struct { 124 const char *name; 125 const void *cmd; 126 } scratchpads[] = { 127 /* name cmd */ 128 {"spterm", spcmd0}, 129 {"spcal", spcmd1}, 130 {"spkeys", spcmd2}, 131 }; 132 133 static struct backlight_arg backlight_up = {.backlight = "dp_aux_backlight", .delta = +2 }; 134 static struct backlight_arg backlight_down = {.backlight = "dp_aux_backlight", .delta = -2 }; 135 136 static const Key keys[] = { 137 /* modifier key function argument */ 138 { 0, XF86XK_MonBrightnessUp, backlight, {.v = &backlight_up} }, 139 { 0, XF86XK_MonBrightnessDown, backlight, {.v = &backlight_down} }, 140 { 0, XF86XK_AudioRaiseVolume, spawn, {.v = volup } }, 141 { 0, XF86XK_AudioLowerVolume, spawn, {.v = voldn } }, 142 { 0, XF86XK_AudioMute, spawn, {.v = voltg } }, 143 { 0, XF86XK_AudioPlay, spawn, {.v = mpdtog } }, 144 { 0, XF86XK_AudioNext, spawn, {.v = mpdnext } }, 145 { 0, XF86XK_AudioPrev, spawn, {.v = mpdprev } }, 146 { MODKEY|ShiftMask, XK_w, spawn, {.v = browser } }, 147 { MODKEY|ShiftMask, XK_m, spawn, {.v = music } }, 148 { MODKEY|ShiftMask, XK_s, spawn, {.v = search } }, 149 { MODKEY, XK_BackSpace, spawn, {.v = sysact } }, 150 { MODKEY, XK_F2, spawn, {.v = dpcon } }, 151 { MODKEY, XK_F12, spawn, {.v = tpadtg } }, 152 { MODKEY|ShiftMask, XK_Print, spawn, {.v = scrotum } }, 153 { MODKEY, XK_Print, spawn, {.v = scrotum } }, 154 { MODKEY|ShiftMask, XK_p, spawn, {.v = scrotum } }, 155 { MODKEY, XK_p, spawn, {.v = pass } }, 156 { MODKEY, XK_b, spawn, SHCMD(BOOKMARKS) }, 157 { MODKEY, XK_e, spawn, SHCMD(EMOJI) }, 158 { MODKEY, XK_n, spawn, SHCMD(RSS) }, 159 { MODKEY, XK_d, spawn, {.v = dmenucmd } }, 160 { MODKEY, XK_Return, spawn, {.v = termcmd } }, 161 { SUPKEY, XK_Return, spawn, {.v = sterm } }, 162 { MODKEY|ShiftMask, XK_Return, togglescratch, {.ui = 0 } }, 163 { MODKEY, XK_backslash, togglescratch, {.ui = 1 } }, 164 { MODKEY, XK_F1, togglescratch, {.ui = 2 } }, 165 166 { MODKEY|ShiftMask, XK_b, togglebar, {0} }, 167 { MODKEY, XK_j, focusstack, {.i = +1 } }, 168 { MODKEY, XK_k, focusstack, {.i = -1 } }, 169 { MODKEY, XK_i, incnmaster, {.i = +1 } }, 170 { MODKEY|ShiftMask, XK_i, incnmaster, {.i = -1 } }, 171 { MODKEY, XK_h, setmfact, {.f = -0.01} }, 172 { MODKEY, XK_l, setmfact, {.f = +0.01} }, 173 { MODKEY, XK_w, zoom, {0} }, 174 { MODKEY, XK_Tab, view, {0} }, 175 { MODKEY|ShiftMask, XK_c, killclient, {0} }, 176 177 /* Layouts */ 178 { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, /* tiled */ 179 { MODKEY, XK_y, setlayout, {.v = &layouts[1]} }, /* monocole */ 180 { MODKEY, XK_space, nextlayout, {0} }, 181 { MODKEY|ControlMask, XK_space, prevlayout, {0} }, 182 { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 183 { MODKEY, XK_f, togglefullscr, {0} }, 184 { MODKEY|ShiftMask, XK_f, togglefakefull, {0} }, 185 186 /* gaps */ 187 { SUPKEY, XK_z, incrgaps, {.i = +2 } }, 188 { SUPKEY|ShiftMask, XK_z, incrgaps, {.i = -2 } }, 189 { SUPKEY, XK_s, incrigaps, {.i = +2 } }, 190 { SUPKEY|ShiftMask, XK_s, incrigaps, {.i = -2 } }, 191 { SUPKEY, XK_x, incrogaps, {.i = +2 } }, 192 { SUPKEY|ShiftMask, XK_x, incrogaps, {.i = -2 } }, 193 { SUPKEY, XK_0, togglegaps, {0} }, 194 { SUPKEY|ShiftMask, XK_0, defaultgaps, {0} }, 195 196 { MODKEY, XK_0, view, {.ui = ~0 } }, 197 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 198 { MODKEY, XK_comma, focusmon, {.i = -1 } }, 199 { MODKEY, XK_period, focusmon, {.i = +1 } }, 200 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 201 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 202 TAGKEYS( XK_1, 0) 203 TAGKEYS( XK_2, 1) 204 TAGKEYS( XK_3, 2) 205 TAGKEYS( XK_4, 3) 206 TAGKEYS( XK_5, 4) 207 TAGKEYS( XK_6, 5) 208 TAGKEYS( XK_7, 6) 209 TAGKEYS( XK_8, 7) 210 TAGKEYS( XK_9, 8) 211 { MODKEY|ShiftMask, XK_q, quit, {0} }, 212 }; 213 214 /* button definitions */ 215 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 216 static const Button buttons[] = { 217 /* click event mask button function argument */ 218 { ClkLtSymbol, 0, Button1, setlayout, {0} }, 219 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, 220 { ClkWinTitle, 0, Button2, zoom, {0} }, 221 { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 222 { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 223 { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 224 { ClkTagBar, 0, Button1, view, {0} }, 225 { ClkTagBar, 0, Button3, toggleview, {0} }, 226 { ClkTagBar, MODKEY, Button1, tag, {0} }, 227 { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 228 }; 229