dwm
dynamic window manager
git clone https://9o.is/git/dwm.git
config.h
(8058B)
1 /* See LICENSE file for copyright and license details. */
2
3 /* appearance */
4 static const unsigned int borderpx = 1; /* 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 = 0; /* 0 means bottom bar */
8 static const char *fonts[] = { "Fira Mono:size=18" };
9 static const char dmenufont[] = "Fira Mono:size=18";
10 static const char col_black[] = "#131314";
11 static const char col_surface[] = "#616162";
12 static const char col_white[] = "#e3e3e3";
13 static const char col_blue[] = "#89b4fa";
14 static const char *colors[][3] = {
15 /* fg bg border */
16 [SchemeNorm] = { col_white, col_black, col_surface },
17 [SchemeSel] = { col_blue, col_black, col_blue },
18 };
19
20 /* tagging */
21 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
22
23 static const Rule rules[] = {
24 /* class instance title tags mask isfloating monitor */
25 { ":zenity", NULL, NULL, 0, 1, -1 },
26 };
27
28 /* layout(s) */
29 static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
30 static const int nmaster = 1; /* number of clients in master area */
31 static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
32 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
33 static const int refreshrate = 120; /* refresh rate (per second) for client move/resize */
34
35 static const float fgw = .8, fgh = .8; /* foregrounded size */
36
37 static const Layout layouts[] = {
38 /* symbol arrange function */
39 { "[]D", deck },
40 { "[]=", tile },
41 { "[M]", monocle },
42 { "><>", NULL },
43 };
44
45 /* key definitions */
46 #define MODKEY Mod4Mask
47
48 /*
49 Mod - go to window
50 Mod+M - go to tag
51 Mod+C - send to tag
52 Mod+M+C - send/go to tag
53 Mod+S - toggle tag
54 */
55 #define NUMKEYS(KEY,VAL) \
56 { MODKEY, KEY, focusstacknum, { .i = (VAL + 1) } }, \
57 { MODKEY|Mod1Mask, KEY, view, { .ui = 1 << VAL } }, \
58 { MODKEY|ControlMask, KEY, tag, { .ui = 1 << VAL } }, \
59 { MODKEY|Mod1Mask|ControlMask, KEY, toggletag, { .ui = 1 << VAL } }, \
60 { MODKEY|ShiftMask, KEY, toggleview, { .ui = 1 << VAL } },
61
62 #define DIRKEYS(KEY,VAL) \
63 { MODKEY, KEY, focusstack, { .i = VAL } }, \
64 { MODKEY|Mod1Mask, KEY, shiftview, { .i = VAL } }, \
65 { MODKEY|ControlMask, KEY, shifttag, { .i = VAL } }, \
66 { MODKEY|Mod1Mask|ControlMask, KEY, shiftboth, { .i = VAL } },
67
68 #define LAYKEYS(KEY,VAL) \
69 { MODKEY, KEY, incnmaster, { .i = VAL } }, \
70 { MODKEY|ShiftMask, KEY, setmfact, { .f = (VAL * 0.05) } },
71
72 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
73 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
74
75 /* commands */
76 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
77 static const char *dmenu_launch[] = { "dmenu-launch", "-m", dmenumon, NULL };
78 static const char *dmenu_cmd[] = { "dmenu-cmd", "-m", dmenumon, NULL };
79 static const char *term_cmd[] = { "dmenu-terminal", NULL };
80 static const char *incvol[] = {"dmenu-volume", "increment", "10", NULL};
81 static const char *decvol[] = {"dmenu-volume", "decrement", "10", NULL};
82 static const char *mutvol[] = {"dmenu-volume", "mute", NULL};
83 static const char *dmenu_brightness[] = { "dmenu-brightness", NULL };
84 static const char *pottog[] = { "potctl", "-t", NULL };
85 static const char *potinc[] = { "potctl", "-i", NULL };
86 static const char *potdec[] = { "potctl", "-d", NULL };
87 static const char *qubescopy[] = { "qubes-clipboard", "copy", NULL };
88 static const char *qubespaste[] = { "qubes-clipboard", "paste", NULL };
89 static const char *dmenu_lsw[] = { "dmenu-lsw", "-m", dmenumon, NULL };
90
91 #include "shift-tools.c"
92
93 static const Key keys[] = {
94 /* modifier key function argument */
95 { MODKEY, XK_w, spawn, {.v = dmenu_lsw } },
96 { MODKEY, XK_d, spawn, {.v = dmenu_launch } },
97 { MODKEY, XK_p, spawn, {.v = dmenu_cmd } },
98 { MODKEY|ShiftMask, XK_b, spawn, {.v = dmenu_brightness } },
99 { MODKEY|ShiftMask, XK_Return, spawn, {.v = term_cmd } },
100 { ControlMask|ShiftMask, XK_c, spawn, {.v = qubescopy } },
101 { ControlMask|ShiftMask, XK_v, spawn, {.v = qubespaste } },
102 { MODKEY, XK_Return, zoom, {0} },
103 { MODKEY, XK_Tab, view, {0} },
104 { MODKEY|Mod1Mask, XK_q, killclient, {0} },
105 { MODKEY, XK_b, togglebar, {0} },
106 { MODKEY, XK_r, setlayout, {.v = &layouts[0]} },
107 { MODKEY, XK_t, setlayout, {.v = &layouts[1]} },
108 { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
109 { MODKEY, XK_f, setlayout, {.v = &layouts[3]} },
110 { MODKEY, XK_space, setlayout, {0} },
111 { MODKEY, XK_minus, fgtoggle, {0} },
112 { MODKEY|ShiftMask, XK_0, view, {.ui = ~0 } },
113 { MODKEY|Mod1Mask, XK_0, tag, {.ui = ~0 } },
114 NUMKEYS( XK_1, 0)
115 NUMKEYS( XK_2, 1)
116 NUMKEYS( XK_3, 2)
117 NUMKEYS( XK_4, 3)
118 NUMKEYS( XK_5, 4)
119 NUMKEYS( XK_6, 5)
120 NUMKEYS( XK_7, 6)
121 NUMKEYS( XK_8, 7)
122 NUMKEYS( XK_9, 8)
123 DIRKEYS( XK_Left, -1)
124 DIRKEYS( XK_Right, +1)
125 LAYKEYS( XK_Up, -1)
126 LAYKEYS( XK_Down, +1)
127 { 0, XF86XK_AudioLowerVolume, spawn, {.v = decvol} },
128 { 0, XF86XK_AudioRaiseVolume, spawn, {.v = incvol} },
129 { 0, XF86XK_AudioMute, spawn, {.v = mutvol} },
130 };
131
132 /* button definitions */
133 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
134 static const Button buttons[] = {
135 /* click event mask button function argument */
136 { ClkLtSymbol, 0, Button1, setlayout, {0} },
137 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
138 { ClkWinTitle, 0, Button2, zoom, {0} },
139 { ClkStatusText, 0, Button1, spawn, {.v = pottog } },
140 { ClkStatusText, 0, Button4, spawn, {.v = potinc } },
141 { ClkStatusText, 0, Button5, spawn, {.v = potdec } },
142 { ClkClientWin, MODKEY, Button1, movemouse, {0} },
143 { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
144 { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
145 { ClkTagBar, 0, Button1, view, {0} },
146 { ClkTagBar, 0, Button3, toggleview, {0} },
147 { ClkTagBar, MODKEY, Button1, tag, {0} },
148 { ClkTagBar, MODKEY, Button3, toggletag, {0} },
149 };
150