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
|
/* See LICENSE for more information on use */
/*
* ——————————————< Appearance >—————————————— *
*
* In this section you can configure the
* settings for sxwm. You can ignore the
* #define as it is C specific syntax
*
* GAPS (px):
* How many pixels between windows and
* screen edges (including bar)
* BORDER_WIDTH (px):
* How thick your border is
*
* BORDER_FOC_COL (hex):
* The colour of your border when the
* window is focused
*
* BORDER_UFOC_COL (hex):
* The colour of your border when the
* window is unfocused
*
* MASTER_WIDTH (int):
* % of the screen the master window
* should take
*
* RESIZE_MASTER_AMT (%):
* % of the master width you want to
* increment by
*
* MOTION_THROTTLE (int):
* Usually you should set this to your
* screen refreshrate. This is set so
* there is no exessive number of
* requests being sent to the X server
*
* SNAP_DISTANCE (px):
* How many pixels away from the screen
* until the window *snaps* to the edge
*
* NUM_WORKSPACES (int):
* This is how many workspaces you want in
* this window manager. Best to leave it
* default (9).
*
* WORKSPACE_NAMES (char[]):
* This is just the label that will appear
* on your status bar. Doesn't have to be
* a number, it can be anything. Ignore
* the "\0", this is just a NULL that says
* to start again, otherwise it would be
* all of them concatenated together.
*
* ———————————————————————————————————————————*
*/
#define NUM_WORKSPACES 9
#define WORKSPACE_NAMES \
"1" "\0"\
"2" "\0"\
"3" "\0"\
"4" "\0"\
"5" "\0"\
"6" "\0"\
"7" "\0"\
"8" "\0"\
"9" "\0"\
/*
* ————————————< Keys & Bindins >—————————————*
*
* This is where you set your keybinds to
* execute apps. You can use the CMD macro
* to make new variables.
*
* How do you make a command to run an app
* It's simple! Just do this:
*
* CALL(appcallname, "app", "arg2", ...);
*
* What is appcallname? This is just the
* variable name given to this string of
* commands given to execvp, the function
* that executes these programs.
*
* ———————————————————————————————————————————*
*
*/
CMD(terminal, "st");
CMD(browser, "firefox");
/*
* ———————————————< Bindings >————————————————*
*
* This is where you assign keybinds to
* perform some actions.
*
* How do you bind keys? In sxwm, there is
* three ways to bind keys to perform
* tasks:
*
* BIND, CALL or WORKSPACE.
* CALL, calls a function,
* BIND, executes a specified
* program.
* WORKSPACE, sets the bind to move
* and item to said workspace or to
* change to that workspace.
*
* USEAGE:
* BIND(MODIFIERS, KEY, FUNCTION)
*
* MODIFIERS:
* The mod keys you want held down
* for the task to execute. I have
* also defined SHIFT as a substitute
* for ShiftMask.
*
* KEY:
* The key to press in combination
* with the MODIFERS to run the task.
*
* FUNCTION:
* The task to execute. Depending on
* whether you're calling CALL or
* BIND, this will execute a program
* or call a function.
*
* If you're
* calling a function, just put the
* name of the funtion.
*
* Otherwise, put the program you
* either defined with the CMD above
* or you can skip that step and just
* do something like this to create a
* "string" in the bindings array:
*
* { "program", "arg1", NULL }
*
* End the line with a comma, as this is
* an array.
*
* ———————————————————————————————————————————*
*/
/*< This is your modifier key (ALT/SUPER) >*/
#include <X11/keysym.h>
const Binding binds[] =
{
/*————< Mod4MaskIFIER(S) >< KEY >—————< FUNCTION >——*/
/*———————< Here are your functions calls >————— — */
CALL(Mod4Mask|SHIFT, e, quit),
CALL(Mod4Mask|SHIFT, q, close_focused),
CALL(Mod4Mask, j, focus_next),
CALL(Mod4Mask, k, focus_prev),
CALL(Mod4Mask|SHIFT, j, move_master_next),
CALL(Mod4Mask|SHIFT, k, move_master_prev),
CALL(Mod4Mask, l, resize_master_add),
CALL(Mod4Mask, h, resize_master_sub),
CALL(Mod4Mask, equal, inc_gaps),
CALL(Mod4Mask, minus, dec_gaps),
CALL(Mod4Mask, space, toggle_floating),
CALL(Mod4Mask|SHIFT, space, toggle_floating_global),
CALL(Mod4Mask|SHIFT, f, toggle_fullscreen),
/*—————< Here are your executable functions >—————*/
BIND(Mod4Mask, Return, terminal),
BIND(Mod4Mask, b, browser),
/*—————< This is for workspaces >—————————————————*/
CALL(Mod4Mask, 1, change_ws1),
CALL(Mod4Mask|SHIFT, 1, moveto_ws1),
CALL(Mod4Mask, 2, change_ws2),
CALL(Mod4Mask|SHIFT, 2, moveto_ws2),
CALL(Mod4Mask, 3, change_ws3),
CALL(Mod4Mask|SHIFT, 3, moveto_ws3),
CALL(Mod4Mask, 4, change_ws4),
CALL(Mod4Mask|SHIFT, 4, moveto_ws4),
CALL(Mod4Mask, 5, change_ws5),
CALL(Mod4Mask|SHIFT, 5, moveto_ws5),
CALL(Mod4Mask, 6, change_ws6),
CALL(Mod4Mask|SHIFT, 6, moveto_ws6),
CALL(Mod4Mask, 7, change_ws7),
CALL(Mod4Mask|SHIFT, 7, moveto_ws7),
CALL(Mod4Mask, 8, change_ws8),
CALL(Mod4Mask|SHIFT, 8, moveto_ws8),
CALL(Mod4Mask, 9, change_ws9),
CALL(Mod4Mask|SHIFT, 9, moveto_ws9),
};
|