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
|
/*< You can ignore this >*/
#include <X11/keysym.h>
#include "defs.h"
/*
* ——————————————< 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 (float):
* % of the screen the master window
* should take as a decimal value 0-1
*
* 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
*
* ———————————————————————————————————————————*
*/
#define GAPS 10
#define BORDER_WIDTH 5
#define BORDER_FOC_COL "#AAFFFA"
#define BORDER_UFOC_COL "#FF4439"
#define MASTER_WIDTH 0.6
#define MOTION_THROTTLE 144
#define SNAP_DISTANCE 10
/*
* ———————————< 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");
/*< This is your modifier key (MOD/SUPER) >*/
#define MOD ALT
/*
* ———————————————< Bindings >————————————————*
*
* This is where you assign keybinds to
* perform some actions.
*
* How do you bind keys? In sxwm, there is
* two ways to bind keys to perform tasks,
* BIND, or CALL. CALL, calls a function
* whereas BIND, executes a specified
* program.
*
* 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.
*
* ——————————— —————————————————————————————— *
*/
static const Binding binds[] =
{
/*——< MODIFIER(S) >——— < KEY >—————< FUNCTION >——*/
/*——— ——< Here are your functions calls > ———— — */
CALL(MOD|SHIFT, e, quit),
CALL(MOD|SHIFT, q, close_focused),
CALL(MOD, j, focus_next),
CALL(MOD, k, focus_prev),
CALL(MOD|SHIFT, j, move_master_next),
CALL(MOD|SHIFT, k, move_master_prev),
CALL(MOD, equal, inc_gaps),
CALL(MOD, minus, dec_gaps),
CALL(MOD, f, toggle_floating),
CALL(MOD, space, toggle_floating_global),
/*—————< Here are your executable functions >—————*/
BIND(MOD, Return, terminal),
BIND(MOD, b, browser),
};
|