-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
219 lines (194 loc) · 11.9 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
/* See LICENSE file for copyright and license details. */
#include <X11/XF86keysym.h>
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const int startwithgaps[] = { 1 }; /* 1 means gaps are used by default, this can be customized for each tag */
static const unsigned int gappx[] = { 10 }; /* default gap between windows in pixels, this can be customized for each tag */
static const unsigned int snap = 32; /* snap pixel */
static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const int usealtbar = 1; /* 1 means use non-dwm status bar */
static const char *altbarclass = "Polybar"; /* Alternate bar class name */
static const char *alttrayname = "tray"; /* Polybar tray instance name */
static const char *altbarcmd = "~/.config/dwm/startbar"; /* Alternate bar launch command */
static const int focusonwheel = 0; /* 0 means allow mouse wheel click */
static const int decorhints = 0; /* 1 means respect decoration hints */
static const char *fonts[] = { "FiraCode Nerd Font Mono:size=13" };
static const char dmenufont[] = "FiraCode Nerd Font Mono:size=13";
/* colour */
static const char c_black[] = "#080808";
static const char c_dark_grey[] = "#161616";
static const char c_grey[] = "#242424";
static const char c_light_grey[] = "#323232";
static const char c_off_white[] = "#e0e0e0";
static const char c_white[] = "#f5f5f5";
static const char c_red[] = "#da291c";
static const char c_flat_red[] = "#e0493e";
static const char c_green[] = "#328b2d";
static const char c_flat_green[] = "#4f9a4a";
static const char c_blue[] = "#003052";
static const char c_flat_blue[] = "#004b87";
static const char c_yellow[] = "#e07400";
static const char c_flat_yellow[] = "#ffcd00";
static const char c_purple[] = "#66023c";
static const char c_flat_purple[] = "#972066";
static const char *colors[][4] = {
/* fg bg border float */
[SchemeNorm] = { c_white, c_dark_grey, c_dark_grey, c_dark_grey },
[SchemeSel] = { c_white, c_flat_green, c_off_white, c_off_white },
[SchemeUrg] = { c_white, c_flat_green, c_flat_red, c_flat_red },
};
/* scratchpads */
const char *sp_terminal[] = {"alacritty", "--class", "sp_term", "--config-file", ".config/alacritty/scratchpad.yml", NULL };
const char *sp_keepassxc[] = {"keepassxc", NULL };
static Scratchpad scratchpads[] = {
/* name cmd */
{"sp_term", sp_terminal},
{"sp_pass", sp_keepassxc},
};
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* Note
* St with Xresources patch is 'St' otherwise it is 'st'
*/
/* class instance title tags mask isfloating isfreesize isterminal noswallow monitor */
{ "Gimp", NULL, NULL, 0, 1, 1, 0, 0, -1 },
{ "Surf", NULL, NULL, 0, 0, 0, 0, -1, -1 },
{ "Emacs", NULL, NULL, 0, 0, 0, 0, -1, -1 },
{ "st", NULL, NULL, 0, 0, 0, 1, 0, -1 },
{ "St", NULL, NULL, 0, 0, 0, 1, 0, -1 },
{ "Alacritty", NULL, NULL, 0, 0, 0, 1, 0, -1 },
{ "Nextcloud", NULL, NULL, 0, 1, 1, 0, 0, -1 },
{ NULL, NULL, "Event Tester", 0, 0, 0, 0, 1, -1 },
/* mpv
* swallow from terminal
* floating pop-up from file manager
* requires `alias mpv="mpv --x11-name='swallow-mpv'"`
*/
{ "gl", "mpv", NULL, 0, 1, 1, 0, 0, -1 },
{ "swallow-mpv", "mpv", NULL, 0, 0, 0, 0, -1, -1 },
/* steam */
{ NULL, NULL, "Friends List", 0, 0, 0, 0, 0, -1 },
{ NULL, NULL, "BodySlide", 0, 1, 0, 0, 0, -1 },
/* origin -- required to work */
{ NULL, "origin.exe",NULL, 0, 1, 1, 0, 0, -1 },
/* scratchpads */
{ NULL, "sp_term", NULL, SPTAG(0), 1, 1, 0, 0, -1 },
{ NULL, "keepassxc", NULL, SPTAG(1), 1, 1, 0, 0, -1 },
};
/* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
static const Layout layouts[] = {
/* symbol arrange function */
{ "[T]", tile }, /* first entry is default */
{ "[F]", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
{ "TTT", bstack },
{ "===", bstackhoriz },
};
/* key definitions */
#define MODKEY Mod4Mask
#define AltMask Mod1Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *druncmd[] = { "rofi", "-show", "drun", NULL };
static const char *runcmd[] = { "rofi", "-show", "run", NULL };
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", c_dark_grey, "-nf", c_white, "-sb", c_flat_green, "-sf", c_off_white, NULL };
static const char *termcmd[] = { "alacritty", NULL };
static const char *slockcmd[] = { "slock", NULL };
static const Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = druncmd } },
{ MODKEY, XK_x, spawn, {.v = runcmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
{ MODKEY|ShiftMask, XK_l, spawn, {.v = slockcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_space, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_q, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_u, setlayout, {.v = &layouts[3]} },
{ MODKEY, XK_o, setlayout, {.v = &layouts[4]} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY|ControlMask, XK_space, togglealwaysontop, {0} },
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
{ MODKEY, XK_Right, viewnext, {0} },
{ MODKEY, XK_Left, viewprev, {0} },
{ MODKEY|ShiftMask, XK_Right, tagtonext, {0} },
{ MODKEY|ShiftMask, XK_Left, tagtoprev, {0} },
{ MODKEY, XK_minus, setgaps, {.i = -5 } },
{ MODKEY, XK_equal, setgaps, {.i = +5 } },
{ MODKEY|ShiftMask, XK_minus, setgaps, {.i = GAP_RESET } },
{ MODKEY|ShiftMask, XK_equal, setgaps, {.i = GAP_TOGGLE} },
{ MODKEY, XK_bracketleft, togglescratch, {.ui = 0 } },
{ MODKEY, XK_bracketright, togglescratch, {.ui = 1 } },
/* XF86 Controls */
{ 0, XF86XK_AudioMute, spawn, SHCMD("xf86-pulseaudio toggle-mute") },
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("xf86-pulseaudio volume-up") },
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("xf86-pulseaudio volume-down") },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3)
TAGKEYS( XK_5, 4)
TAGKEYS( XK_6, 5)
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ ControlMask|AltMask, XK_Delete, quit, {0} },
};
/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static const Button buttons[] = {
/* click event mask button function argument */
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
};
static const char *ipcsockpath = "/tmp/dwm.sock";
static IPCCommand ipccommands[] = {
IPCCOMMAND( view, 1, {ARG_TYPE_UINT} ),
IPCCOMMAND( toggleview, 1, {ARG_TYPE_UINT} ),
IPCCOMMAND( tag, 1, {ARG_TYPE_UINT} ),
IPCCOMMAND( toggletag, 1, {ARG_TYPE_UINT} ),
IPCCOMMAND( tagmon, 1, {ARG_TYPE_UINT} ),
IPCCOMMAND( focusmon, 1, {ARG_TYPE_SINT} ),
IPCCOMMAND( focusstack, 1, {ARG_TYPE_SINT} ),
IPCCOMMAND( zoom, 1, {ARG_TYPE_NONE} ),
IPCCOMMAND( incnmaster, 1, {ARG_TYPE_SINT} ),
IPCCOMMAND( killclient, 1, {ARG_TYPE_SINT} ),
IPCCOMMAND( togglefloating, 1, {ARG_TYPE_NONE} ),
IPCCOMMAND( setmfact, 1, {ARG_TYPE_FLOAT} ),
IPCCOMMAND( setlayoutsafe, 1, {ARG_TYPE_PTR} ),
IPCCOMMAND( quit, 1, {ARG_TYPE_NONE} )
};