Table of Contents
- OXWM
- Installation
- Configuration
- Contributing
- Key Bindings
- Features
- Testing with Xephyr
- Project Structure
- Architecture Notes
- Development Roadmap
- License
OXWM
A dynamic tiling window manager written in Rust, inspired by dwm. Configuration is done in Rust source code, keeping with the suckless philosophy of "edit and recompile."
Installation
Arch Linux
Install dependencies:
sudo pacman -S rust cargo libx11 libxft freetype2 fontconfig pkg-config
Building from Source
git clone https://github.com/tonybanters/oxwm
cd oxwm
cargo build --release
sudo cp target/release/oxwm /usr/local/bin/
Or use the justfile:
just install
Setting up OXWM
Add the following to your ~/.xinitrc:
exec oxwm
Then start X with:
startx
Configuration
OXWM follows the suckless philosophy: configuration is done by editing src/config.rs and recompiling.
On first build, config.rs is automatically created from src/default_config.rs. Your config.rs is gitignored, so you can customize it without worrying about merge conflicts.
To reset your config to defaults:
just reset-config
Edit src/config.rs to customize:
- Keybindings
- Colors and appearance
- Status bar blocks
- Gaps and borders
- Terminal and applications
After making changes:
just install
Then reload OXWM with Alt+Shift+R.
Contributing
When contributing to OXWM:
- Never commit your personal
src/config.rs(it's gitignored) - Only modify
src/default_config.rsif adding new configuration options - Test your changes with
just testusing Xephyr - Document any new features or keybindings
Key Bindings
Default keybindings (customizable in config.rs):
| Binding | Action |
|---|---|
| Alt+Return | Spawn terminal |
| Alt+J/K | Cycle focus down/up |
| Alt+Q | Kill focused window |
| Alt+Shift+Q | Quit WM |
| Alt+Shift+R | Hot reload WM |
| Alt+1-9 | View tag 1-9 |
| Alt+Shift+1-9 | Move window to tag 1-9 |
| Alt+S | Screenshot (maim) |
| Alt+D | dmenu launcher |
| Alt+A | Toggle gaps |
| Alt+Shift+F | Toggle fullscreen |
Features
- Dynamic tiling layout with master/stack
- Tag-based workspaces (9 tags by default)
- Configurable gaps between windows
- Status bar with modular block system
- Battery, RAM, datetime, shell commands
- Custom colors and update intervals
- Click-to-switch tags
- Window focus cycling
- Hot reload without restarting X
- Persistent window tags across restarts
- Mouse hover to focus
- Border indicators for focused windows
- Fullscreen mode
Testing with Xephyr
Test OXWM in a nested X server without affecting your current session:
just test
This starts Xephyr on display :1 and launches OXWM inside it.
Or manually:
Xephyr -screen 1280x800 :1 &
DISPLAY=:1 cargo run
Project Structure
src/
��������� main.rs Entry point
��������� window_manager.rs Core X11 event handling and window management
��������� default_config.rs Default configuration (reference)
��������� config.rs User configuration (gitignored, auto-generated)
��������� bar/
��� ��������� bar.rs Status bar rendering with XFT
��� ��������� font.rs Font handling
��� ��������� blocks/ Modular status bar widgets
��������� keyboard/
��� ��������� handlers.rs Keybinding actions
��� ��������� keycodes.rs X11 keycode constants
��������� layout/
��������� tiling.rs Tiling layout algorithm
Architecture Notes
Tag System
Tags are implemented as bitmasks (TagMask = u32), allowing windows to belong to multiple tags simultaneously. Each window has an associated TagMask stored in a HashMap. Tags persist across WM restarts using X11 properties (_NET_CURRENT_DESKTOP for selected tags, _NET_CLIENT_INFO for per-window tags).
Status Bar
The bar uses a performance-optimized approach with a modular block system:
- Only redraws when invalidated
- Pre-calculates tag widths on creation
- Blocks update independently based on their configured intervals
- Supports custom colors and underline indicators
- Easily extensible - add new block types in src/bar/blocks/
Layout System
The tiling layout divides the screen into a master area (left half) and stack area (right half). The master window occupies the full height of the master area, while stack windows split the stack area vertically. Gaps are configurable and can be toggled at runtime.
Development Roadmap
Current Focus
- Multi-monitor support
- Additional layouts (monocle, floating)
- Master area resizing
- Window swapping in layout
Future Enhancements
- Per-window floating behavior
- Per-program rules (auto-tag assignment, floating rules)
- External bar support (polybar, lemonbar)
- Scratchpad functionality
- Window minimize/restore