tony / oxwm

a window manager for x11

Branch: 9ecd575
Switch branches/tags
master
Go to file New pull request
Clone
Clone with HTTPS
tonybtw Updated readme. Latest commit 9ecd575 2025-10-09
src Updated justfile and config.rs -> default_config.rs 2025-10-09
.envrc add envrc 2025-09-24
.gitignore Updated justfile and config.rs -> default_config.rs 2025-10-09
Cargo.lock Added blocks... lol 2025-10-04
Cargo.toml Added blocks... lol 2025-10-04
flake.lock Initial commit. 2025-09-19
flake.nix unset `PKG_CONFIG_PATH` env var 2025-10-07
justfile Updated justfile and config.rs -> default_config.rs 2025-10-09
LICENSE Create LICENSE 2025-10-03
readme.org Updated readme. 2025-10-09

readme.org

Table of Contents

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:

  1. Never commit your personal src/config.rs (it's gitignored)
  2. Only modify src/default_config.rs if adding new configuration options
  3. Test your changes with just test using Xephyr
  4. Document any new features or keybindings

Key Bindings

Default keybindings (customizable in config.rs):

BindingAction
Alt+ReturnSpawn terminal
Alt+J/KCycle focus down/up
Alt+QKill focused window
Alt+Shift+QQuit WM
Alt+Shift+RHot reload WM
Alt+1-9View tag 1-9
Alt+Shift+1-9Move window to tag 1-9
Alt+SScreenshot (maim)
Alt+Ddmenu launcher
Alt+AToggle gaps
Alt+Shift+FToggle 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

License

GPL v3