config.h (9831B)
1 /* See LICENSE file for copyright and license details. */ 2 3 /* appearance */ 4 static const unsigned int borderpx = 3; /* border pixel of windows */ 5 static const unsigned int snap = 32; /* snap pixel */ 6 static const int showbar = 1; /* 0 means no bar */ 7 static const int topbar = 1; /* 0 means bottom bar */ 8 static const char *fonts[] = { "monospace:size=14" }; 9 static const char dmenufont[] = "monospace:size=14"; 10 11 /* Dark scheme: */ 12 /* 13 static const char col_gray1[] = "#141414"; 14 static const char col_gray2[] = "#504945"; 15 static const char col_gray3[] = "#bdae93"; 16 static const char col_gray4[] = "#f9f9f9"; 17 static const char col_cyan[] = "#3465a4"; 18 */ 19 20 /* Light theme: */ 21 static const char col_gray1[] = "#fffff8"; 22 static const char col_gray2[] = "#000000"; 23 static const char col_gray3[] = "#000000"; 24 static const char col_gray4[] = "#000000"; 25 static const char col_cyan[] = "#f0f0f4"; 26 27 static const char *colors[][3] = { 28 /* fg bg border */ 29 [SchemeNorm] = { col_gray3, col_gray1, col_cyan }, 30 [SchemeSel] = { col_gray4, col_cyan, col_gray2 }, 31 }; 32 33 /* tagging */ 34 static const char *tags[] = { "1", "2", "3", "4" }; 35 36 static const Rule rules[] = { 37 /* xprop(1): 38 * WM_CLASS(STRING) = instance, class 39 * WM_NAME(STRING) = title 40 */ 41 /* class | instance | title | tagsmask | isfloating | monitor */ 42 { "TelegramDesktop", NULL, NULL, 1 << 3, 0, -1 }, 43 { NULL, NULL, "stfloat", 0, 1, -1 }, 44 { NULL, NULL, "Picture-in-Picture", TAGMASK, 1, -1 }, 45 { "iwgtk", NULL, NULL, 0, 1, -1 }, 46 }; 47 48 /* layout(s) */ 49 static const float mfact = 0.5; /* factor of master area */ 50 static const int nmaster = 1; /* number of clients in master area */ 51 static const int resizehints = 0; /* 1 means respect size hints */ 52 static const int refreshrate = 120; /* refresh rate (per second) for client move/resize */ 53 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ 54 55 static const Layout layouts[] = { 56 /* symbol arrange function */ 57 { "[]=", tile }, /* first entry is default */ 58 { "><>", NULL }, /* no layout function means floating behavior */ 59 { "[M]", monocle }, 60 }; 61 62 /* key definitions */ 63 #define MODKEY Mod1Mask 64 #define TAGKEYS(KEY,TAG) \ 65 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 66 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 67 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 68 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 69 70 /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 71 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 72 73 /* commands */ 74 static const char *termcmd[] = { "st", NULL }; 75 static char dmenumon[2] = "0"; /* used in dmenucmd, manipulated in spawn() */ 76 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, 77 "-fn", dmenufont, 78 "-nb", col_gray1, 79 "-nf", col_gray3, 80 "-sb", col_cyan, 81 "-sf", col_gray4, NULL }; 82 83 /* Necessary library for some multimedia key names */ 84 #include <X11/XF86keysym.h> 85 86 /* My zoomstack function; passing .i=1 means always focus stack */ 87 void 88 zoomstack(const Arg *arg) 89 { 90 int s = 0; 91 unsigned int j; 92 Monitor *m = selmon; 93 Client *c = selmon->sel, *f, **p; 94 95 if (!m->lt[m->sellt]->arrange) 96 return; 97 98 if (!c || (c && c->isfloating)) { 99 c = nexttiled(m->clients); 100 s = 1; 101 } 102 103 for (j = 0, f = nexttiled(m->clients); f && j < m->nmaster; 104 f = nexttiled(f->next), j++) { 105 if (f == c) { 106 c = nexttiled(c->next); 107 s = 1; 108 } 109 } 110 if (c && f == c) 111 c = nexttiled(c->next); 112 for (p = &m->clients; *p && (*p)->next != f; p = &(*p)->next); 113 if (!*p || !c) 114 return; 115 detach(c); 116 c->next = (*p)->next; 117 (*p)->next = c; 118 arrange(m); 119 if (!s || arg->i) 120 focus(c); 121 } 122 123 /* Focusmater by Mateus Auler - <mateusauler at protonmail dot com> 124 * Taken from https://dwm.suckless.org/patches/focusmaster */ 125 void 126 focusmaster(const Arg *arg) 127 { 128 Client *c; 129 130 if (selmon->nmaster < 1) 131 return; 132 133 c = nexttiled(selmon->clients); 134 135 if (c) 136 focus(c); 137 } 138 139 static Key keys[] = { 140 /* modifier key function argument */ 141 { MODKEY, XK_o, spawn, SHCMD("open-file") }, 142 { MODKEY, XK_i, spawn, SHCMD("ssh-terminal") }, 143 { MODKEY, XK_p, spawn, {.v = dmenucmd} }, 144 { MODKEY, XK_n, togglebar, {0} }, 145 { MODKEY, XK_j, focusstack, {.i = +1 } }, 146 { MODKEY, XK_k, focusstack, {.i = -1 } }, 147 { MODKEY|ControlMask, XK_d, incnmaster, {.i = +1 } }, 148 { MODKEY|ControlMask|ShiftMask, XK_d, incnmaster, {.i = -1 } }, 149 { MODKEY, XK_h, setmfact, {.f = -0.05} }, 150 { MODKEY, XK_l, setmfact, {.f = +0.05} }, 151 { MODKEY, XK_Tab, view, {0} }, 152 { MODKEY|ShiftMask, XK_c, killclient, {0} }, 153 { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, 154 { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, 155 { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 156 { MODKEY, XK_s, togglefloating, {0} }, 157 { MODKEY, XK_Return, zoom, {0} }, 158 { MODKEY, XK_0, view, {.ui = ~0 } }, 159 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 160 { MODKEY, XK_comma, focusmon, {.i = -1 } }, 161 { MODKEY, XK_period, focusmon, {.i = +1 } }, 162 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 163 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 164 TAGKEYS( XK_1, 0) 165 TAGKEYS( XK_2, 1) 166 TAGKEYS( XK_3, 2) 167 TAGKEYS( XK_4, 3) 168 /* 169 TAGKEYS( XK_5, 4) 170 TAGKEYS( XK_6, 5) 171 TAGKEYS( XK_7, 6) 172 TAGKEYS( XK_8, 7) 173 TAGKEYS( XK_9, 8) 174 */ 175 176 /* Session */ 177 { MODKEY|ShiftMask, XK_q, spawn, SHCMD("dmenu-dwm-sessionmanager") }, 178 { MODKEY|ShiftMask, XK_z, spawn, SHCMD("slock") }, 179 180 /* Programs */ 181 { MODKEY|ShiftMask, XK_Return, spawn, SHCMD("terminal") }, 182 { MODKEY|ShiftMask, XK_backslash, spawn, SHCMD("popup-terminal") }, 183 { MODKEY|ShiftMask, XK_f, spawn, SHCMD("firefox") }, 184 { MODKEY|ShiftMask, XK_g, spawn, SHCMD("xedit") }, 185 { MODKEY|ShiftMask, XK_j, spawn, SHCMD("terminal python") }, 186 { MODKEY, XK_y, spawn, SHCMD("clip") }, 187 { MODKEY, XK_d, spawn, SHCMD("popup-cal12") }, 188 { MODKEY, XK_q, spawn, SHCMD("dmenu-unmount") }, 189 { MODKEY, XK_e, spawn, SHCMD("dmenu-bookmarks") }, 190 191 /* System settings */ 192 { MODKEY|ShiftMask, XK_w, spawn, SHCMD("iwgtk") }, 193 { MODKEY|ShiftMask, XK_v, spawn, SHCMD("popup-terminal pulsemixer") }, 194 { MODKEY|ShiftMask, XK_b, spawn, SHCMD("blueman-manager") }, 195 { MODKEY|ShiftMask, XK_p, spawn, SHCMD("popup-terminal top") }, 196 { MODKEY, XK_space, spawn, SHCMD("xkfix") }, 197 198 /* Multimedia */ 199 { 0, XK_Print, spawn, SHCMD("dmenu-screenshot") }, 200 { 0, XF86XK_MonBrightnessUp, spawn, SHCMD("brightnessctl set 5%+") }, 201 { 0, XF86XK_MonBrightnessDown, spawn, SHCMD("brightnessctl set 5%-") }, 202 { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pulsemixer --change-volume +5 && xroot-update") }, 203 { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pulsemixer --change-volume -5 && xroot-update") }, 204 { 0, XF86XK_AudioMute, spawn, SHCMD("pulsemixer --toggle-mute && xroot-update") }, 205 206 /* zoomstack (.i = 1: always focus) and others */ 207 { MODKEY, XK_backslash, zoomstack, {.i = 0} }, 208 { MODKEY|ControlMask, XK_Return, focusmaster, {0} }, 209 210 /* Notify */ 211 { ControlMask, XK_space, spawn, SHCMD("notify clean") }, 212 { ControlMask|ShiftMask, XK_space, spawn, SHCMD("popup-terminal 'notify show | less'") }, 213 }; 214 215 /* button definitions */ 216 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 217 static Button buttons[] = { 218 /* click event mask button function argument */ 219 { ClkLtSymbol, 0, Button1, setlayout, {0} }, 220 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, 221 { ClkWinTitle, 0, Button2, zoom, {0} }, 222 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 223 { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 224 { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 225 { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 226 { ClkTagBar, 0, Button1, view, {0} }, 227 { ClkTagBar, 0, Button3, toggleview, {0} }, 228 { ClkTagBar, MODKEY, Button1, tag, {0} }, 229 { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 230 }; 231