-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
264 lines (236 loc) · 13.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
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
/* See LICENSE file for copyright and license details. */
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
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 = 0; /* 0 means bottom bar */
static const char *fonts[] = { "ibm plex mono:size=10", "noto emoji:size=9", "font awesome:size=9" };
// defualt colors
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#005577";
// molokai colors
static const char col_gray[] = "#121212";
static const char col_magenta[] = "#e71d36";
static const char col_orange[] = "#ff8700";
static const char col_red[] = "#8b0000";
static const char col_geniva_blue[] = "#68adb3";
static const char col_brown[] = "#5c431c";
static const char col_blonde[] = "#F0E2B6";
static const char *colors[][4] = {
/* fg bg border float */
/* [SchemeNorm] = { col_geniva_blue, col_brown, col_brown },
[SchemeSel] = { col_brown, col_blonde, col_blonde }, */
[SchemeNorm] = { col_gray2, col_gray3, col_cyan },
[SchemeSel] = { col_gray4, col_brown, col_geniva_blue },
/* [SchemeNorm] = { col_gray4, col_gray, col_gray, col_gray },
[SchemeSel] = { col_gray4, col_magenta, col_orange, col_red }, */
};
typedef struct {
const char *name;
const void *cmd;
} Sp;
const char *spcmd1[] = {"st", "-n", "spterm", "-g", "144x41", NULL };
const char *spcmd2[] = {"st", "-n", "splf", "-g", "144x41", "-e", "lf", NULL };
const char *spcmd3[] = {"st", "-n", "sppm", "-g", "144x41", "-e", "pulsemixer", NULL };
const char *spcmd4[] = {"st", "-n", "sppu", "-g", "144x41", "-e", "popupgrade", NULL };
const char *spcmd5[] = {"st", "-n", "spcalc", "-f", "monospace:size=16", "-g", "50x20", "-e", "bc", "-lq", NULL };
const char *spcmd6[] = {"tabbed", "-n", "spsurf", "-g", "1200x900", "-c", "surf", "-e", NULL };
const char *spcmd7[] = {"st", "-n", "spcal", "-g", "144x41", "-e", "st -e calcurse -D ~/.config/calcurse", NULL };
const char *spcmd8[] = {"st", "-n", "splff", "-g", "144x41", "-e", "lf", NULL };
static Sp scratchpads[] = {
/* name cmd */
{"spterm", spcmd1},
{"splf", spcmd2},
{"sppm", spcmd3},
{"sppu", spcmd4},
{"spclac", spcmd5},
{"spsurf", spcmd6},
{"spcal", spcmd7},
{"splff", spcmd8},
};
/* tagging */
/* static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; */
static const char *tags[] = { "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX" };
static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating swollow monitor */
/* Rule to make st swallow programs started in the terminal to be swollowed */
{ "st", NULL, NULL, 0, 0, 1, -1 },
/* Rules to make certain windows automatically float */
{ "Gimp", NULL, NULL, 0, 1, 1, -1 },
{ "st", NULL, "lfmpv", 0, 1, 1, -1 },
{ "st", NULL, "/bin/sh", 0, 1, 1, -1 },
{ "st", NULL, "popupgrade", 0 << 8, 1, 1, -1 },
/* All the scratch pads */
{ NULL, "spterm", NULL, SPTAG(0), 1, 0, -1 },
{ NULL, "splf", NULL, SPTAG(1), 1, 0, -1 },
{ NULL, "sppm", NULL, SPTAG(2), 1, 0, -1 },
{ NULL, "sppu", NULL, SPTAG(3), 1, 0, -1 },
{ NULL, "spcalc", NULL, SPTAG(4), 1, 0, -1 },
{ NULL, "spsurf", NULL, SPTAG(5), 1, 0, -1 },
{ NULL, "spcal", NULL, SPTAG(6), 1, 0, -1 },
{ NULL, "splff", NULL, SPTAG(7), 1, 0, -1 },
};
/* layout(s) */
static const float mfact = 0.6; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
static const int decorhints = 1; /* 1 means respect decoration hints */
#include "fibonacci.c"
static const Layout layouts[] = {
/* symbol arrange function */
{ "[]=", tile }, /* first entry is default */
{ "TTT", bstack },
{ "[M]", monocle },
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[@]", spiral },
{ "[\\]", dwindle },
};
/* 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 SHCMD(cmd) { .v = (const char*[]){ "/bin/dash", "-c", cmd, NULL } }
/* commands */
/* static const char *termcmd[] = { "st", NULL }; */
#include <X11/XF86keysym.h>
#include "focusurgent.c"
static Key keys[] = {
/* modifier key function argument */
/* dwm control keys */
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_u, focusurgent, {0} },
{ 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_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_k, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY|ShiftMask, XK_t, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY|ControlMask, XK_f, setlayout, {.v = &layouts[3]} },
{ MODKEY, XK_a, setlayout, {.v = &layouts[4]} },
{ MODKEY|ShiftMask, XK_a, setlayout, {.v = &layouts[5]} },
{ MODKEY, XK_f, togglefullscr, {0} },
{ MODKEY|ShiftMask, XK_f, togglefloating, {0} },
{ MODKEY, XK_s, togglesticky, {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 } },
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_e, quit, {0} },
{ MODKEY|ControlMask, XK_e, quit, {1} },
/* maime */
{ MODKEY, XK_n, spawn, SHCMD("kill -35 $(pidof maime)") },
{ MODKEY|ShiftMask, XK_n, spawn, SHCMD("kill -36 $(pidof maime)") },
/* spawn Keys */
{ MODKEY|ShiftMask, XK_Return, spawn, SHCMD("st") },
{ MODKEY, XK_o, spawn, SHCMD("dmenu_run -l 20") },
{ MODKEY|ShiftMask, XK_b, spawn, SHCMD("st -e bmon -p w*,*") },
{ MODKEY|ShiftMask, XK_d, spawn, SHCMD("geodoppler") },
{ MODKEY|ShiftMask, XK_m, spawn, SHCMD("st -e lf") },
{ MODKEY, XK_e, spawn, SHCMD("st -e neomutt; kill -$((34+12)) $(pidof zara)") },
{ MODKEY|ControlMask, XK_t, spawn, SHCMD("torwrap; kill -$((34+7)) $(pidof zara)") },
{ MODKEY|ShiftMask, XK_h, spawn, SHCMD("selectionhandler dmenuhandler") },
{ MODKEY|ControlMask, XK_h, spawn, SHCMD("selectionhandler linkhandler") },
{ MODKEY|ShiftMask|ControlMask, XK_h, spawn, SHCMD("st -e htop") },
{ MODKEY, XK_g, spawn, SHCMD("st -e gotop") },
{ MODKEY|ControlMask, XK_c, spawn, SHCMD("camtoggle") },
{ MODKEY, XK_w, spawn, SHCMD("brave") },
{ MODKEY|ShiftMask, XK_w, spawn, SHCMD("librewolf") },
{ MODKEY|ControlMask, XK_w, spawn, SHCMD("st -e nmtui; kill -$((34+2)) $(pidof zara) && kill -$((34+4)) $(pifof zara)") },
/* scratch pads */
{ MODKEY, XK_y, togglescratch, {.ui = 0 } },
{ MODKEY|ShiftMask, XK_u, togglescratch, {.ui = 1 } },
{ MODKEY|ShiftMask, XK_p, togglescratch, {.ui = 2 } },
{ MODKEY|ControlMask, XK_p, togglescratch, {.ui = 3 } },
{ MODKEY, XK_c, togglescratch, {.ui = 6 } },
{ MODKEY|ShiftMask, XK_c, togglescratch, {.ui = 4 } },
{ MODKEY|ControlMask, XK_b, togglescratch, {.ui = 5 } },
{ MODKEY|ControlMask, XK_u, togglescratch, {.ui = 7 } },
/* control keys */
{ MODKEY, XK_grave, spawn, SHCMD("dmenuunicode") },
{ MODKEY, XK_Insert, spawn, SHCMD("showclip") },
{ MODKEY|ShiftMask, XK_Insert, spawn, SHCMD("switchclip") },
{ MODKEY|ShiftMask, XK_s, spawn, SHCMD("selectionswitch") },
{ MODKEY|ShiftMask, XK_i, spawn, SHCMD("speedtest-notify") },
{ MODKEY|ShiftMask, XK_r, spawn, SHCMD("dmenuresp") },
{ MODKEY|ControlMask, XK_r, spawn, SHCMD("dmenurefbar") },
{ MODKEY|ShiftMask, XK_l, spawn, SHCMD("$LOCKER") },
{ MODKEY|ControlMask, XK_l, spawn, SHCMD("$LOCKER & sleep 1 && sysact hibernate") },
/* recording keys */
{ MODKEY, XK_F12, spawn, SHCMD("maim pic-full-$(date '+%y%m%d-%H%M-%S').png") },
{ MODKEY|ShiftMask, XK_F12, spawn, SHCMD("maimpick") },
{ MODKEY, XK_r, spawn, SHCMD("dmenurecord; kill -$((34+9)) $(pidof zara)") },
{ MODKEY, XK_Delete, spawn, SHCMD("dmenurecord kill; kill -$((34+9)) $(pidof zara)") },
/* power keys */
{ MODKEY|ShiftMask, XK_Escape, spawn, SHCMD("sysact") },
/* XF86 keys */
{ 0, XF86XK_AudioMute, spawn, SHCMD("pamixer -t; kill -44 $(pidof zara)") },
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer --allow-boost -i 3; kill -44 $(pidof zara)") },
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pamixer --allow-boost -d 3; kill -44 $(pidof zara)") },
{ 0, XF86XK_PowerOff, spawn, SHCMD("sysact") },
{ 0, XF86XK_Calculator, spawn, SHCMD("st -e bc -l") },
{ 0, XF86XK_Sleep, spawn, SHCMD("sudo -A zzz") },
{ 0, XF86XK_WWW, spawn, SHCMD("tabbed -c surf -e") },
{ 0, XF86XK_DOS, spawn, SHCMD("st") },
{ 0, XF86XK_ScreenSaver, spawn, SHCMD("$LOCKER") },
{ 0, XF86XK_TaskPane, spawn, SHCMD("st -e gotop") },
{ 0, XF86XK_Mail, spawn, SHCMD("st -e neomutt ; kill -$((34+12)) $(pidof zara)") },
{ 0, XF86XK_MyComputer, spawn, SHCMD("st -e lf") },
{ 0, XF86XK_Launch1, spawn, SHCMD("xset dpms force off") },
{ 0, XF86XK_TouchpadToggle, spawn, SHCMD("(synclient | grep 'TouchpadOff.*1' && synclient TouchpadOff=0) || synclient TouchpadOff=1") },
{ 0, XF86XK_TouchpadOff, spawn, SHCMD("synclient TouchpadOff=1") },
{ 0, XF86XK_TouchpadOn, spawn, SHCMD("synclient TouchpadOff=0") },
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("xbacklight -inc 15") },
{ 0, XF86XK_MonBrightnessDown, spawn, SHCMD("xbacklight -dec 15") },
/* function Keys */
{ MODKEY, XK_F1, spawn, SHCMD("groff -mom \"${READMEFILE:-${XDG_DATA_HOME:-$HOME/.local/share}/help.mom}\" -Tpdf | zathura -") },
{ MODKEY, XK_F3, spawn, SHCMD("displayselect") },
{ MODKEY, XK_F4, spawn, SHCMD("prompt 'Would You Like To Put The Computer To Sleep?' 'sudo -A zzz'") },
{ MODKEY, XK_F7, spawn, SHCMD("td-toggle") },
{ MODKEY, XK_F8, spawn, SHCMD("notify-send '📧 Syncing Mail'; mailsync && notify-send '📧 Mail Synced'; kill -$((34+12)) $(pidof zara)") },
{ MODKEY, XK_F9, spawn, SHCMD("dmenumount") },
{ MODKEY|ShiftMask, XK_F9, spawn, SHCMD("dmenuumount") },
};
/* 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[2]} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
{ 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} },
};