-
Notifications
You must be signed in to change notification settings - Fork 46
/
config.def.h
executable file
·302 lines (260 loc) · 12.6 KB
/
config.def.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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
#include <X11/XF86keysym.h>
/* See LICENSE file for copyright and license details. */
/* appearance */
static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int gappx = 6;
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const int user_bh = 35; /* 0 means that dwm will calculate bar height, >=
1 means dwm will user_bh as bar height */
/* Display modes of the tab bar: never shown, always shown, shown only in */
/* monocle mode in the presence of several windows. */
/* Modes after showtab_nmodes are disabled. */
enum showtab_modes {
showtab_never,
showtab_auto,
showtab_nmodes,
showtab_always
};
static const int showtab = showtab_never; /* Default tab bar show mode */
static const int toptab = True; /* False means bottom tab bar */
static const char *fonts[] = {
"BlexMono Nerd Font:size=12:antialias=true:autohint=true",
"Sarasa UI SC:size=12:antialias=true:autohint=true",
};
static const char dmenufont[] =
"Sarasa UI SC:size=10:antialias=true:autohint=true";
static char normbgcolor[] = "#2E3440";
static char normbordercolor[] = "#3B4252";
static char normfgcolor[] = "#ECEFF4";
static char selfgcolor[] = "#D8DEE9";
static char selbordercolor[] = "#5E81AC";
static char selbgcolor[] = "#5E81AC";
static char termcol0[] = "#3b4252"; /* black */
static char termcol1[] = "#bf616a"; /* red */
static char termcol2[] = "#a3be8c"; /* green */
static char termcol3[] = "#ebcb8b"; /* yellow */
static char termcol4[] = "#81a1c1"; /* blue */
static char termcol5[] = "#b48ead"; /* magenta */
static char termcol6[] = "#88c0d0"; /* cyan */
static char termcol7[] = "#e5e9f0"; /* white */
static char termcol8[] = "#4c566a"; /* black */
static char termcol9[] = "#bf616a"; /* red */
static char termcol10[] = "#a3be8c"; /* green */
static char termcol11[] = "#ebcb8b"; /* yellow */
static char termcol12[] = "#81a1c1"; /* blue */
static char termcol13[] = "#b48ead"; /* magenta */
static char termcol14[] = "#8fbcbb"; /* cyan */
static char termcol15[] = "#eceff4"; /* white */
static char *termcolor[] = {
termcol0, termcol1, termcol2, termcol3, termcol4, termcol5,
termcol6, termcol7, termcol8, termcol9, termcol10, termcol11,
termcol12, termcol13, termcol14, termcol15,
};
static char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = {normfgcolor, normbgcolor, normbordercolor},
[SchemeSel] = {selfgcolor, selbgcolor, selbordercolor},
[SchemeHid] = {selbgcolor, normbgcolor, selbordercolor},
};
/* tagging */
// static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
static const char *tags[] = {"", "", "", "", "", "", "", "", ""};
static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags
mask isfloating monitor */
{"jetbrains-*", "JetBrains Toolbox", NULL, 1 << 1, 1, -1},
{"jetbrains-*", "sun-awt-X11-XFramePeer", NULL, 1 << 1, 0, -1},
{"jetbrains-*", "jetbrains-*", "win0", 1 << 1, 1, -1},
{"jetbrains-*", NULL, "Welcome to*", 1 << 1, 1, -1},
{"jetbrains-*", NULL, "Welcome to*", 1 << 1, 1, -1},
{"jetbrains-idea", NULL, NULL, 1 << 1, 0, -1},
{"jetbrains-clion", NULL, NULL, 1 << 1, 0, -1},
{"jetbrains-goland", NULL, NULL, 1 << 1, 0, -1},
{"jetbrains-pycharm", NULL, NULL, 1 << 1, 0, -1},
{"jetbrains-studio", NULL, NULL, 1 << 1, 0, -1},
{"Google-chrome", "google-chrome", NULL, 1 << 2, 0, -1},
{"Firefox", NULL, NULL, 1 << 2, 0, -1},
{"Microsoft-edge-beta", NULL, NULL, 1 << 2, 0, -1},
{"crx__ikhdkkncnoglghljlkmcimlnlhkeamad", NULL, NULL, 1 << 2, 1, -1},
{"Firefox", "Toolkit", NULL, 1 << 2, 1, -1},
{NULL, "music", NULL, 1 << 3, 0, -1},
{NULL, "SoundConverter", NULL, 1 << 3, 0, -1},
{"qqmusic", NULL, NULL, 1 << 3, 0, -1},
{"Spotify", "spotify", NULL, 1 << 3, 0, -1},
{"yesplaymusic", NULL, NULL, 1 << 3, 0, -1},
{"Netease-cloud-music-gtk", NULL, NULL, 1 << 3, 0, -1},
{"netease-cloud-music", NULL, NULL, 1 << 3, 0, -1},
{"Steam", NULL, NULL, 1 << 4, 0, -1},
{"Vmware", NULL, NULL, 1 << 5, 0, -1},
{"VirtualBox Machine", NULL, NULL, 1 << 5, 0, -1},
{"VirtualBox Manager", NULL, NULL, 1 << 5, 0, -1},
{"Qq", "qq", NULL, 1 << 6, 1, -1},
{"Freechat", "freechat", NULL, 1 << 6, 0, -1},
{"icalingua", NULL, NULL, 1 << 6, 0, -1},
{"electron-qq", "electron-qq", NULL, 1 << 6, 0, -1},
{"Postman", "postman", NULL, 1 << 6, 0, -1},
{"TelegramDesktop", NULL, NULL, 1 << 7, 0, -1},
{"qv2ray", NULL, NULL, 1 << 8, 0, -1},
{"qBittorrent", NULL, NULL, 1 << 8, 0, -1},
{"xdman-Main", NULL, NULL, 0, 1, -1},
{"copyq", NULL, NULL, 0, 1, -1},
{"Nitrogen", NULL, NULL, 0, 1, -1},
{"lxappearance", NULL, NULL, 0, 1, -1},
{"Qalculate-gtk", NULL, NULL, 0, 1, -1},
};
/* layout(s) */
static const float mfact = 0.50; /* 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 */
#include "layouts.c"
#include "tcl.c"
static const Layout layouts[] = {
/* symbol arrange function */
{"[]=", tile}, /* first entry is default */
{"><>", NULL}, /* no layout function means floating behavior */
{"[M]", monocle}, {"HHH", grid}, {"|||", tcl},
{"TTT", bstack}, {"===", bstackhoriz},
};
/* key definitions */
#define MODKEY Mod4Mask
#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 CMD(cmd) \
{ \
.v = (const char *[]) { "/bin/sh", "-c", cmd, NULL } \
}
/* commands */
static char dmenumon[2] =
"0"; /* component of dmenucmd, manipulated in spawn() */
static const char *termcmd[] = {"alacritty", "-e", "zsh", NULL};
static const char *subtermcmd[] = {"kitty", "-e", "--single-instance", NULL};
static const char scratchpadname[] = "scratchpad";
static const char *scratchpadcmd[] = {"st", "-t", scratchpadname, "-g",
"48x12", "-e", "cava", NULL};
static const char *rofidruncmd[] = {"rofi", "-show", "drun", NULL};
static const char *windowswitchcmd[] = {"rofi", "-show", "window", NULL};
static const char *dmenucmd[] = {"dmenu_run_history", NULL};
static const char *recordmenucmd[] = {"recordmenu", NULL};
static const char *upvol[] = {"/usr/bin/pactl", "set-sink-volume", "0", "+3%",
NULL};
static const char *downvol[] = {"/usr/bin/pactl", "set-sink-volume", "0", "-3%",
NULL};
static const char *mutevol[] = {"/usr/bin/pactl", "set-sink-mute", "0",
"toggle", NULL};
static const char *upbrt[] = {"light", "-A", "5", NULL};
static const char *downbrt[] = {"light", "-U", "5", NULL};
static Key keys[] = {
/* modifier key function argument */
{MODKEY, XK_Return, spawn, {.v = subtermcmd}},
{MODKEY | ShiftMask, XK_Return, spawn, {.v = termcmd}},
{MODKEY, XK_grave, togglescratch, {.v = scratchpadcmd}},
{MODKEY, XK_d, spawn, {.v = dmenucmd}},
{MODKEY, XK_p, spawn, {.v = rofidruncmd}},
{MODKEY, XK_r, spawn, {.v = recordmenucmd}},
{MODKEY, XK_w, spawn, {.v = windowswitchcmd}},
{MODKEY, XK_b, togglebar, {0}},
{MODKEY | ControlMask, XK_m, focusmaster, {0}},
{MODKEY, XK_s, show, {0}},
{MODKEY, XK_h, hide, {0}},
{MODKEY, XK_j, focusstackhid, {.i = +1}},
{MODKEY, XK_k, focusstackhid, {.i = -1}},
{MODKEY | ShiftMask, XK_j, shiftviewclients, {.i = -1}},
{MODKEY | ShiftMask, XK_k, shiftviewclients, {.i = +1}},
{MODKEY | ControlMask, XK_Return, zoom, {0}},
{MODKEY, XK_Tab, view, {0}},
{MODKEY, 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_g, setlayout, {.v = &layouts[3]}},
{MODKEY, XK_u, setlayout, {.v = &layouts[4]}},
{MODKEY, XK_i, setlayout, {.v = &layouts[5]}},
{MODKEY, XK_o, setlayout, {.v = &layouts[6]}},
{MODKEY | ShiftMask, XK_f, fullscreen, {0}},
{MODKEY | ShiftMask, XK_space, togglefloating, {0}},
{MODKEY, XK_0, view, {.ui = ~0}},
{MODKEY | ShiftMask, XK_0, tag, {.ui = ~0}},
{MODKEY, XK_comma, setmfact, {.f = -0.05}},
{MODKEY, XK_period, setmfact, {.f = +0.05}},
{MODKEY | Mod1Mask, XK_comma, focusmon, {.i = -1}},
{MODKEY | Mod1Mask, XK_period, focusmon, {.i = +1}},
{MODKEY | ControlMask, XK_comma, tagmon, {.i = -1}},
{MODKEY | ControlMask, XK_period, tagmon, {.i = +1}},
{MODKEY | ShiftMask, XK_comma, shiftview, {.i = -1}},
{MODKEY | ShiftMask, XK_period, shiftview, {.i = +1}},
{MODKEY, XK_F5, xrdb, {.v = NULL}},
/* My Own App Start Ways */
{MODKEY, XK_e, spawn, CMD("microsoft-edge-beta")},
{MODKEY, XK_z, spawn, CMD("zathura")},
{MODKEY, XK_x, spawn, CMD("joplin-desktop")},
{MODKEY, XK_v, spawn, CMD("glrnvim")},
{MODKEY | ShiftMask, XK_q, spawn, CMD("xkill")},
{MODKEY | ShiftMask, XK_s, spawn, CMD("flameshot gui")},
{MODKEY | ShiftMask, XK_n, spawn, CMD("nemo")},
{MODKEY | ShiftMask, XK_m, spawn,
CMD("alacritty --class music -e ncmpcpp")},
{MODKEY | ShiftMask, XK_h, spawn, CMD("alacritty -e htop")},
{MODKEY | ShiftMask, XK_v, spawn,
CMD("VBoxManage startvm 'Windows10' --type gui")},
{Mod1Mask | ControlMask, XK_Delete, spawn, CMD("betterlockscreen -l")},
/*IDE start*/
{Mod1Mask, XK_v, spawn, CMD("neovide")},
{Mod1Mask, XK_c, spawn, CMD("clion")},
{Mod1Mask, XK_i, spawn, CMD("idea")},
{Mod1Mask, XK_p, spawn, CMD("pycharm")},
{Mod1Mask, XK_g, spawn, CMD("goland")},
/* Switch nord and light */
{MODKEY | ControlMask, XK_n, spawn, CMD("sh ~/.local/bin/switch n dwm")},
{MODKEY | ControlMask, XK_l, spawn, CMD("sh ~/.local/bin/switch l dwm")},
{MODKEY | ControlMask, XK_s, spawn, CMD("sh ~/.local/bin/switch-dwm")},
/* Mpd control */
{MODKEY | ControlMask, XK_p, spawn, CMD("mpc toggle")},
{MODKEY | ControlMask, XK_Left, spawn, CMD("mpc prev")},
{MODKEY | ControlMask, XK_Right, spawn, CMD("mpc next")},
/* Touchpad */
{MODKEY | ControlMask, XK_e, spawn,
CMD("xinput enable 'DELL0828:00 06CB:7E7E Touchpad'")},
{MODKEY | ControlMask, XK_d, spawn,
CMD("xinput disable 'DELL0828:00 06CB:7E7E Touchpad'")},
/* XF86Keys */
{0, XF86XK_AudioMute, spawn, {.v = mutevol}},
{0, XF86XK_AudioLowerVolume, spawn, {.v = downvol}},
{0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol}},
{0, XF86XK_MonBrightnessUp, spawn, {.v = upbrt}},
{0, XF86XK_MonBrightnessDown, spawn, {.v = downbrt}},
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){MODKEY | ShiftMask, XK_Escape, quit, {0}},
{MODKEY | ShiftMask, XK_r, quit, {1}},
};
/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
* ClkClientWin, or ClkRootWin */
static Button buttons[] = {
/* click event mask button function argument
*/
{ClkLtSymbol, 0, Button1, setlayout, {0}},
{ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[4]}},
{ClkWinTitle, 0, Button1, togglewin, {0}},
{ClkWinTitle, 0, Button2, zoom, {0}},
{ClkStatusText, 0, Button2, spawn, {.v = termcmd}},
{ClkClientWin, MODKEY, Button1, movemouse, {0}},
{ClkClientWin, MODKEY, Button2, togglefloating, {0}},
{ClkClientWin, MODKEY, Button3, resizemouse, {0}},
{ClkTagBar, 0, Button1, view, {0}},
{ClkTagBar, 0, Button3, toggleview, {0}},
{ClkTagBar, MODKEY, Button1, tag, {0}},
{ClkTagBar, MODKEY, Button3, toggletag, {0}},
{ClkTabBar, 0, Button1, focuswin, {0}},
};