Merge branch 'hide_vacant_tags'
[dwm.git] / config.h
1 /* See LICENSE file for copyright and license details. */
2
3 #include <X11/XF86keysym.h>
4
5 /* appearance */
6 static const unsigned int borderpx = 1; /* border pixel of windows */
7 static const unsigned int gappx = 8; /* gap pixel between windows */
8 static const unsigned int snap = 16; /* snap pixel */
9 static const unsigned int systraypinning = 1; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
10 static const unsigned int systrayspacing = 2; /* systray spacing */
11 static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
12 static const int showsystray = 1; /* 0 means no systray */
13 static const int showbar = 1; /* 0 means no bar */
14 static const int topbar = 1; /* 0 means bottom bar */
15 static const char *fonts[] = { "monospace:size=10", "JoyPixels:pixelsize=10:antialias=true:autohint=true" };
16 static const char dmenufont[] = "monospace:size=10";
17 static const char col_gray1[] = "#222222";
18 static const char col_gray2[] = "#444444";
19 static const char col_gray3[] = "#bbbbbb";
20 static const char col_gray4[] = "#eeeeee";
21 static const char col_cyan[] = "#007799";
22 static const char *colors[][3] = {
23 /* fg bg border */
24 [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
25 [SchemeSel] = { col_gray4, col_cyan, col_cyan },
26 };
27
28 /* tagging */
29 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
30
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 mask isfloating monitor */
37 { NULL, NULL, "webcam", 0x1FF, 1, -1 },
38 };
39
40 /* layout(s) */
41 static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
42 static const int nmaster = 1; /* number of clients in master area */
43 static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
44
45 static const Layout layouts[] = {
46 /* symbol arrange function */
47 { "◧", tile }, /* first entry is default */
48 { "🗗", NULL }, /* no layout function means floating behavior */
49 { "🔍", monocle }, // TODO hide unfocused windows for background transparency?
50 };
51
52 /* key definitions */
53 #define MODKEY Mod4Mask
54 #define TAGKEYS(KEY,TAG) \
55 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
56 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
57 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
58 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
59 #define MEDIAKEY(KEY,CMD) {0, KEY, spawn, {.v = (const char *[]){ "sh", "-c", CMD, NULL } } } /* TODO don't fire up unnecessary shells */
60
61 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
62 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
63
64 /* commands */
65 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
66 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
67 static const char *termcmd[] = { "st", NULL };
68 static const char *killx[] = { "pkill", "xinit", NULL };
69
70 static Key keys[] = {
71 /* modifier key function argument */
72 { MODKEY, XK_p, spawn, {.v = dmenucmd } },
73 { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
74 { MODKEY, XK_b, togglebar, {0} },
75 { MODKEY, XK_j, focusstack, {.i = +1 } },
76 { MODKEY, XK_k, focusstack, {.i = -1 } },
77 { MODKEY, XK_i, incnmaster, {.i = +1 } },
78 { MODKEY, XK_d, incnmaster, {.i = -1 } },
79 { MODKEY, XK_h, setmfact, {.f = -0.05} },
80 { MODKEY, XK_l, setmfact, {.f = +0.05} },
81 { MODKEY, XK_Return, zoom, {0} },
82 { MODKEY, XK_Tab, view, {0} },
83 { MODKEY|ShiftMask, XK_c, killclient, {0} },
84 { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
85 { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
86 { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
87 { MODKEY, XK_space, setlayout, {0} },
88 { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
89 { MODKEY, XK_0, view, {.ui = ~0 } },
90 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
91 { MODKEY, XK_comma, focusmon, {.i = -1 } },
92 { MODKEY, XK_period, focusmon, {.i = +1 } },
93 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
94 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
95 TAGKEYS( XK_1, 0)
96 TAGKEYS( XK_2, 1)
97 TAGKEYS( XK_3, 2)
98 TAGKEYS( XK_4, 3)
99 TAGKEYS( XK_5, 4)
100 TAGKEYS( XK_6, 5)
101 TAGKEYS( XK_7, 6)
102 TAGKEYS( XK_8, 7)
103 TAGKEYS( XK_9, 8)
104 { MODKEY|ShiftMask, XK_r, quit, {0} }, // just exits dwm, allows for restart
105 { MODKEY|ShiftMask, XK_q, spawn, {.v = killx } }, // kills x session
106 };
107
108 /* button definitions */
109 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
110 static Button buttons[] = {
111 /* click event mask button function argument */
112 { ClkLtSymbol, 0, Button1, setlayout, {0} },
113 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
114 { ClkWinTitle, 0, Button2, zoom, {0} },
115 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
116 { ClkClientWin, MODKEY, Button1, movemouse, {0} },
117 { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
118 { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
119 { ClkTagBar, 0, Button1, view, {0} },
120 { ClkTagBar, 0, Button3, toggleview, {0} },
121 { ClkTagBar, MODKEY, Button1, tag, {0} },
122 { ClkTagBar, MODKEY, Button3, toggletag, {0} },
123 };
124