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 (19517B)
---
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 *audiovolupcmd[] = {"amixer", "set", "Master", "5%+", NULL};
152 static const char *audiovoldncmd[] = {"amixer", "set", "Master", "5%-", NULL};
153 static const char *audiomutecmd[] = {"amixer", "set", "Master", "toggle", NULL};
154
155 static const char *brightnessupcmd[] = {"brightnessctl", "set", "10%+", NULL};
156 static const char *brightnessdncmd[] = {"brightnessctl", "set", "10%-", NULL};
157
158 static const char *audioextvolupcmd[] = {"sndioctl", "output.level=+0.05", NULL};
159 static const char *audioextvoldncmd[] = {"sndioctl", "output.level=-0.05", NULL};
160 static const char *audioextmutecmd[] = {"sndioctl", "output.mute=!", NULL};
161
162 static const char *mouseleftcmd[] = {"xdotool", "mousemove_relative", "--", "-100", "0", NULL};
163 static const char *mouserightcmd[] = {"xdotool", "mousemove_relative", "--", "+100", "0", NULL};
164 static const char *mouseupcmd[] = {"xdotool", "mousemove_relative", "--", "0", "-100", NULL};
165 static const char *mousedowncmd[] = {"xdotool", "mousemove_relative", "--", "0", "+100", NULL};
166
167 static const char *mousefineleftcmd[] = {"xdotool", "mousemove_relative", "--", "-10", "0", NULL};
168 static const char *mousefinerightcmd[] = {"xdotool", "mousemove_relative", "--", "+10", "0", NULL};
169 static const char *mousefineupcmd[] = {"xdotool", "mousemove_relative", "--", "0", "-10", NULL};
170 static const char *mousefinedowncmd[] = {"xdotool", "mousemove_relative", "--", "0", "+10", NULL};
171
172 static const char *mouseleftclickcmd[] = {"xdotool", "click", "1", NULL};
173 static const char *mouserightclickcmd[]= {"xdotool", "click", "3", NULL};
174
175 static const char *showkeyscmd[] = {"screenkey-toggle", NULL};
176 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 };
177
178 /* see key names in /usr/include/X11/keysymdef.h */
179 static Key keys[] = {
180 /* modifier key function argument */
181 { MODKEY, XK_Return, spawn, {.v = termplexcmd } },
182 { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
183 { MODKEY, XK_space, spawn, {.v = searchcmd } },
184 { MODKEY|ShiftMask, XK_space, spawn, {.v = dmenucmd } },
185 { MODKEY, XK_grave, spawn, {.v = unicodecmd } },
186 { MODKEY, XK_slash, spawn, {.v = definecmd } },
187 { 0, XK_Print, spawn, SHCMD("maim ~/tmp/pic-full-$(date '+%y-%m-%d_%H:%M:%S').png") },
188 { ShiftMask, XK_Print, spawn, {.v = printscreenicmd } },
189 { MODKEY, XK_period, focusmon, {.i = +1 } },
190 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
191 { MODKEY, XK_comma, focusmon, {.i = -1 } },
192 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
193 { MODKEY, XK_Tab, view, {0} },
194 { MODKEY|ShiftMask, XK_Tab, tag, {0} },
195
196 { MODKEY, XK_Left, spawn, {.v = mouseleftcmd } },
197 { MODKEY, XK_Right, spawn, {.v = mouserightcmd } },
198 { MODKEY, XK_Up, spawn, {.v = mouseupcmd } },
199 { MODKEY, XK_Down, spawn, {.v = mousedowncmd } },
200
201 { MODKEY|ShiftMask, XK_Left, spawn, {.v = mousefineleftcmd } },
202 { MODKEY|ShiftMask, XK_Right, spawn, {.v = mousefinerightcmd } },
203 { MODKEY|ShiftMask, XK_Up, spawn, {.v = mousefineupcmd } },
204 { MODKEY|ShiftMask, XK_Down, spawn, {.v = mousefinedowncmd } },
205
206 { MODKEY|ShiftMask|ControlMask, XK_Left, spawn, {.v = mouseleftclickcmd } },
207 { MODKEY|ShiftMask|ControlMask, XK_Right, spawn, {.v = mouserightclickcmd } },
208
209 { 0, XF86XK_AudioRaiseVolume, spawn, {.v = audiovolupcmd } },
210 { 0, XF86XK_AudioLowerVolume, spawn, {.v = audiovoldncmd } },
211 { 0, XF86XK_AudioMute, spawn, {.v = audiomutecmd } },
212
213 { ShiftMask, XF86XK_AudioRaiseVolume, spawn, {.v = audioextvolupcmd } },
214 { ShiftMask, XF86XK_AudioLowerVolume, spawn, {.v = audioextvoldncmd } },
215 { ShiftMask, XF86XK_AudioMute, spawn, {.v = audioextmutecmd } },
216
217 { ControlMask|ShiftMask, XF86XK_AudioRaiseVolume, spawn, {.v = mpdremotevolupcmd } },
218 { ControlMask|ShiftMask, XF86XK_AudioLowerVolume, spawn, {.v = mpdremotevoldncmd } },
219
220 { 0, XF86XK_MonBrightnessUp, spawn, {.v = brightnessupcmd } },
221 { 0, XF86XK_MonBrightnessDown, spawn, {.v = brightnessdncmd } },
222
223 { MODKEY, XK_F1, spawn, {.v = mancmd } },
224 { MODKEY, XK_F7, spawn, {.v = displaycmd } },
225 { MODKEY|ShiftMask, XK_F7, spawn, {.v = displayintcmd } },
226 { MODKEY, XK_F9, spawn, {.v = showkeyscmd } },
227
228 { MODKEY, XK_a, spawn, {.v = acmecmd } },
229 { MODKEY|ShiftMask, XK_a, spawn, {.v = articlesearchcmd } },
230 { MODKEY|ControlMask|ShiftMask, XK_a, spawn, {.v = mixercmd } },
231 { MODKEY|MODALTKEY, XK_b, togglebar, {0} },
232 { MODKEY|ControlMask|ShiftMask, XK_b, spawn, {.v = mpdprevcmd } },
233 { MODKEY|ControlMask, XK_b, spawn, {.v = mpd_remote_prevcmd } },
234 { MODKEY, XK_c, spawn, {.v = showcalcmd } },
235 { MODKEY|ShiftMask, XK_c, spawn, {.v = calendarcmd } },
236 { MODKEY, XK_d, spawn, {.v = todocmd } },
237 { MODKEY|ShiftMask, XK_d, spawn, {.v = journalcmd } },
238 { MODKEY, XK_e, spawn, {.v = contactscmd } },
239 { MODKEY, XK_f, zoom, {0} },
240 { MODKEY|ShiftMask, XK_f, togglefloating, {0} },
241 { MODKEY|ControlMask|ShiftMask, XK_g, spawn, {.v = goatcmd } },
242 { MODKEY, XK_h, setmfact, {.f = -0.05} },
243 { MODKEY, XK_i, spawn, {.v = showclipcmd } },
244 { MODKEY|ShiftMask, XK_i, spawn, {.v = irccmd } },
245 { MODKEY, XK_j, focusstack, {.i = +1 } },
246 { MODKEY|ShiftMask, XK_j, incnmaster, {.i = +1 } },
247 { MODKEY, XK_k, focusstack, {.i = -1 } },
248 { MODKEY|ShiftMask, XK_k, incnmaster, {.i = -1 } },
249 { MODKEY, XK_l, setmfact, {.f = +0.05} },
250 { MODKEY|ShiftMask, XK_l, setlayout, {.v = &layouts[1]} },
251 { MODKEY|ControlMask|ShiftMask, XK_l, spawn, {.v = keyboardlayoutcmd } },
252 { MODKEY, XK_m, spawn, {.v = mailcmd } },
253 { MODKEY|ShiftMask, XK_m, setlayout, {.v = &layouts[2]} },
254 { MODKEY|ControlMask|ShiftMask, XK_m, spawn, {.v = musiccmd } },
255 { MODKEY|ControlMask, XK_m, spawn, {.v = music_remote_cmd } },
256 { MODKEY, XK_n, spawn, {.v = newscmd } },
257 { MODKEY|ShiftMask, XK_n, spawn, {.v = newsrefreshcmd } },
258 { MODKEY|ControlMask|ShiftMask, XK_n, spawn, {.v = mpdnextcmd } },
259 { MODKEY|ControlMask, XK_n, spawn, {.v = mpd_remote_nextcmd } },
260 { MODKEY, XK_o, spawn, {.v = castcmd } },
261 { MODKEY|ShiftMask, XK_o, spawn, {.v = topcmd } },
262 { MODKEY, XK_p, spawn, {.v = passcmd } },
263 { MODKEY|ShiftMask, XK_p, spawn, {.v = passemailcmd } },
264 { MODKEY|ControlMask|ShiftMask, XK_p, spawn, {.v = mpdtogglecmd } },
265 { MODKEY|ControlMask, XK_p, spawn, {.v = mpd_remote_togglecmd } },
266 { MODKEY, XK_q, killclient, {0} },
267 { MODKEY|ShiftMask, XK_q, quit, {0} },
268 { MODKEY, XK_r, spawn, {.v = screenrecordcmd } },
269 { MODKEY|ShiftMask, XK_s, spawn, {.v = memeselectcmd } },
270 { MODKEY|ControlMask|ShiftMask, XK_s, spawn, {.v = mpdstopcmd } },
271 { MODKEY|ControlMask, XK_s, spawn, {.v = mpd_remote_stopcmd } },
272 { MODKEY, XK_t, spawn, {.v = textcmd } },
273 { MODKEY|ShiftMask, XK_t, setlayout, {.v = &layouts[0]} },
274 { MODKEY, XK_u, spawn, {.v = plumbcmd } },
275 { MODKEY|ShiftMask, XK_u, spawn, {.v = plumb2cmd } },
276 { MODKEY|ControlMask, XK_u, spawn, {.v = plumbremotecmd } },
277 { MODKEY|ControlMask|ShiftMask, XK_u, spawn, {.v = plumb2remotecmd } },
278 { MODKEY, XK_v, spawn, {.v = videocmd } },
279 { MODKEY, XK_w, spawn, {.v = browsercmd } },
280 { MODKEY|ShiftMask, XK_w, spawn, {.v = torbrowsercmd } },
281 { MODKEY|ControlMask|ShiftMask, XK_w, spawn, {.v = weathercmd } },
282 { MODKEY, XK_z, spawn, {.v = xlockcmd } },
283
284 { MODKEY, XK_0, view, {.ui = ~0 } },
285 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
286 TAGKEYS( XK_1, 0)
287 TAGKEYS( XK_2, 1)
288 TAGKEYS( XK_3, 2)
289 TAGKEYS( XK_4, 3)
290 TAGKEYS( XK_5, 4)
291 TAGKEYS( XK_6, 5)
292 TAGKEYS( XK_7, 6)
293 TAGKEYS( XK_8, 7)
294 TAGKEYS( XK_9, 8)
295 };
296
297 /* button definitions */
298 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
299 static Button buttons[] = {
300 /* click event mask button function argument */
301 { ClkLtSymbol, 0, Button1, setlayout, {0} },
302 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
303 { ClkWinTitle, 0, Button2, zoom, {0} },
304 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
305 { ClkClientWin, MODKEY, Button1, movemouse, {0} },
306 { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
307 { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
308 { ClkTagBar, 0, Button1, view, {0} },
309 { ClkTagBar, 0, Button3, toggleview, {0} },
310 { ClkTagBar, MODKEY, Button1, tag, {0} },
311 { ClkTagBar, MODKEY, Button3, toggletag, {0} },
312 };