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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
|
.TH sxwm 1 "June 2025" "sxwm 1.6" "User Commands"
.SH NAME
sxwm \- minimal, fast, and configurable tiling window manager for X11
.SH SYNOPSIS
.B sxwm
[\fIOPTION\fR]
.SH DESCRIPTION
sxwm is a lightweight and efficient tiling window manager for X11, designed to be fast, minimal, and easy to configure. It supports workspaces, floating windows, mouse operations, and dynamic configuration reloading.
.SH FEATURES
Tiling and floating layouts.
Nine workspaces with full bar support.
Scratchpads for instant access to floating windows.
Native windwo swallowing.
Live configuration reload without restart.
Human-friendly configuration file requiring no recompilation.
DWM-style master-stack layout.
Mouse support for moving, resizing, and swapping windows.
Depends only on libX11, Xinerama, and XCursor.
Extremely lightweight (single C file).
Multi-monitor support via Xinerama.
Works well with external bars such as sxbar.
Zero dependencies beyond X11 libraries.
Fast and low resource usage.
.SH LAUNCH ARGUMENTS
.TP
.B \-v, \-\-version
Displays current sxwm version
.TP
.B \-b, \-\-backup
Uses default config along side the custom sxwmrc
.SH CONFIGURATION
The configuration file is located at
.B ~/.config/sxwmrc
It uses a simple key : value format. Lines starting with `#` are treated as comments.
General options include:
.TP
.B mod_key
Sets the primary modifier key ("alt", "super", or "ctrl"). Default is "super".
.TP
.B gaps
Pixels between windows and screen edges. Default is 10.
.TP
.B border_width
Thickness of window borders in pixels. Default is 1.
.TP
.B focused_border_colour
Border color for the focused window. Default is "#c0cbff".
.TP
.B unfocused_border_colour
Border color for unfocused windows. Default is "#555555".
.TP
.B swap_border_colour
Border color highlight when selecting a window to swap with. Default is "#fff4c0".
.TP
.B master_width
Percentage of screen width allocated to the master window. Default is 60.
.TP
.B resize_master_amount
Percentage to increase or decrease master width when resizing. Default is 1.
.TP
.B resize_stack_amount
How many pixels to increase/decrease stack windows by. Default is 20.
.TP
.B snap_distance
Pixels from screen edge before a floating window snaps to the edge. Default is 5.
.TP
.B motion_throttle
Target updates per second for mouse drag operations (move, resize, swap). Default is 60.
.TP
.B should_float
Lets you change which windows should float by default when opening them. Multiple entries should be comma-separated. Optionally, entries can be enclosed in quotes. Default is "pcmanfm", "obs".
.TP
.B start_fullscreen
Lets you specify which windows should start in fullscreen mode. Multiple entries should be comma-separated. Optionally, entries can be enclosed in quotes. Default is "mpv", "vlc".
.TP
.B new_win_focus
Whether newly opened windows should automatically gain focus. Default is true.
.TP
.B warp_cursor
If true, warps the mouse cursor to the center of newly focused windows. Default is true.
.TP
.B exec
Command to run on startup (e.g., "sxbar", "picom", "autostart", etc.).
.TP
.B can_swallow
Windows that can swallow other windows. Default is "st".
.TP
.B can_be_swallowed
Windows that can be swallowed by others. Default is "mpv".
.TP
.B new_win_as_master
New windows will take place as the master window
.SH KEYBINDINGS
Keybindings associate key combinations with actions, either running external commands or internal sxwm functions.
They follow this syntax:
.TP
.B bind : modifier + ... + key : action
Modifiers can be mod, shift, ctrl, alt, or super. The key is the final key name (e.g., Return, q, 1, equal, space).
Actions can be either a quoted external command or an internal function name.
.TP
.B workspace : modifier + ... + key : move n
.TP
.B workspace : modifier + ... + key : swap n
For workspace switching and moving windows. n is the workspace number (1-9).
.TP
.B scratchpad : modifier + ... + key : create n
.TP
.B scratchpad : modifier + ... + key : toggle n
.TP
.B scratchpad : modifier + ... + key : remove n
For scratchpad management. create assigns the focused window to scratchpad n, toggle shows/hides scratchpad n, and remove returns the scratchpad window to normal tiling. n is the scratchpad number (1-5).
Example bindings:
.TP
.B bind : mod + Return : "st"
Open the st terminal.
.TP
.B bind : mod + shift + q : close_window
Close any window that is selected.
.TP
.B workspace : mod + 3 : move 3
Go to workspace 3.
.TP
.B workspace : mod + shift + 5 : swap 5
Move selected window to workspace 5.
.TP
.B scratchpad : mod + alt + 1 : create 1
Assign focused window to scratchpad 1.
.TP
.B scratchpad : mod + ctrl + 1 : toggle 1
Show or hide scratchpad 1.
.TP
.B scratchpad : mod + alt + shift + 1 : remove 1
Remove window from scratchpad 1 and return to normal tiling.
.SH AVAILABLE FUNCTIONS
The following internal functions are available for keybindings:
.TP
.B close_window
Closes the currently focused window.
.TP
.B centre_window
Centers the focused window.
.TP
.B decrease_gaps
Decreases the gap size between windows.
.TP
.B focus_next
Shifts focus to the next window in the stack.
.TP
.B focus_previous
Shifts focus to the previous window in the stack.
.TP
.B focus_next_mon
Switches focus to the next monitor.
.TP
.B focus_prev_mon
Switches focus to the previous monitor.
.TP
.B move_next_mon
Moves the focused window to the next monitor.
.TP
.B move_prev_mon
Moves the focused window to the previous monitor.
.TP
.B increase_gaps
Increases the gap size between windows.
.TP
.B master_next
Moves the focused window down the master/stack order.
.TP
.B master_prev
Moves the focused window up the master/stack order.
.TP
.B quit
Exits sxwm.
.TP
.B reload_config
Reloads the sxwmrc configuration file.
.TP
.B master_increase
Increases the width allocated to the master area.
.TP
.B master_decrease
Decreases the width allocated to the master area.
.TP
.B stack_increase
Increases the height of stack window.
.TP
.B stack_decrease
Decreases the height of stack window.
.TP
.B toggle_floating
Toggles the floating state of the focused window.
.TP
.B global_floating
Toggles the floating state for all windows on the current workspace.
.TP
.B fullscreen
Toggles fullscreen mode for the focused window.
.TP
.B focus_next_mon
Switches focus to the next monitor.
.TP
.B focus_prev_mon
Switches focus to the previous monitor.
.TP
.B move_next_mon
Moves the focused window to the next monitor.
.TP
.B move_prev_mon
Moves the focused window to the previous monitor.
.TP
.B change_ws1 ... change_ws9
Switches focus to the specified workspace (1 to 9).
.TP
.B moveto_ws1 ... moveto_ws9
Moves the focused window to the specified workspace (1 to 9).
.SH DEFAULT KEYBINDINGS
Window Management:
.TP
.B Mouse Click
Focus window under cursor.
.TP
.B MOD + Left Mouse
Move window with mouse.
.TP
.B MOD + Right Mouse
Resize window with mouse.
.TP
.B MOD + Return
Launch terminal (default: st).
.TP
.B MOD + b
Launch browser (default: firefox).
.TP
.B MOD + p
Run launcher (default: dmenu_run).
.TP
.B MOD + Shift + q
Close focused window.
.TP
.B MOD + Shift + e
Quit sxwm.
.TP
.B MOD + r
Reload configuration.
.TP
.B MOD + c
Center focused window.
.TP
.B MOD + 1 to 9
Switch to workspace 1 through 9.
.TP
.B MOD + Shift + 1 to 9
Move focused window to workspace 1 through 9.
.TP
.B MOD + Alt + 1 to 4
Create scratchpad 1 through 4.
.TP
.B MOD + Ctrl + 1 to 4
Toggle scratchpad 1 through 4.
.TP
.B MOD + Alt + Shift + 1 to 4
Remove scratchpad 1 through 4.
.TP
.B MOD + j / k
Focus next or previous window.
.TP
.B MOD + Shift + j / k
Move window up or down in the master stack.
.TP
.B MOD + h / l
Resize master area (decrease/increase).
.TP
.B MOD + Ctrl + h / l
Resize stack area (decrease/increase).
.TP
.B MOD + Space
Toggle floating mode for focused window.
.TP
.B MOD + Shift + Space
Toggle floating mode for all windows.
.TP
.B MOD + = / -
Increase or decrease gaps.
.TP
.B MOD + Shift + f
Toggle fullscreen mode.
.TP
.B MOD + . / ,
Focus next/previous monitor.
.TP
.B MOD + Shift + . / ,
Move focused window to next/previous monitor.
.SH DEPENDENCIES
sxwm requires the following libraries:
.TP
.B libX11
Xorg client library
.TP
.B libXinerama
Multi-monitor support
.TP
.B libXcursor
Cursor support
.TP
.B GCC or Clang & Make
For building from source
.SH FILES
Configuration file:
.B ~/.config/sxwmrc
.SH EXAMPLES
Example configuration snippets:
.RS
.nf
# Set gaps and borders
gaps : 15
border_width : 2
focused_border_colour : "#ff6b6b"
# Custom keybindings
bind : mod + Return : "alacritty"
bind : mod + d : "rofi -show drun"
# Workspace switching
workspace : mod + 1 : move 1
workspace : mod + shift + 1 : swap 1
# Scratchpad management
scratchpad : mod + alt + 1 : create 1
scratchpad : mod + ctrl + 1 : toggle 1
scratchpad : mod + alt + shift + 1 : remove 1
# Window swallowing
can_swallow : "st"
can_be_swallowed : "sxiv", "mpv", "zathura"
.fi
.RE
.SH AUTHOR
Written by Abhinav Prasai (uint23), 2025.
.SH SEE ALSO
sxbar(1), dmenu(1), st(1), X(7)
.SH LICENSE
MIT License. See the LICENSE file for full details.
.SH BUGS
Report bugs at: https://github.com/uint23/sxwm/issues
.SH INSPIRATION
sxwm draws inspiration from dwm, i3, sowm, and tinywm.
|