β οΈ Note: I wonβt be updating this project for a month or so due to exams.
Issues & PRs are welcome, just don't expect a quick response π₯π₯ 24/05/25: I have very little time but I am able to develop some features Thank you to the wonderful people who have sumbitted fixes and other PR's
- Features
- Screenshots
- Configuration
- Keybindings
- Dependencies
- Build & Install
- Makefile Targets
- Thanks & Inspiration
- Tiling & Floating: Switch seamlessly between layouts.
- Workspaces: 9 workspaces, fully integrated with your bar.
- Live Config Reload: Change your config and reload instantly with a keybind.
- Easy Configuration: Human-friendly
sxwmrcfile, no C required. - Master-Stack Layout: DWM-inspired productive workflow.
- Mouse Support: Move, swap, resize, and focus windows with the mouse.
- Zero Dependencies: Only
libX11andXineramarequired. - Lightweight: Single C file, minimal headers, compiles in seconds.
- Bar Friendly: Works great with sxbar.
- Xinerama Support: Multi-monitor ready.
- Fast: Designed for speed and low resource usage.
See on the website
sxwm is configured via a simple text file located at ~/.config/sxwmrc. Changes can be applied instantly by reloading the configuration (MOD + r).
The file uses a key : value format. Lines starting with # are ignored.
| Option | Type | Default | Description |
|---|---|---|---|
mod_key |
String | super |
Sets the primary modifier key (alt, super, ctrl). |
gaps |
Integer | 10 |
Pixels between windows and screen edges. |
border_width |
Integer | 1 |
Thickness of window borders in pixels. |
focused_border_colour |
Hex | #c0cbff |
Border color for the currently focused window. |
unfocused_border_colour |
Hex | #555555 |
Border color for unfocused windows. |
swap_border_colour |
Hex | #fff4c0 |
Border color when selecting a window to swap (MOD+Shift+Drag). |
master_width |
Integer | 60 |
Percentage of the screen width for the master window. |
resize_master_amount |
Integer | 1 |
Percent to increase/decrease master width. |
snap_distance |
Integer | 5 |
Distance (px) before a floating window snaps to edge. |
motion_throttle |
Integer | 60 |
Target FPS for mouse drag actions. |
should_float |
String | "st" |
Always-float rule. Multiple entries should be comma-seperated. Optionally, entries can be enclosed in quotes. |
new_win_focus |
Bool | true |
Whether openening new windows should also set focus to them or keep on current window. |
bind : modifier + modifier + ... + key : action- Modifiers:
mod,shift,ctrl,alt,super - Key: Case-insensitive keysym (e.g.,
Return,q,1) - Action: Either an external command (in quotes) or internal function.
workspace : modifier + modifier + ... + key : move n
workspace : modifier + modifier + ... + key : swap n- Modifiers:
mod,shift,ctrl,alt,super - Key: Case-insensitive keysym (e.g.,
Return,q,1) - move: Move to that worspace
- swap: Swap window to that workspace
- n: Workspace number
| Function Name | Description |
|---|---|
close_window |
Closes the focused window. |
decrease_gaps |
Shrinks gaps. |
focus_next |
Moves focus forward in the stack. |
focus_previous |
Moves focus backward in the stack. |
increase_gaps |
Expands gaps. |
master_next |
Moves focused window down in master/stack order. |
master_previous |
Moves focused window up in master/stack order. |
quit |
Exits sxwm. |
reload_config |
Reloads config. |
master_increase |
Expands master width. |
master_decrease |
Shrinks master width. |
toggle_floating |
Toggles floating state of current window. |
global_floating |
Toggles floating state for all windows. |
fullscreen |
Fullscreen toggle. |
# Launch terminal
bind : mod + Return : "st"
# Close window
bind : mod + shift + q : close_window
# Switch workspace
workspace : mod + 3 : move 3
# Move window to workspace
workspace : mod + shift + 5 : swap 5| Combo | Action |
|---|---|
| Mouse | Focus under cursor |
MOD + Left Mouse |
Move window by mouse |
MOD + Right Mouse |
Resize window by mouse |
MOD + j / k |
Focus next / previous |
MOD + Shift + j / k |
Move in master stack |
MOD + Space |
Toggle floating |
MOD + Shift + Space |
Toggle all floating |
MOD + = / - |
Increase/Decrease gaps |
MOD + f |
Fullscreen toggle |
MOD + q |
Close focused window |
MOD + 1-9 |
Switch workspace 1β9 |
MOD + Shift + 1-9 |
Move window to WS 1β9 |
| Combo | Action | Program |
|---|---|---|
MOD + Return |
Terminal | st |
MOD + b |
Browser | firefox |
MOD + p |
Launcher | dmenu_run |
libX11(Xorg client library)XineramaXCursor- GCC or Clang & Make
Debian / Ubuntu / Linux Mint
sudo apt update
sudo apt install libx11-dev libxcursor-dev libxinerama-dev build-essentialArch Linux / Manjaro
sudo pacman -Syy
sudo pacman -S libx11 libxinerama gcc makeGentoo
sudo emerge --ask x11-libs/libX11 x11-libs/libXinerama sys-devel/gcc sys-devel/make
sudo emaint -a sync
Void Linux
sudo xbps-install -S
sudo xbps-install libX11-devel libXinerama-devel gcc makeFedora / RHEL / AlmaLinux / Rocky
sudo dnf update
sudo dnf install libX11-devel libXinerama-devel gcc makeOpenSUSE (Leap / Tumbleweed)
sudo zypper refresh
sudo zypper install libX11-devel libXinerama-devel gcc makeAlpine Linux
doas apk update
doas apk add libx11-dev libxinerama-dev gcc make musl-devNixOS
buildInputs = [
pkgs.xorg.libX11
pkgs.xorg.libXinerama
pkgs.libgcc
pkgs.gnumake
];
sudo nixos-rebuild switch
Slackware
slackpkg update
slackpkg install gcc make libX11 libXineramaOpenBSD
doas pkg_add gmakexbase, xfonts, xserv and xshare) installed.
When you make the code, use gmake instead of make (which will be BSD make). Use the following command to build: gmake CFLAGS="-I/usr/X11R6/include -Wall -Wextra -O3 -Isrc" LDFLAGS="-L/usr/X11R6/lib -lX11 -lXinerama -lXcursor"
FreeBSD
# If you use doas or su instead of sudo, modify the following commands accordingly.
sudo pkg update
sudo pkg install gcc gmake libX11 libXineramayay -S sxwm
# OR for latest features:
yay -S sxwm-gitgit clone --depth=1 https://github.com/uint23/sxwm.git
cd sxwm/
# Replace make with gmake on FreeBSD
make
sudo make clean installAdd to your ~/.xinitrc:
exec sxwm| Target | Description |
|---|---|
make / make all |
Build the sxwm binary |
make clean |
Remove build artifacts |
make install |
Install sxwm to $(PREFIX)/bin (default /usr/local) |
make uninstall |
Remove installed binary |
make clean install |
Clean then install |
Override install directory with
PREFIX:make install PREFIX=$HOME/.local
- dwm β Tiling & source code
- i3 β Easy configuration
- sowm β README inspiration
- tinywm β Minimal X11 WM
Contributions welcome! Open issues or submit PRs.