tony / oxwm

Updated readme. Browse files
tonybtw committed 2025-10-05 parent dea5239 commit e9ab027159875bf1e9c0d23143d0429f9543138b
Showing 1 changed file with 77 additions and 34 deletions. UnifiedSplit
+77 −34 readme.org
@@ -16,10 +16,10 @@
16 - [[#core-window-management-22][Core Window Management]] 16 - [[#core-window-management-22][Core Window Management]]
17 - [[#tag-system-33][Tag System]] 17 - [[#tag-system-33][Tag System]]
18 - [[#status-bar-22][Status Bar]] 18 - [[#status-bar-22][Status Bar]]
19 - - [[#in-progress-bar-enhancements-03][IN PROGRESS Bar Enhancements]] 19 + - [[#bar-enhancements-33][Bar Enhancements]]
20 - - [[#key-system-improvements-02][Key System Improvements]] 20 + - [[#key-system-improvements-22][Key System Improvements]]
21 - - [[#layout-system-04][Layout System]] 21 + - [[#layout-system-05][Layout System]]
22 - - [[#advanced-features-03][Advanced Features]] 22 + - [[#advanced-features-04][Advanced Features]]
23 - [[#polish--features][Polish & Features]] 23 - [[#polish--features][Polish & Features]]
24 - [[#architecture-notes][Architecture Notes]] 24 - [[#architecture-notes][Architecture Notes]]
25 - [[#tag-system][Tag System]] 25 - [[#tag-system][Tag System]]
@@ -50,46 +50,67 @@ src/
50 │ │ ├── selected_tags: TagMask 50 │ │ ├── selected_tags: TagMask
51 │ │ └── bar: Bar [Status bar] 51 │ │ └── bar: Bar [Status bar]
52 │ │ 52 │ │
53 -│ ├── new() [Initialize WM, grab root, create bar] 53 +│ ├── new() [Initialize WM, grab root, restore tags, scan windows]
54 -│ ├── run() [Main event loop] 54 +│ ├── run() [Main event loop with block updates]
55 │ ├── handle_event() [Route X11 events] 55 │ ├── handle_event() [Route X11 events]
56 -│ │ ├── MapRequest → add window, apply layout, update bar 56 +│ │ ├── MapRequest → add window, apply layout, update bar, save tag
57 │ │ ├── UnmapNotify → remove window, update bar 57 │ │ ├── UnmapNotify → remove window, update bar
58 │ │ ├── DestroyNotify → remove window, update bar 58 │ │ ├── DestroyNotify → remove window, update bar
59 -│ │ ├── KeyPress → get action, handle it 59 +│ │ ├── KeyPress → get action, handle it (includes Restart)
60 │ │ ├── ButtonPress → handle bar clicks 60 │ │ ├── ButtonPress → handle bar clicks
61 │ │ └── Expose → redraw bar 61 │ │ └── Expose → redraw bar
62 │ ├── handle_key_action() [Execute keyboard actions] 62 │ ├── handle_key_action() [Execute keyboard actions]
63 +│ ├── get_saved_selected_tags() [Restore selected tags from _NET_CURRENT_DESKTOP]
64 +│ ├── save_selected_tags() [Persist selected tags to root window]
65 +│ ├── get_saved_tag() [Restore window tag from _NET_CLIENT_INFO]
66 +│ ├── save_client_tag() [Persist window tag to window property]
67 +│ ├── scan_existing_windows() [Manage windows on startup]
63 │ ├── remove_window() [Remove from Vec, reapply layout] 68 │ ├── remove_window() [Remove from Vec, reapply layout]
64 │ ├── set_focus() [Focus window, update visuals] 69 │ ├── set_focus() [Focus window, update visuals]
65 │ ├── cycle_focus() [Move focus to next/prev window] 70 │ ├── cycle_focus() [Move focus to next/prev window]
66 -│ ├── view_tag() [Switch to tag/workspace] 71 +│ ├── view_tag() [Switch to tag/workspace, update visibility]
67 │ ├── move_to_tag() [Move window to tag] 72 │ ├── move_to_tag() [Move window to tag]
68 │ ├── update_bar() [Calculate occupied tags, redraw bar] 73 │ ├── update_bar() [Calculate occupied tags, redraw bar]
69 │ ├── update_focus_visuals() [Set border colors] 74 │ ├── update_focus_visuals() [Set border colors]
75 +│ ├── update_window_visibility() [Map/unmap windows based on tags]
70 │ └── apply_layout() [Position all windows below bar] 76 │ └── apply_layout() [Position all windows below bar]
71 │ 77 │
72 ├── config.rs [CONFIGURATION - all settings here] 78 ├── config.rs [CONFIGURATION - all settings here]
73 │ ├── BORDER_WIDTH, BORDER_FOCUSED, BORDER_UNFOCUSED 79 │ ├── BORDER_WIDTH, BORDER_FOCUSED, BORDER_UNFOCUSED
80 +│ ├── FONT [XFT font string]
74 │ ├── TAG_COUNT, TAGS [Workspace configuration] 81 │ ├── TAG_COUNT, TAGS [Workspace configuration]
75 │ ├── TERMINAL, MODKEY 82 │ ├── TERMINAL, MODKEY
76 -│ └── KEYBINDINGS [All keybinds as const array] 83 +│ ├── ColorScheme [Foreground, background, border colors]
84 +│ ├── SCHEME_NORMAL, SCHEME_OCCUPIED, SCHEME_SELECTED
85 +│ ├── KEYBINDINGS [All keybinds as const array]
86 +│ └── STATUS_BLOCKS [Block configurations with format, command, interval]
77 │ 87 │
78 ├── bar/ 88 ├── bar/
79 -│ ├── mod.rs [Re-exports, constants] 89 +│ ├── mod.rs [Re-exports: Bar, BlockCommand, BlockConfig]
80 -│ └── bar.rs 90 +│ ├── bar.rs
81 -│ ├── struct Bar [Status bar window] 91 +│ │ ├── struct Bar [Status bar window with XFT support]
82 -│ ├── new() [Create bar X11 window] 92 +│ │ ├── new() [Create bar X11 window, load font, init blocks]
83 -│ ├── draw() [Render tags with state indicators] 93 +│ │ ├── draw() [Render tags + blocks with underlines]
84 -│ ├── handle_click() [Detect which tag was clicked] 94 +│ │ ├── update_blocks() [Update block content based on intervals]
85 -│ └── invalidate() [Mark bar as needing redraw] 95 +│ │ ├── handle_click() [Detect which tag was clicked]
96 +│ │ └── invalidate() [Mark bar as needing redraw]
97 +│ ├── font.rs
98 +│ │ ├── struct Font [XFT font wrapper]
99 +│ │ ├── struct FontDraw [XFT drawing context]
100 +│ │ └── draw_text() [Render text with color]
101 +│ └── blocks/
102 +│ ├── mod.rs [Block trait, BlockConfig, BlockCommand enum]
103 +│ ├── battery.rs [Battery status block]
104 +│ ├── datetime.rs [Date/time formatting block]
105 +│ └── shell.rs [Shell command execution block]
86 │ 106 │
87 ├── keyboard/ 107 ├── keyboard/
88 │ ├── mod.rs [Re-exports] 108 │ ├── mod.rs [Re-exports]
89 │ ├── keycodes.rs [Key constants: Q, J, RETURN, etc] 109 │ ├── keycodes.rs [Key constants: Q, J, RETURN, etc]
90 │ └── handlers.rs 110 │ └── handlers.rs
91 -│ ├── enum KeyAction [Spawn, KillClient, FocusStack, ViewTag, etc] 111 +│ ├── enum KeyAction [Spawn, KillClient, FocusStack, ViewTag, Restart, etc]
92 │ ├── enum Arg [None, Int, Str, Array] 112 │ ├── enum Arg [None, Int, Str, Array]
113 +│ ├── struct Key [Keybinding definition]
93 │ ├── setup_keybinds() [Register keys with X11] 114 │ ├── setup_keybinds() [Register keys with X11]
94 │ └── handle_key_press() [Parse KeyPressEvent → KeyAction] 115 │ └── handle_key_press() [Parse KeyPressEvent → KeyAction]
95 │ 116 │
@@ -124,9 +145,11 @@ src/
124 | Alt+J/K | Cycle focus down/up | 145 | Alt+J/K | Cycle focus down/up |
125 | Alt+Q | Kill focused window | 146 | Alt+Q | Kill focused window |
126 | Alt+Shift+Q | Quit WM | 147 | Alt+Shift+Q | Quit WM |
148 +| Alt+Shift+R | Hot reload WM |
127 | Alt+1-9 | View tag 1-9 | 149 | Alt+1-9 | View tag 1-9 |
128 | Alt+Shift+1-9 | Move window to tag 1-9 | 150 | Alt+Shift+1-9 | Move window to tag 1-9 |
129 | Alt+S | Screenshot (maim) | 151 | Alt+S | Screenshot (maim) |
152 +| Alt+D | Application launcher |
130 153
131 * ⚙ Installation — Running with Nix Flakes 154 * ⚙ Installation — Running with Nix Flakes
132 You can set up a reproducible development environment with Rust, Cargo, Xephyr, xterm, and 155 You can set up a reproducible development environment with Rust, Cargo, Xephyr, xterm, and
@@ -167,11 +190,20 @@ events in your host terminal. Clients like xterm/xclock will appear inside Xephy
167 - Performance-optimized redrawing 190 - Performance-optimized redrawing
168 - ✓ Basic keybindings (spawn, kill, focus, tags) 191 - ✓ Basic keybindings (spawn, kill, focus, tags)
169 - ✓ Configuration via Rust constants in config.rs 192 - ✓ Configuration via Rust constants in config.rs
193 +- ✓ Hot reload functionality (Alt+Shift+R)
194 +- ✓ Persistent window tags across restarts
195 +- ✓ Status bar blocks system
196 + - DateTime, Battery, Shell command blocks
197 + - Configurable colors and update intervals
198 + - Underline indicators for blocks
199 + - Proper spacing between blocks
200 + - Hackable block system for custom widgets
201 +- ✓ dmenu integration (Alt+D)
170 202
171 ** Immediate Next Steps 203 ** Immediate Next Steps
172 -- [ ] Status text in bar (date, time, system info) 204 +- [ ] Mouse hover to focus windows
173 -- [ ] dmenu integration for application launcher 205 +- [ ] Configurable gaps between windows (vanitygaps-style)
174 -- [ ] Additional widgets (clock, battery, etc.) 206 +- [ ] Decide on reload behavior (should it auto-rebuild?)
175 207
176 ** Long Term Roadmap 208 ** Long Term Roadmap
177 - [ ] Multi-monitor support 209 - [ ] Multi-monitor support
@@ -180,7 +212,6 @@ events in your host terminal. Clients like xterm/xclock will appear inside Xephy
180 - [ ] Per-program rules (auto-tag assignment, floating rules) 212 - [ ] Per-program rules (auto-tag assignment, floating rules)
181 - [ ] Master area resizing 213 - [ ] Master area resizing
182 - [ ] Window swapping in layout 214 - [ ] Window swapping in layout
183 -- [ ] Configurable gaps between windows
184 - [ ] External bar support (polybar, lemonbar, etc.) 215 - [ ] External bar support (polybar, lemonbar, etc.)
185 216
186 * OXWM Development Todo 217 * OXWM Development Todo
@@ -203,22 +234,24 @@ events in your host terminal. Clients like xterm/xclock will appear inside Xephy
203 - [X] Create basic bar window at screen top 234 - [X] Create basic bar window at screen top
204 - [X] Display tag indicators with state (selected/occupied/empty) 235 - [X] Display tag indicators with state (selected/occupied/empty)
205 236
206 -** IN PROGRESS Bar Enhancements [0/3] 237 +** DONE Bar Enhancements [3/3]
207 -- [ ] Add status text area (right side of bar) 238 +- [X] Add status text area (right side of bar)
208 -- [ ] Implement clock widget 239 +- [X] Implement clock widget
209 -- [ ] Add system information widgets 240 +- [X] Add system information widgets
210 241
211 -** TODO Key System Improvements [0/2] 242 +** DONE Key System Improvements [2/2]
212 -- [ ] dmenu integration for application launching 243 +- [X] dmenu integration for application launching
213 -- [ ] More spawn commands in config (screenshot, volume, etc.) 244 +- [X] More spawn commands in config (screenshot, volume, etc.)
214 245
215 -** TODO Layout System [0/4] 246 +** TODO Layout System [0/5]
247 +- [ ] Mouse hover to focus windows
248 +- [ ] Configurable gaps between windows (vanitygaps-style)
216 - [ ] Add monocle layout 249 - [ ] Add monocle layout
217 - [ ] Add floating layout mode 250 - [ ] Add floating layout mode
218 - [ ] Handle window resize requests properly 251 - [ ] Handle window resize requests properly
219 -- [ ] Add configurable gaps between windows
220 252
221 -** TODO Advanced Features [0/3] 253 +** TODO Advanced Features [0/4]
254 +- [ ] Decide on reload behavior (auto-rebuild vs manual)
222 - [ ] Multi-monitor support 255 - [ ] Multi-monitor support
223 - [ ] Per-window rules (floating, tag assignment) 256 - [ ] Per-window rules (floating, tag assignment)
224 - [ ] Master area resizing keybinds 257 - [ ] Master area resizing keybinds
@@ -233,14 +266,24 @@ events in your host terminal. Clients like xterm/xclock will appear inside Xephy
233 ** Tag System 266 ** Tag System
234 Tags are implemented as bitmasks (TagMask = u32), allowing windows to belong to 267 Tags are implemented as bitmasks (TagMask = u32), allowing windows to belong to
235 multiple tags simultaneously (though current UI only supports single tags). 268 multiple tags simultaneously (though current UI only supports single tags).
236 -Each window has an associated TagMask in window_tags HashMap. 269 +Each window has an associated TagMask in window_tags HashMap. Tags persist across
270 +WM restarts using X11 properties (_NET_CURRENT_DESKTOP for selected tags,
271 +_NET_CLIENT_INFO for per-window tags).
237 272
238 ** Bar Design 273 ** Bar Design
239 -The bar uses a performance-optimized approach: 274 +The bar uses a performance-optimized approach with a modular block system:
240 - Only redraws when invalidate() is called 275 - Only redraws when invalidate() is called
241 - Pre-calculates tag widths on creation 276 - Pre-calculates tag widths on creation
242 - Uses X11 graphics context for efficient drawing 277 - Uses X11 graphics context for efficient drawing
243 - Click handling uses O(n) tag width lookup 278 - Click handling uses O(n) tag width lookup
279 +- Blocks are updated independently based on their interval
280 +- Each block can have custom colors and optional underline indicators
281 +- Blocks are defined in config.rs and can be:
282 + - DateTime: Display formatted date/time
283 + - Battery: Show battery status with custom formats
284 + - Shell: Execute shell commands and display output
285 + - Static: Display fixed text
286 +- Blocks are easily hackable - add new block types in src/bar/blocks/
244 287
245 ** Configuration Philosophy 288 ** Configuration Philosophy
246 Following dwm's approach: all configuration is in Rust source code. No runtime 289 Following dwm's approach: all configuration is in Rust source code. No runtime