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
|
/* See LICENSE file for copyright and license details. */
#include <X11/XF86keysym.h>
/* appearance */
static const unsigned int borderpx = 0;
static const unsigned int gappx = 10;
static const unsigned int snap = 0;
static const int showbar = 1;
static const int topbar = 1;
static const char statussep = ';'; /* separator between status bars */
/* no bar padding */
static const int vertpad = 0;
static const int sidepad = 0;
/* fonts */
static const char *fonts[] = {"Comic Mono:style=Regular:size=12"};
static const char dmenufont[] = "Comic Mono:size=12";
/* nasr theme — warm amber/rust/sepia on dark */
static const char hh_back[] = "#0D1117";
static const char hh_text[] = "#C4A882";
static const char hh_comment[] = "#6B5A45";
static const char hh_keyword[] = "#D48B30";
static const char hh_cursor[] = "#F0A030";
static const char hh_border[] = "#1F1610";
static const char hh_highlight[] = "#3D2B1A";
/* --- The Scheme Array --- */
static const char *colors[][3] = {
/* fg bg border */
/* Normal: Tan text on dark charcoal bar */
[SchemeNorm] = { hh_text, hh_back, hh_border },
/* Selected: Green text on Highlight background */
[SchemeSel] = { hh_cursor, hh_highlight, hh_keyword },
};
/* tags */
static const char *tags[] = {" code", "terminal", "browser", "IDE", "+ "};
/* rules */
static const Rule rules[] = {
/* class instance title tags mask isfloating monitor */
// {"neovide", NULL, NULL, 1 << 0, 0, -1},
{"org.mozzila.firefox", NULL, NULL, 1 << 2, 0, -1},
{"Mozilla Firefox", NULL, NULL, 1 << 2, 0, -1},
{"Navigator", NULL, NULL, 1 << 2, 0, -1},
{"jetbrains-clion", NULL, NULL, 1 << 3, 0, -1},
{"jetbrains-goland", NULL, NULL, 1 << 3, 0, -1},
};
/* layout */
static const float mfact = 0.55;
static const int nmaster = 1;
static const int lockfullscreen = 1;
static const int resizehints = 0;
static const int refreshrate = 60;
static const Layout layouts[] = {
{"[]=", tile},
{"><>", NULL},
{"[M]", monocle},
};
/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY, TAG) \
{MODKEY, KEY, view, {.ui = 1 << TAG}}, \
{MODKEY | ShiftMask, KEY, tag, {.ui = 1 << TAG}}, \
{MODKEY | ControlMask, KEY, toggleview, {.ui = 1 << TAG}}, \
{MODKEY | ControlMask | ShiftMask, KEY, toggletag, {.ui = 1 << TAG}},
#define SHCMD(cmd) \
{ \
.v = (const char *[]) { "/bin/sh", "-c", cmd, NULL } \
}
/* commands */
static char dmenumon[2] = "0";
static const char *dmenucmd[] = {
"dmenu_run", "-vi", "-m", dmenumon,
"-fn", dmenufont, "-nb", hh_back, /* normal background */
"-nf", hh_text, /* normal foreground */
"-sb", hh_highlight, /* selected background */
"-sf", hh_cursor, /* selected foreground */
NULL};
static const char *termcmd[] = {"st", NULL};
static const char *ghostty[] = {"ghostty", NULL};
static const char *neovide[] = {"neovide", NULL};
static const char *emacs[] = {"emacs", NULL};
static const char *browser[] = {"firefox", NULL};
static const char *discord[] = {"discord", NULL};
static const char *lock[] = {"slock", NULL };
static const char *mail[] = {"thunderbird", NULL };
/* Volumes */
static const char *vol_up[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%", NULL };
static const char *vol_down[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%", NULL };
static const char *vol_mute[] = { "pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL };
/* Screenshots */
// - removed, looking for a single binary screenshot tool. scrot is shit
static const char *scrot_full[] = { "scrot", "%Y-%m-%d-%H%M%S.png", "-e",
"mv $f ~/Pictures/Screenshots/ && xclip -selection clipboard -t image/png -i ~/Pictures/Screenshots/$f", NULL };
static const char *scrot_select[] = { "scrot", "-s", "%Y-%m-%d-%H%M%S.png", "-e",
"mv $f ~/Pictures/Screenshots/ && xclip -selection clipboard -t image/png -i ~/Pictures/Screenshots/$f", NULL };
static const char *scrot_window[] = { "scrot", "-u", "%Y-%m-%d-%H%M%S.png", "-e",
"mv $f ~/Pictures/Screenshots/ && xclip -selection clipboard -t image/png -i ~/Pictures/Screenshots/$f", NULL };
/* keys */
static const Key keys[] = {
/* launch */
{MODKEY, XK_Return, spawn, {.v = termcmd}},
{MODKEY, XK_n, spawn, {.v = neovide}},
{MODKEY, XK_b, spawn, {.v = browser}},
{MODKEY, XK_p, spawn, {.v = dmenucmd}},
{MODKEY, XK_g, spawn, {.v = ghostty}},
{MODKEY, XK_d, spawn, {.v = discord}},
{MODKEY, XK_e, spawn, {.v = emacs}},
{MODKEY|ShiftMask, XK_l, spawn, {.v = lock}},
{MODKEY|ShiftMask, XK_m, spawn, {.v = mail}},
/* lock screen */
{MODKEY|ShiftMask, XK_l, spawn, {.v = lock }},
/* screenshot bindings */
{ MODKEY|ShiftMask, XK_s, spawn, {.v = scrot_full } }, /* Mod + Shift + s = Entire Screen */
{ MODKEY, XK_s, spawn, {.v = scrot_select } }, /* Mod + s = Select Area */
{ MODKEY|ControlMask, XK_s, spawn, {.v = scrot_window } }, /* Mod + Ctrl + s = Active Window */
/* focus */
{MODKEY, XK_j, focusstack, {.i = +1}},
{MODKEY, XK_k, focusstack, {.i = -1}},
/* master */
{MODKEY, XK_i, incnmaster, {.i = +1}},
{MODKEY, XK_o, incnmaster, {.i = -1}},
/* resize */
{MODKEY, XK_h, setmfact, {.f = -0.05}},
{MODKEY, XK_l, setmfact, {.f = +0.05}},
{ MODKEY, XK_F12, spawn, {.v = vol_up } },
{ MODKEY, XK_F11, spawn, {.v = vol_down } },
{ MODKEY, XK_F10, spawn, {.v = vol_mute } },
/* layout */
{MODKEY, XK_t, setlayout, {.v = &layouts[0]}},
{MODKEY, XK_f, setlayout, {.v = &layouts[1]}},
{MODKEY, XK_m, setlayout, {.v = &layouts[2]}},
{MODKEY, XK_space, setlayout, {0}},
{MODKEY | ShiftMask, XK_space, togglefloating, {0}},
/* gaps */
{MODKEY, XK_minus, setgaps, {.i = -5}},
{MODKEY, XK_equal, setgaps, {.i = +5}},
{MODKEY | ShiftMask, XK_equal, setgaps, {.i = 0}},
/* misc */
{MODKEY, XK_Tab, view, {0}},
{MODKEY, XK_q, killclient, {0}},
{MODKEY | ShiftMask, XK_Return, zoom, {0}},
/* tags */
TAGKEYS(XK_1, 0) TAGKEYS(XK_2, 1) TAGKEYS(XK_3, 2) TAGKEYS(XK_4, 3)
TAGKEYS(XK_5, 4)
/* quit */
{MODKEY | ShiftMask, XK_q, quit, {0}},
};
/* mouse buttons */
static const Button buttons[] = {
{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}},
};
|