-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.h
202 lines (181 loc) Β· 12.2 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
/* See LICENSE file for copyright and license details. */
#define TERMINAL "alacritty" //TODO: Pass In TERMINAL from environment variable $TERMINAL
/* 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 = 1; /* 0 means bottom bar */
static const char *fonts[] = { "Inconsolata-g:size=13", "NotoColorEmoji:pixelsize=13:antialias=true:autohint=true" };
static const char dmenufont[] = "Inconsolata-g:size=13";
static char normbgcolor[] = "#222222";
static char normbordercolor[] = "#444444";
static char normfgcolor[] = "#bbbbbb";
static char selfgcolor[] = "#eeeeee";
static char selbordercolor[] = "#005577";
static char selbgcolor[] = "#005577";
static char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
};
/* 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
*/
/* class instance title tags mask isfloating isterminal noswallow monitor */
{ "Gimp", NULL, NULL, 0, 1, 0, 0, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 },
{ "St", NULL, NULL, 0, 0, 1, 0, -1 },
{ NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
};
/* layout(s) */
static float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static int nmaster = 1; /* number of clients in master area */
static int resizehints = 1; /* 1 means respect size hints in tiled resizals */
#include "horizgrid.c"
static const Layout layouts[] = {
/* symbol arrange function */
{ "[Hg]", horizgrid }, // first entry is default
{ "[T]", tile }, // default tiling mode
};
/* 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} },
#define STACKKEYS(MOD,ACTION) \
{ MOD, XK_d, ACTION##stack, {.i = INC(+1) } }, \
{ MOD, XK_a, ACTION##stack, {.i = INC(-1) } }, \
{ MOD, XK_grave, ACTION##stack, {.i = PREVSEL } }, \
{ MOD, XK_p, ACTION##stack, {.i = 0 } }, \
{ MOD, XK_p, ACTION##stack, {.i = 1 } }, \
{ MOD, XK_p, ACTION##stack, {.i = 2 } }, \
{ MOD, XK_p, ACTION##stack, {.i = -1 } },
/* 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 *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
/*
* Xresources preferences to load at startup
*/
ResourcePref resources[] = {
{ "normbgcolor", STRING, &normbgcolor },
{ "normbordercolor", STRING, &normbordercolor },
{ "normfgcolor", STRING, &normfgcolor },
{ "selbgcolor", STRING, &selbgcolor },
{ "selbordercolor", STRING, &selbordercolor },
{ "selfgcolor", STRING, &selfgcolor },
{ "borderpx", INTEGER, &borderpx },
{ "snap", INTEGER, &snap },
{ "showbar", INTEGER, &showbar },
{ "topbar", INTEGER, &topbar },
{ "nmaster", INTEGER, &nmaster },
{ "resizehints", INTEGER, &resizehints },
{ "mfact", FLOAT, &mfact },
};
/* commands spawned when clicking statusbar, the mouse button pressed is exported as BUTTON */
static const StatusCmd statuscmds[] = {
{ "curl -I http://localhost:1058/eventSection/0/eventButton/$BUTTON", 1 },
{ "curl -I http://localhost:1058/eventSection/1/eventButton/$BUTTON", 2 },
{ "curl -I http://localhost:1058/eventSection/2/eventButton/$BUTTON", 3 },
{ "curl -I http://localhost:1058/eventSection/3/eventButton/$BUTTON", 4 },
{ "curl -I http://localhost:1058/eventSection/4/eventButton/$BUTTON", 5 },
{ "curl -I http://localhost:1058/eventSection/5/eventButton/$BUTTON", 6 },
{ "curl -I http://localhost:1058/eventSection/6/eventButton/$BUTTON", 7 },
{ "curl -I http://localhost:1058/eventSection/7/eventButton/$BUTTON", 8 },
{ "curl -I http://localhost:1058/eventSection/8/eventButton/$BUTTON", 9 },
{ "curl -I http://localhost:1058/eventSection/9/eventButton/$BUTTON", 10 },
};
static const char *statuscmd[] = { "/bin/sh", "-c", NULL, NULL };
static Key keys[] = {
// modifier key function argument
//stacker patch
STACKKEYS(MODKEY|ShiftMask, focus) //TODO: Moves Window Up In Focus, Changes Context To Fullscreen If Master
STACKKEYS(MODKEY, push) //TODO: Moves Window Down In Focus, Hides Window Behind New If Fullscreen
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)
//System Keybindings
{ MODKEY, XK_q, killclient, {0} }, //Kills The Window In Focus
{ MODKEY|ShiftMask, XK_q, quit, {0} }, //Forcefully Exits DWM
{ MODKEY, XK_r, spawn, { .v = dmenucmd } }, //Launch "run" (dMenu)
{ MODKEY, XK_space, zoom, {0} }, //Makes The Focused Window The Master Window
{ MODKEY, XK_Left, tagmon, {.i = +1 } }, //Send Window In Focus To The Left
{ MODKEY, XK_Right, tagmon, {.i = -1 } }, //Send Window In Focus To The Right
{ MODKEY|ShiftMask, XK_Left, focusmon, {.i = +1 } }, //Moves Focus To Left Display
{ MODKEY|ShiftMask, XK_Right, focusmon, {.i = -1 } }, //Moves Focus To Right Display
{ MODKEY|ControlMask|ShiftMask, XK_Left, setmfact, {.f = -0.01} }, //Moves The Window Devider To The Left
{ MODKEY|ControlMask|ShiftMask, XK_Right, setmfact, {.f = +0.01} }, //Moves The Window Devider To The Right
{ MODKEY|Mod1Mask, XK_f, togglefloating, {0} }, //Toggles Floating For The Focused Window
{ MODKEY, XK_p, togglebar, {0} }, //Toggles DWM Status Bar
// { MODKEY, XK_space, setlayout, {0} }, //Change To The Priviously Used Layout
// { MODKEY, XK_f, setfullscreen, {0} }, //Toggle Fullscreen Mode
// { MODKEY|ShiftMask, XK_c, spawn, SHCMD("") }, //Copy
// { MODKEY|ShiftMask, XK_x, spawn, SHCMD("") }, //Cut
// { MODKEY|ShiftMask, XK_v, spawn, SHCMD("") }, //Paste
// { MODKEY, XK_Tab, {0}, {0} }, //List Active Programs in Tag Tab
// { MODKEY, XK_h, {0}, {0} }, //Shows Desktop/Hides All Applications
//Audio
{ MODKEY, XK_m, spawn, SHCMD("pamixer -t") }, //Mute Audio
{ MODKEY, XK_period, spawn, SHCMD("pamixer --allow-boost -i 3") }, //Increase Audio Volume
{ MODKEY, XK_comma, spawn, SHCMD("pamixer --allow-boost -d 3") }, //Decrease Audio Volume
{ MODKEY, XK_F12, spawn, SHCMD("for i in {1..$(mpc outputs | wc -l)}; do mpc toggleoutput $i; done") }, //Mute Music
{ MODKEY, XK_F11, spawn, SHCMD("mpc volume +1") }, //Increase Music Volume
{ MODKEY, XK_F10, spawn, SHCMD("mpc volume -1") }, //Decrease Music Volume
{ MODKEY, XK_F9, spawn, SHCMD("mpc shuffle") }, //Shuffle Playlist
{ MODKEY|ShiftMask, XK_F9, spawn, SHCMD("mpc repeat") }, //Toggle MPC Repeat Mode
{ MODKEY, XK_F8, spawn, SHCMD("mpc next") }, //Play Next Song
{ MODKEY, XK_F7, spawn, SHCMD("mpc toggle") }, //Play/Pause Music
{ MODKEY, XK_F6, spawn, SHCMD("mpc prev") }, //Play Previous Song
{ MODKEY, XK_F5, spawn, SHCMD("mpc stop") }, //Stop Music
//Screen Capture
{ MODKEY, XK_Print, spawn, SHCMD("flameshot gui") }, //Launch FlameShot (ScreenShot tool)
{ MODKEY, XK_s, spawn, SHCMD("flameshot gui") }, //Launch FlameShot (ScreenShot tool)
{ MODKEY|ShiftMask, XK_Print, spawn, SHCMD("peek") }, //Launch Peek (Video Capture tool)
{ MODKEY|ShiftMask, XK_s, spawn, SHCMD("peek") }, //Launch Peek (Video Capture tool)
//Application Keybindings
{ MODKEY, XK_t, spawn, SHCMD(TERMINAL) }, //Open Terminal
{ MODKEY|Mod1Mask, XK_t, spawn, SHCMD("st") }, //Open Alternate Terminal
{ MODKEY, XK_w, spawn, SHCMD("librewolf") }, //Open Web Browser
{ MODKEY|Mod1Mask, XK_w, spawn, SHCMD("brave") }, //Open Alternate Web Browser
{ MODKEY|ControlMask, XK_w, spawn, SHCMD("firefox-esr") }, //Open Secondary Web Browser
{ MODKEY|ShiftMask, XK_w, spawn, SHCMD("tor-browser") }, //Open Tor
{ MODKEY, XK_h, spawn, SHCMD(TERMINAL " -e htop") }, //Open htop
{ MODKEY, XK_g, spawn, SHCMD("steam") }, //Launch Games (Steam)
{ MODKEY, XK_o, spawn, SHCMD("obs") }, //Launch OBS
{ MODKEY|ShiftMask, XK_o, spawn, SHCMD("olive") }, //Launch Olive (Video Editor)
{ MODKEY, XK_c, spawn, SHCMD("codium") }, //Open VS Code
{ MODKEY|Mod1Mask, XK_c, spawn, SHCMD(TERMINAL " -e bc -l") }, //Open Calculator
{ MODKEY|ShiftMask, XK_f, spawn, SHCMD(TERMINAL " -e mc") }, //Open File Manager
};
/* 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} },
{ ClkStatusText, 0, Button1, spawn, {.v = statuscmd } },
{ ClkStatusText, 0, Button2, spawn, {.v = statuscmd } },
{ ClkStatusText, 0, Button3, spawn, {.v = statuscmd } },
{ 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} },
};