tconfig.h - dwm - [fork] customized build of dwm, the dynamic window manager (HTM) git clone git://src.adamsgaard.dk/dwm (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- tconfig.h (18661B) --- 1 /* See LICENSE file for copyright and license details. */ 2 3 /* appearance */ 4 static const unsigned int borderpx = 2; /* 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[] = { "dina:size=9:antialias=false" }; */ 9 /* static const char *fonts[] = { "terminus:size=12" }; */ 10 static const char *fonts[] = { "pragmatapro:size=11" }; 11 static const char col_gray1[] = "#000000"; 12 static const char col_gray2[] = "#444444"; 13 static const char col_gray3[] = "#ffffff"; 14 static const char col_gray4[] = "#1d1f21"; 15 static const char *colors[][3] = { 16 /* fg bg border */ 17 [SchemeNorm] = { col_gray3, col_gray1, col_gray1 }, 18 [SchemeSel] = { col_gray1, col_gray3, col_gray3 }, 19 }; 20 21 /* tagging */ 22 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; 23 /* static const char *tags[] = { "一", "二", "三", "四", "五", "六", "七", "八", "九" }; */ 24 25 26 /* floatpos: 27 * 1--2--3 28 * 4--5--6 29 * 7--8--9 30 * 0: disabled */ 31 static const Rule rules[] = { 32 /* xprop(1): 33 * WM_CLASS(STRING) = instance, class 34 * WM_NAME(STRING) = title 35 */ 36 /* class instance title tags floatpos isfloating monitor */ 37 { "Tor Browser", NULL, NULL, 0, 5, 1, -1 }, 38 { "tabbed", NULL, NULL, 1<<1, 0, 0, -1 }, 39 { "Firefox", NULL, NULL, 1<<1, 0, 0, -1 }, 40 { "Chromium-browser", NULL, NULL, 1<<1, 0, 0, -1 }, 41 { "Evolution", NULL, NULL, 1<<7, 0, 0, -1 }, 42 { NULL, NULL, "video", ~0, 9, 1, -1 }, 43 { NULL, "topleft", NULL, 0, 1, 1, -1 }, 44 { NULL, "topcenter", NULL, 0, 2, 1, -1 }, 45 { NULL, "topright", NULL, 0, 3, 1, -1 }, 46 { NULL, "midleft", NULL, 0, 4, 1, -1 }, 47 { NULL, "midcenter", NULL, 0, 5, 1, -1 }, 48 { NULL, "midright", NULL, 0, 6, 1, -1 }, 49 { NULL, "botleft", NULL, 0, 7, 1, -1 }, 50 { NULL, "botcenter", NULL, 0, 8, 1, -1 }, 51 { NULL, "botright", NULL, 0, 9, 1, -1 }, 52 }; 53 54 /* layout(s) */ 55 static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */ 56 static const int nmaster = 1; /* number of clients in master area */ 57 static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ 58 59 static const Layout layouts[] = { 60 /* symbol arrange function */ 61 { "", tile }, /* first entry is default */ 62 { "F", NULL }, /* no layout function means floating behavior */ 63 { "M", monocle }, 64 }; 65 66 /* key definitions */ 67 #define MODKEY Mod1Mask 68 #define MODALTKEY Mod4Mask 69 #define TAGKEYS(KEY,TAG) \ 70 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 71 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 72 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 73 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 74 75 76 static char dmenumon[2] = "0"; 77 78 #define HOME "/home/ad" 79 #define TERMINAL HOME "/bin/x-terminal-emulator" 80 #define BROWSER "ungoogled-chromium" 81 #define MPD_REMOTE "mini" 82 83 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 84 #define TERMCMD(...) {TERMINAL, "-e", __VA_ARGS__, NULL} 85 #define ALTTERMCMD(...) {ALTTERMINAL, "-e", __VA_ARGS__, NULL} 86 #define DUPLEXCMD(cmd) {TERMINAL, "-e", "tmux", "new-session", cmd, NULL} 87 #define DUPLEXATTACHCMD(name, cmd) {TERMINAL, "-e", "tmux", "new-session", "-A", "-s", name, cmd, NULL} 88 89 /* commands */ 90 static const char *termcmd[] = TERMCMD("ksh", "-l"); 91 static const char *termplexcmd[] = TERMCMD("tmux"); 92 93 static const char *acmecmd[] = {"a", NULL}; 94 static const char *dmenucmd[] = {"dmenu_run", NULL}; 95 static const char *searchcmd[] = {"search", NULL}; 96 static const char *articlesearchcmd[] = {"articlesearch", NULL}; 97 static const char *jabbrevcmd[] = {"jabbrev", "-c", NULL}; 98 static const char *unicodecmd[] = {"unicodepick", NULL}; 99 static const char *definecmd[] = {"define", "--gui", NULL}; 100 static const char *passcmd[] = {"passmenu", "-t", "-n", NULL}; 101 static const char *passemailcmd[] = {"passmenu", "-t", "-u", "anders@adamsgaard.dk\t", "-n", NULL}; 102 static const char *displaycmd[] = {"displayselect", NULL}; 103 static const char *displayintcmd[] = {"mon", "int", NULL}; 104 static const char *textcmd[] = {"text.sh", "-i", NULL}; 105 static const char *videocmd[] = {"videotoggle", NULL}; 106 static const char *screenrecordcmd[] = {"screenrecord", NULL}; 107 static const char *castcmd[] = {"adcast", NULL}; 108 static const char *plumbcmd[] = {"clipplumb", NULL}; 109 static const char *plumb2cmd[] = {"clipplumb", "-c", NULL}; 110 static const char *plumbremotecmd[] = {"clipplumb", "-r", NULL}; 111 static const char *plumb2remotecmd[] = {"clipplumb", "-c", "-r", NULL}; 112 static const char *ytdlaudiocmd[] = {"youtube-dl-music", "-t", "-a", "-m", "-q", NULL}; 113 static const char *showclipcmd[] = {"showclip", NULL}; 114 static const char *xlockcmd[] = {"xlock", NULL}; 115 static const char *printscreenicmd[] = {"maimpick", NULL}; 116 static const char *keyboardlayoutcmd[] = {"keyboard-layout-switch.sh", NULL}; 117 static const char *torbrowsercmd[] = {"tor-browser", NULL}; 118 static const char *showcalcmd[] = {"showcalendar", NULL}; 119 static const char *mancmd[] = {"manpick", NULL}; 120 static const char *weathercmd[] = {"weather", NULL}; 121 static const char *memeselectcmd[] = {"tardis", "-c", NULL}; 122 static const char *contactscmd[] = {"contacts", NULL}; 123 124 static const char *browsercmd[] = {BROWSER, HOME "/doc/pages/bookmark.html", NULL}; 125 static const char *journalcmd[] = TERMCMD("tmux-journal.sh"); 126 static const char *topcmd[] = TERMCMD("htop", "-C"); 127 static const char *mailcmd[] = DUPLEXCMD("mutt"); 128 /* static const char *filecmd[] = TERMCMD("sh", "-c", "cd ~/tmp; ls -p; $SHELL -l"); */ 129 static const char *newscmd[] = DUPLEXCMD("sfeed_curses $HOME/.sfeed/feeds/*"); 130 static const char *newsrefreshcmd[] = DUPLEXCMD("sfeed_sync"); 131 static const char *irccmd[] = DUPLEXATTACHCMD("irc", "irc.sh"); 132 static const char *todocmd[] = DUPLEXATTACHCMD("todo", "todo.sh"); 133 static const char *calendarcmd[] = DUPLEXATTACHCMD("calendar", "calendar.sh"); 134 static const char *mixercmd[] = TERMCMD("audiomixer"); 135 static const char *musiccmd[] = TERMCMD("ncmpc"); 136 static const char *music_remote_cmd[] = TERMCMD("ncmpc", "-h", MPD_REMOTE); 137 138 static const char *mpdtogglecmd[] = {"mpc", "toggle", "-q", NULL}; 139 static const char *mpdnextcmd[] = {"mpc", "next", "-q", NULL}; 140 static const char *mpdprevcmd[] = {"mpc", "prev", "-q", NULL}; 141 static const char *mpdstopcmd[] = {"mpc", "stop", "-q", NULL}; 142 143 static const char *mpd_remote_togglecmd[] = {"mpc", "toggle", "-q", "-h", MPD_REMOTE, NULL}; 144 static const char *mpd_remote_nextcmd[] = {"mpc", "next", "-q", "-h", MPD_REMOTE, NULL}; 145 static const char *mpd_remote_prevcmd[] = {"mpc", "prev", "-q", "-h", MPD_REMOTE, NULL}; 146 static const char *mpd_remote_stopcmd[] = {"mpc", "stop", "-q", "-h", MPD_REMOTE, NULL}; 147 148 static const char *mpdremotevolupcmd[] = {"mpc", "-q", "-h", MPD_REMOTE, "volume", "+10", NULL}; 149 static const char *mpdremotevoldncmd[] = {"mpc", "-q", "-h", MPD_REMOTE, "volume", "-10", NULL}; 150 151 static const char *audioextvolupcmd[] = {"sndioctl", "output.level=+0.05", NULL}; 152 static const char *audioextvoldncmd[] = {"sndioctl", "output.level=-0.05", NULL}; 153 static const char *audioextmutecmd[] = {"sndioctl", "output.mute=!", NULL}; 154 155 static const char *mouseleftcmd[] = {"xdotool", "mousemove_relative", "--", "-100", "0", NULL}; 156 static const char *mouserightcmd[] = {"xdotool", "mousemove_relative", "--", "+100", "0", NULL}; 157 static const char *mouseupcmd[] = {"xdotool", "mousemove_relative", "--", "0", "-100", NULL}; 158 static const char *mousedowncmd[] = {"xdotool", "mousemove_relative", "--", "0", "+100", NULL}; 159 160 static const char *mousefineleftcmd[] = {"xdotool", "mousemove_relative", "--", "-10", "0", NULL}; 161 static const char *mousefinerightcmd[] = {"xdotool", "mousemove_relative", "--", "+10", "0", NULL}; 162 static const char *mousefineupcmd[] = {"xdotool", "mousemove_relative", "--", "0", "-10", NULL}; 163 static const char *mousefinedowncmd[] = {"xdotool", "mousemove_relative", "--", "0", "+10", NULL}; 164 165 static const char *mouseleftclickcmd[] = {"xdotool", "click", "1", NULL}; 166 static const char *mouserightclickcmd[]= {"xdotool", "click", "3", NULL}; 167 168 static const char *showkeyscmd[] = {"screenkey-toggle", NULL}; 169 static const char *goatcmd[] = { "sh", "-c", "mpv \"$(hurl gopher://bitreich.org/0/memecache/index.meme | grep goat | grep -E '\\.(mp4|mkv|webm|avi) ' | cut -f2 -d' ' | sort -R | he ad -n 1)\"", NULL }; 170 171 /* see key names in /usr/include/X11/keysymdef.h */ 172 static Key keys[] = { 173 /* modifier key function argument */ 174 { MODKEY, XK_Return, spawn, {.v = termplexcmd } }, 175 { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, 176 { MODKEY, XK_space, spawn, {.v = searchcmd } }, 177 { MODKEY|ShiftMask, XK_space, spawn, {.v = dmenucmd } }, 178 { MODKEY, XK_grave, spawn, {.v = unicodecmd } }, 179 { MODKEY, XK_slash, spawn, {.v = definecmd } }, 180 { 0, XK_Print, spawn, SHCMD("maim ~/tmp/pic-full-$(date '+%y-%m-%d_%H:%M:%S').png") }, 181 { ShiftMask, XK_Print, spawn, {.v = printscreenicmd } }, 182 { MODKEY, XK_period, focusmon, {.i = +1 } }, 183 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 184 { MODKEY, XK_comma, focusmon, {.i = -1 } }, 185 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 186 { MODKEY, XK_Tab, view, {0} }, 187 { MODKEY|ShiftMask, XK_Tab, tag, {0} }, 188 189 { MODKEY, XK_Left, spawn, {.v = mouseleftcmd } }, 190 { MODKEY, XK_Right, spawn, {.v = mouserightcmd } }, 191 { MODKEY, XK_Up, spawn, {.v = mouseupcmd } }, 192 { MODKEY, XK_Down, spawn, {.v = mousedowncmd } }, 193 194 { MODKEY|ShiftMask, XK_Left, spawn, {.v = mousefineleftcmd } }, 195 { MODKEY|ShiftMask, XK_Right, spawn, {.v = mousefinerightcmd } }, 196 { MODKEY|ShiftMask, XK_Up, spawn, {.v = mousefineupcmd } }, 197 { MODKEY|ShiftMask, XK_Down, spawn, {.v = mousefinedowncmd } }, 198 199 { MODKEY|ShiftMask|ControlMask, XK_Left, spawn, {.v = mouseleftclickcmd } }, 200 { MODKEY|ShiftMask|ControlMask, XK_Right, spawn, {.v = mouserightclickcmd } }, 201 202 { ShiftMask, XF86XK_AudioRaiseVolume, spawn, {.v = audioextvolupcmd } }, 203 { ShiftMask, XF86XK_AudioLowerVolume, spawn, {.v = audioextvoldncmd } }, 204 { ShiftMask, XF86XK_AudioMute, spawn, {.v = audioextmutecmd } }, 205 206 { ControlMask|ShiftMask, XF86XK_AudioRaiseVolume, spawn, {.v = mpdremotevolupcmd } }, 207 { ControlMask|ShiftMask, XF86XK_AudioLowerVolume, spawn, {.v = mpdremotevoldncmd } }, 208 209 { MODKEY, XK_F1, spawn, {.v = mancmd } }, 210 { MODKEY, XK_F7, spawn, {.v = displaycmd } }, 211 { MODKEY|ShiftMask, XK_F7, spawn, {.v = displayintcmd } }, 212 { MODKEY, XK_F9, spawn, {.v = showkeyscmd } }, 213 214 { MODKEY, XK_a, spawn, {.v = acmecmd } }, 215 { MODKEY|ShiftMask, XK_a, spawn, {.v = articlesearchcmd } }, 216 { MODKEY|ControlMask|ShiftMask, XK_a, spawn, {.v = mixercmd } }, 217 { MODKEY|MODALTKEY, XK_b, togglebar, {0} }, 218 { MODKEY|ControlMask|ShiftMask, XK_b, spawn, {.v = mpdprevcmd } }, 219 { MODKEY|ControlMask, XK_b, spawn, {.v = mpd_remote_prevcmd } }, 220 { MODKEY, XK_c, spawn, {.v = showcalcmd } }, 221 { MODKEY|ShiftMask, XK_c, spawn, {.v = calendarcmd } }, 222 { MODKEY, XK_d, spawn, {.v = todocmd } }, 223 { MODKEY|ShiftMask, XK_d, spawn, {.v = journalcmd } }, 224 { MODKEY, XK_e, spawn, {.v = contactscmd } }, 225 { MODKEY, XK_f, zoom, {0} }, 226 { MODKEY|ShiftMask, XK_f, togglefloating, {0} }, 227 { MODKEY|ControlMask|ShiftMask, XK_g, spawn, {.v = goatcmd } }, 228 { MODKEY, XK_h, setmfact, {.f = -0.05} }, 229 { MODKEY, XK_i, spawn, {.v = showclipcmd } }, 230 { MODKEY|ShiftMask, XK_i, spawn, {.v = irccmd } }, 231 { MODKEY, XK_j, focusstack, {.i = +1 } }, 232 { MODKEY|ShiftMask, XK_j, incnmaster, {.i = +1 } }, 233 { MODKEY, XK_k, focusstack, {.i = -1 } }, 234 { MODKEY|ShiftMask, XK_k, incnmaster, {.i = -1 } }, 235 { MODKEY, XK_l, setmfact, {.f = +0.05} }, 236 { MODKEY|ShiftMask, XK_l, setlayout, {.v = &layouts[1]} }, 237 { MODKEY|ControlMask|ShiftMask, XK_l, spawn, {.v = keyboardlayoutcmd } }, 238 { MODKEY, XK_m, spawn, {.v = mailcmd } }, 239 { MODKEY|ShiftMask, XK_m, setlayout, {.v = &layouts[2]} }, 240 { MODKEY|ControlMask|ShiftMask, XK_m, spawn, {.v = musiccmd } }, 241 { MODKEY|ControlMask, XK_m, spawn, {.v = music_remote_cmd } }, 242 { MODKEY, XK_n, spawn, {.v = newscmd } }, 243 { MODKEY|ShiftMask, XK_n, spawn, {.v = newsrefreshcmd } }, 244 { MODKEY|ControlMask|ShiftMask, XK_n, spawn, {.v = mpdnextcmd } }, 245 { MODKEY|ControlMask, XK_n, spawn, {.v = mpd_remote_nextcmd } }, 246 { MODKEY, XK_o, spawn, {.v = castcmd } }, 247 { MODKEY|ShiftMask, XK_o, spawn, {.v = topcmd } }, 248 { MODKEY, XK_p, spawn, {.v = passcmd } }, 249 { MODKEY|ShiftMask, XK_p, spawn, {.v = passemailcmd } }, 250 { MODKEY|ControlMask|ShiftMask, XK_p, spawn, {.v = mpdtogglecmd } }, 251 { MODKEY|ControlMask, XK_p, spawn, {.v = mpd_remote_togglecmd } }, 252 { MODKEY, XK_q, killclient, {0} }, 253 { MODKEY|ShiftMask, XK_q, quit, {0} }, 254 { MODKEY, XK_r, spawn, {.v = screenrecordcmd } }, 255 { MODKEY|ShiftMask, XK_s, spawn, {.v = memeselectcmd } }, 256 { MODKEY|ControlMask|ShiftMask, XK_s, spawn, {.v = mpdstopcmd } }, 257 { MODKEY|ControlMask, XK_s, spawn, {.v = mpd_remote_stopcmd } }, 258 { MODKEY, XK_t, spawn, {.v = textcmd } }, 259 { MODKEY|ShiftMask, XK_t, setlayout, {.v = &layouts[0]} }, 260 { MODKEY, XK_u, spawn, {.v = plumbcmd } }, 261 { MODKEY|ShiftMask, XK_u, spawn, {.v = plumb2cmd } }, 262 { MODKEY|ControlMask, XK_u, spawn, {.v = plumbremotecmd } }, 263 { MODKEY|ControlMask|ShiftMask, XK_u, spawn, {.v = plumb2remotecmd } }, 264 { MODKEY, XK_v, spawn, {.v = videocmd } }, 265 { MODKEY, XK_w, spawn, {.v = browsercmd } }, 266 { MODKEY|ShiftMask, XK_w, spawn, {.v = torbrowsercmd } }, 267 { MODKEY|ControlMask|ShiftMask, XK_w, spawn, {.v = weathercmd } }, 268 { MODKEY, XK_z, spawn, {.v = xlockcmd } }, 269 270 { MODKEY, XK_0, view, {.ui = ~0 } }, 271 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 272 TAGKEYS( XK_1, 0) 273 TAGKEYS( XK_2, 1) 274 TAGKEYS( XK_3, 2) 275 TAGKEYS( XK_4, 3) 276 TAGKEYS( XK_5, 4) 277 TAGKEYS( XK_6, 5) 278 TAGKEYS( XK_7, 6) 279 TAGKEYS( XK_8, 7) 280 TAGKEYS( XK_9, 8) 281 }; 282 283 /* button definitions */ 284 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 285 static Button buttons[] = { 286 /* click event mask button function argument */ 287 { ClkLtSymbol, 0, Button1, setlayout, {0} }, 288 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, 289 { ClkWinTitle, 0, Button2, zoom, {0} }, 290 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 291 { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 292 { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 293 { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 294 { ClkTagBar, 0, Button1, view, {0} }, 295 { ClkTagBar, 0, Button3, toggleview, {0} }, 296 { ClkTagBar, MODKEY, Button1, tag, {0} }, 297 { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 298 };