> β οΈ **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
---
## Configuration
`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.
### General Options
| 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.|
---
## Keybindings
### Syntax
```sh
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.
### Available Functions
| 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. |
| `change_wsX` | Switches to workspace `X` (1β9). |
| `moveto_wsX` | Moves current window to workspace `X` (1β9). |
### Example Bindings
```yaml
# Launch terminal
bind : mod + Return : "st"
# Close window
bind : mod + shift + q : close_window
# Switch workspace
bind : mod + 3 : change_ws3
# Move window to workspace
bind : mod + shift + 5 : moveto_ws5
```
---
## Default Keybindings
### Window Management
| 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 |
### Programs
| Combo | Action | Program |
| -------------------- | ---------- | ---------- |
| `MOD` + `Return` | Terminal | `st` |
| `MOD` + `b` | Browser | `firefox` |
| `MOD` + `p` | Launcher | `dmenu_run`|
---
## Dependencies
- `libX11` (Xorg client library)
- `Xinerama`
- GCC or Clang & Make
sudo apt update
sudo apt install libx11-dev libxcursor-dev libxinerama-dev build-essential
sudo pacman -Syy
sudo pacman -S libx11 libxinerama gcc make
sudo emerge --ask x11-libs/libX11 x11-libs/libXinerama sys-devel/gcc sys-devel/make
sudo emaint -a sync
sudo xbps-install -S
sudo xbps-install libX11-devel libXinerama-devel gcc make
sudo dnf update
sudo dnf install libX11-devel libXinerama-devel gcc make
sudo zypper refresh
sudo zypper install libX11-devel libXinerama-devel gcc make
doas apk update
doas apk add libx11-dev libxinerama-dev gcc make musl-dev
buildInputs = [
pkgs.xorg.libX11
pkgs.xorg.libXinerama
pkgs.libgcc
pkgs.gnumake
];
sudo nixos-rebuild switch
slackpkg update
slackpkg install gcc make libX11 libXinerama
# If you use doas or su instead of sudo, modify the following commands accordingly.
sudo pkg update
sudo pkg install gcc gmake libX11 libXinerama
Contributions welcome! Open issues or submit PRs.