Updated readme.
Browse files
+77 −34 readme.org
| @@ -16,10 +16,10 @@ | ||
| 16 | 16 | - [[#core-window-management-22][Core Window Management]] |
| 17 | 17 | - [[#tag-system-33][Tag System]] |
| 18 | 18 | - [[#status-bar-22][Status Bar]] |
| 19 | - - [[#in-progress-bar-enhancements-03][IN PROGRESS Bar Enhancements]] | |
| 20 | - - [[#key-system-improvements-02][Key System Improvements]] | |
| 21 | - - [[#layout-system-04][Layout System]] | |
| 22 | - - [[#advanced-features-03][Advanced Features]] | |
| 19 | + - [[#bar-enhancements-33][Bar Enhancements]] | |
| 20 | + - [[#key-system-improvements-22][Key System Improvements]] | |
| 21 | + - [[#layout-system-05][Layout System]] | |
| 22 | + - [[#advanced-features-04][Advanced Features]] | |
| 23 | 23 | - [[#polish--features][Polish & Features]] |
| 24 | 24 | - [[#architecture-notes][Architecture Notes]] |
| 25 | 25 | - [[#tag-system][Tag System]] |
| @@ -50,46 +50,67 @@ src/ | ||
| 50 | 50 | │ │ ├── selected_tags: TagMask |
| 51 | 51 | │ │ └── bar: Bar [Status bar] |
| 52 | 52 | │ │ |
| 53 | -│ ├── new() [Initialize WM, grab root, create bar] | |
| 54 | -│ ├── run() [Main event loop] | |
| 53 | +│ ├── new() [Initialize WM, grab root, restore tags, scan windows] | |
| 54 | +│ ├── run() [Main event loop with block updates] | |
| 55 | 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 | 57 | │ │ ├── UnmapNotify → remove window, update bar |
| 58 | 58 | │ │ ├── DestroyNotify → remove window, update bar |
| 59 | -│ │ ├── KeyPress → get action, handle it | |
| 59 | +│ │ ├── KeyPress → get action, handle it (includes Restart) | |
| 60 | 60 | │ │ ├── ButtonPress → handle bar clicks |
| 61 | 61 | │ │ └── Expose → redraw bar |
| 62 | 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 | 68 | │ ├── remove_window() [Remove from Vec, reapply layout] |
| 64 | 69 | │ ├── set_focus() [Focus window, update visuals] |
| 65 | 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 | 72 | │ ├── move_to_tag() [Move window to tag] |
| 68 | 73 | │ ├── update_bar() [Calculate occupied tags, redraw bar] |
| 69 | 74 | │ ├── update_focus_visuals() [Set border colors] |
| 75 | +│ ├── update_window_visibility() [Map/unmap windows based on tags] | |
| 70 | 76 | │ └── apply_layout() [Position all windows below bar] |
| 71 | 77 | │ |
| 72 | 78 | ├── config.rs [CONFIGURATION - all settings here] |
| 73 | 79 | │ ├── BORDER_WIDTH, BORDER_FOCUSED, BORDER_UNFOCUSED |
| 80 | +│ ├── FONT [XFT font string] | |
| 74 | 81 | │ ├── TAG_COUNT, TAGS [Workspace configuration] |
| 75 | 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 | 88 | ├── bar/ |
| 79 | -│ ├── mod.rs [Re-exports, constants] | |
| 80 | -│ └── bar.rs | |
| 81 | -│ ├── struct Bar [Status bar window] | |
| 82 | -│ ├── new() [Create bar X11 window] | |
| 83 | -│ ├── draw() [Render tags with state indicators] | |
| 84 | -│ ├── handle_click() [Detect which tag was clicked] | |
| 85 | -│ └── invalidate() [Mark bar as needing redraw] | |
| 89 | +│ ├── mod.rs [Re-exports: Bar, BlockCommand, BlockConfig] | |
| 90 | +│ ├── bar.rs | |
| 91 | +│ │ ├── struct Bar [Status bar window with XFT support] | |
| 92 | +│ │ ├── new() [Create bar X11 window, load font, init blocks] | |
| 93 | +│ │ ├── draw() [Render tags + blocks with underlines] | |
| 94 | +│ │ ├── update_blocks() [Update block content based on intervals] | |
| 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 | 107 | ├── keyboard/ |
| 88 | 108 | │ ├── mod.rs [Re-exports] |
| 89 | 109 | │ ├── keycodes.rs [Key constants: Q, J, RETURN, etc] |
| 90 | 110 | │ └── handlers.rs |
| 91 | -│ ├── enum KeyAction [Spawn, KillClient, FocusStack, ViewTag, etc] | |
| 111 | +│ ├── enum KeyAction [Spawn, KillClient, FocusStack, ViewTag, Restart, etc] | |
| 92 | 112 | │ ├── enum Arg [None, Int, Str, Array] |
| 113 | +│ ├── struct Key [Keybinding definition] | |
| 93 | 114 | │ ├── setup_keybinds() [Register keys with X11] |
| 94 | 115 | │ └── handle_key_press() [Parse KeyPressEvent → KeyAction] |
| 95 | 116 | │ |
| @@ -124,9 +145,11 @@ src/ | ||
| 124 | 145 | | Alt+J/K | Cycle focus down/up | |
| 125 | 146 | | Alt+Q | Kill focused window | |
| 126 | 147 | | Alt+Shift+Q | Quit WM | |
| 148 | +| Alt+Shift+R | Hot reload WM | | |
| 127 | 149 | | Alt+1-9 | View tag 1-9 | |
| 128 | 150 | | Alt+Shift+1-9 | Move window to tag 1-9 | |
| 129 | 151 | | Alt+S | Screenshot (maim) | |
| 152 | +| Alt+D | Application launcher | | |
| 130 | 153 | |
| 131 | 154 | * ⚙ Installation — Running with Nix Flakes |
| 132 | 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 | 190 | - Performance-optimized redrawing |
| 168 | 191 | - ✓ Basic keybindings (spawn, kill, focus, tags) |
| 169 | 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 | 203 | ** Immediate Next Steps |
| 172 | -- [ ] Status text in bar (date, time, system info) | |
| 173 | -- [ ] dmenu integration for application launcher | |
| 174 | -- [ ] Additional widgets (clock, battery, etc.) | |
| 204 | +- [ ] Mouse hover to focus windows | |
| 205 | +- [ ] Configurable gaps between windows (vanitygaps-style) | |
| 206 | +- [ ] Decide on reload behavior (should it auto-rebuild?) | |
| 175 | 207 | |
| 176 | 208 | ** Long Term Roadmap |
| 177 | 209 | - [ ] Multi-monitor support |
| @@ -180,7 +212,6 @@ events in your host terminal. Clients like xterm/xclock will appear inside Xephy | ||
| 180 | 212 | - [ ] Per-program rules (auto-tag assignment, floating rules) |
| 181 | 213 | - [ ] Master area resizing |
| 182 | 214 | - [ ] Window swapping in layout |
| 183 | -- [ ] Configurable gaps between windows | |
| 184 | 215 | - [ ] External bar support (polybar, lemonbar, etc.) |
| 185 | 216 | |
| 186 | 217 | * OXWM Development Todo |
| @@ -203,22 +234,24 @@ events in your host terminal. Clients like xterm/xclock will appear inside Xephy | ||
| 203 | 234 | - [X] Create basic bar window at screen top |
| 204 | 235 | - [X] Display tag indicators with state (selected/occupied/empty) |
| 205 | 236 | |
| 206 | -** IN PROGRESS Bar Enhancements [0/3] | |
| 207 | -- [ ] Add status text area (right side of bar) | |
| 208 | -- [ ] Implement clock widget | |
| 209 | -- [ ] Add system information widgets | |
| 237 | +** DONE Bar Enhancements [3/3] | |
| 238 | +- [X] Add status text area (right side of bar) | |
| 239 | +- [X] Implement clock widget | |
| 240 | +- [X] Add system information widgets | |
| 210 | 241 | |
| 211 | -** TODO Key System Improvements [0/2] | |
| 212 | -- [ ] dmenu integration for application launching | |
| 213 | -- [ ] More spawn commands in config (screenshot, volume, etc.) | |
| 242 | +** DONE Key System Improvements [2/2] | |
| 243 | +- [X] dmenu integration for application launching | |
| 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 | 249 | - [ ] Add monocle layout |
| 217 | 250 | - [ ] Add floating layout mode |
| 218 | 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 | 255 | - [ ] Multi-monitor support |
| 223 | 256 | - [ ] Per-window rules (floating, tag assignment) |
| 224 | 257 | - [ ] Master area resizing keybinds |
| @@ -233,14 +266,24 @@ events in your host terminal. Clients like xterm/xclock will appear inside Xephy | ||
| 233 | 266 | ** Tag System |
| 234 | 267 | Tags are implemented as bitmasks (TagMask = u32), allowing windows to belong to |
| 235 | 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 | 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 | 275 | - Only redraws when invalidate() is called |
| 241 | 276 | - Pre-calculates tag widths on creation |
| 242 | 277 | - Uses X11 graphics context for efficient drawing |
| 243 | 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 | 288 | ** Configuration Philosophy |
| 246 | 289 | Following dwm's approach: all configuration is in Rust source code. No runtime |