tony / oxwm

Branch: 9ecd575
Switch branches/tags
master
tonybtw Updated readme. 9ecd575 2025-10-09
181 lines · 5.6 KB Rendered Raw Blame History
1 #+AUTHOR: Tony
2 #+STARTUP: overview
3
4 * Table of Contents :toc:
5 - [[#oxwm][OXWM]]
6 - [[#installation][Installation]]
7 - [[#arch-linux][Arch Linux]]
8 - [[#building-from-source][Building from Source]]
9 - [[#setting-up-oxwm][Setting up OXWM]]
10 - [[#configuration][Configuration]]
11 - [[#contributing][Contributing]]
12 - [[#key-bindings][Key Bindings]]
13 - [[#features][Features]]
14 - [[#testing-with-xephyr][Testing with Xephyr]]
15 - [[#project-structure][Project Structure]]
16 - [[#architecture-notes][Architecture Notes]]
17 - [[#development-roadmap][Development Roadmap]]
18 - [[#license][License]]
19
20 * OXWM
21 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."
22
23 * Installation
24 ** Arch Linux
25 Install dependencies:
26 #+begin_src sh
27 sudo pacman -S rust cargo libx11 libxft freetype2 fontconfig pkg-config
28 #+end_src
29
30 ** Building from Source
31 #+begin_src sh
32 git clone https://github.com/tonybanters/oxwm
33 cd oxwm
34 cargo build --release
35 sudo cp target/release/oxwm /usr/local/bin/
36 #+end_src
37
38 Or use the justfile:
39 #+begin_src sh
40 just install
41 #+end_src
42
43 ** Setting up OXWM
44 Add the following to your =~/.xinitrc=:
45 #+begin_src sh
46 exec oxwm
47 #+end_src
48
49 Then start X with:
50 #+begin_src sh
51 startx
52 #+end_src
53
54 * Configuration
55 OXWM follows the suckless philosophy: configuration is done by editing =src/config.rs= and recompiling.
56
57 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.
58
59 To reset your config to defaults:
60 #+begin_src sh
61 just reset-config
62 #+end_src
63
64 Edit =src/config.rs= to customize:
65 - Keybindings
66 - Colors and appearance
67 - Status bar blocks
68 - Gaps and borders
69 - Terminal and applications
70
71 After making changes:
72 #+begin_src sh
73 just install
74 #+end_src
75
76 Then reload OXWM with Alt+Shift+R.
77
78 * Contributing
79 When contributing to OXWM:
80
81 1. Never commit your personal =src/config.rs= (it's gitignored)
82 2. Only modify =src/default_config.rs= if adding new configuration options
83 3. Test your changes with =just test= using Xephyr
84 4. Document any new features or keybindings
85
86 * Key Bindings
87 Default keybindings (customizable in config.rs):
88
89 | Binding | Action |
90 |-----------------+-------------------------|
91 | Alt+Return | Spawn terminal |
92 | Alt+J/K | Cycle focus down/up |
93 | Alt+Q | Kill focused window |
94 | Alt+Shift+Q | Quit WM |
95 | Alt+Shift+R | Hot reload WM |
96 | Alt+1-9 | View tag 1-9 |
97 | Alt+Shift+1-9 | Move window to tag 1-9 |
98 | Alt+S | Screenshot (maim) |
99 | Alt+D | dmenu launcher |
100 | Alt+A | Toggle gaps |
101 | Alt+Shift+F | Toggle fullscreen |
102
103 * Features
104 - Dynamic tiling layout with master/stack
105 - Tag-based workspaces (9 tags by default)
106 - Configurable gaps between windows
107 - Status bar with modular block system
108 - Battery, RAM, datetime, shell commands
109 - Custom colors and update intervals
110 - Click-to-switch tags
111 - Window focus cycling
112 - Hot reload without restarting X
113 - Persistent window tags across restarts
114 - Mouse hover to focus
115 - Border indicators for focused windows
116 - Fullscreen mode
117
118 * Testing with Xephyr
119 Test OXWM in a nested X server without affecting your current session:
120
121 #+begin_src sh
122 just test
123 #+end_src
124
125 This starts Xephyr on display :1 and launches OXWM inside it.
126
127 Or manually:
128 #+begin_src sh
129 Xephyr -screen 1280x800 :1 &
130 DISPLAY=:1 cargo run
131 #+end_src
132
133 * Project Structure
134 #+begin_src sh
135 src/
136 ├── main.rs Entry point
137 ├── window_manager.rs Core X11 event handling and window management
138 ├── default_config.rs Default configuration (reference)
139 ├── config.rs User configuration (gitignored, auto-generated)
140 ├── bar/
141 │ ├── bar.rs Status bar rendering with XFT
142 │ ├── font.rs Font handling
143 │ └── blocks/ Modular status bar widgets
144 ├── keyboard/
145 │ ├── handlers.rs Keybinding actions
146 │ └── keycodes.rs X11 keycode constants
147 └── layout/
148 └── tiling.rs Tiling layout algorithm
149 #+end_src
150
151 * Architecture Notes
152 ** Tag System
153 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).
154
155 ** Status Bar
156 The bar uses a performance-optimized approach with a modular block system:
157 - Only redraws when invalidated
158 - Pre-calculates tag widths on creation
159 - Blocks update independently based on their configured intervals
160 - Supports custom colors and underline indicators
161 - Easily extensible - add new block types in src/bar/blocks/
162
163 ** Layout System
164 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.
165
166 * Development Roadmap
167 ** Current Focus
168 - Multi-monitor support
169 - Additional layouts (monocle, floating)
170 - Master area resizing
171 - Window swapping in layout
172
173 ** Future Enhancements
174 - Per-window floating behavior
175 - Per-program rules (auto-tag assignment, floating rules)
176 - External bar support (polybar, lemonbar)
177 - Scratchpad functionality
178 - Window minimize/restore
179
180 * License
181 [[https://www.gnu.org/licenses/gpl-3.0.en.html][GPL v3]]