Fixed readme
Browse files
+85 −13 readme.org
| @@ -17,8 +17,11 @@ | ||
| 17 | 17 | - [[#development-roadmap][Development Roadmap]] |
| 18 | 18 | - [[#license][License]] |
| 19 | 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." | |
| 20 | +* OXWM — DWM but Better (and oxidized) | |
| 21 | +A dynamic window manager written in Rust, inspired by dwm but designed to evolve | |
| 22 | +on its own. Configuration is done in Rust source code, keeping with the suckless | |
| 23 | +philosophy of *"edit + recompile."*, but with sane defaults and no arbitrary elitism | |
| 24 | +enforcing bad variable names and bad file structure topology. | |
| 22 | 25 | |
| 23 | 26 | * Installation |
| 24 | 27 | ** Arch Linux |
| @@ -133,20 +136,89 @@ DISPLAY=:1 cargo run | ||
| 133 | 136 | * Project Structure |
| 134 | 137 | #+begin_src sh |
| 135 | 138 | 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) | |
| 139 | +├── main.rs | |
| 140 | +│ └── main() | |
| 141 | +│ └── Creates WindowManager and calls .run() | |
| 142 | +│ | |
| 143 | +├── window_manager.rs [CORE - X11 event handling] | |
| 144 | +│ ├── struct WindowManager | |
| 145 | +│ │ ├── connection: RustConnection [X11 connection] | |
| 146 | +│ │ ├── windows: Vec<Window> [All managed windows] | |
| 147 | +│ │ ├── focused_window: Option<Window> | |
| 148 | +│ │ ├── layout: Box<dyn Layout> | |
| 149 | +│ │ ├── window_tags: HashMap<Window, TagMask> | |
| 150 | +│ │ ├── selected_tags: TagMask | |
| 151 | +│ │ └── bar: Bar [Status bar] | |
| 152 | +│ │ | |
| 153 | +│ ├── new() [Initialize WM, grab root, restore tags, scan windows] | |
| 154 | +│ ├── run() [Main event loop with block updates] | |
| 155 | +│ ├── handle_event() [Route X11 events] | |
| 156 | +│ │ ├── MapRequest → add window, apply layout, update bar, save tag | |
| 157 | +│ │ ├── UnmapNotify → remove window, update bar | |
| 158 | +│ │ ├── DestroyNotify → remove window, update bar | |
| 159 | +│ │ ├── KeyPress → get action, handle it (includes Restart) | |
| 160 | +│ │ ├── ButtonPress → handle bar clicks | |
| 161 | +│ │ └── Expose → redraw bar | |
| 162 | +│ ├── handle_key_action() [Execute keyboard actions] | |
| 163 | +│ ├── get_saved_selected_tags() [Restore selected tags from _NET_CURRENT_DESKTOP] | |
| 164 | +│ ├── save_selected_tags() [Persist selected tags to root window] | |
| 165 | +│ ├── get_saved_tag() [Restore window tag from _NET_CLIENT_INFO] | |
| 166 | +│ ├── save_client_tag() [Persist window tag to window property] | |
| 167 | +│ ├── scan_existing_windows() [Manage windows on startup] | |
| 168 | +│ ├── remove_window() [Remove from Vec, reapply layout] | |
| 169 | +│ ├── set_focus() [Focus window, update visuals] | |
| 170 | +│ ├── cycle_focus() [Move focus to next/prev window] | |
| 171 | +│ ├── view_tag() [Switch to tag/workspace, update visibility] | |
| 172 | +│ ├── move_to_tag() [Move window to tag] | |
| 173 | +│ ├── update_bar() [Calculate occupied tags, redraw bar] | |
| 174 | +│ ├── update_focus_visuals() [Set border colors] | |
| 175 | +│ ├── update_window_visibility() [Map/unmap windows based on tags] | |
| 176 | +│ └── apply_layout() [Position all windows below bar] | |
| 177 | +│ | |
| 178 | +├── config.rs [CONFIGURATION - all settings here] | |
| 179 | +│ ├── BORDER_WIDTH, BORDER_FOCUSED, BORDER_UNFOCUSED | |
| 180 | +│ ├── FONT [XFT font string] | |
| 181 | +│ ├── TAG_COUNT, TAGS [Workspace configuration] | |
| 182 | +│ ├── TERMINAL, MODKEY | |
| 183 | +│ ├── ColorScheme [Foreground, background, border colors] | |
| 184 | +│ ├── SCHEME_NORMAL, SCHEME_OCCUPIED, SCHEME_SELECTED | |
| 185 | +│ ├── KEYBINDINGS [All keybinds as const array] | |
| 186 | +│ └── STATUS_BLOCKS [Block configurations with format, command, interval] | |
| 187 | +│ | |
| 140 | 188 | ├── bar/ |
| 141 | -│ ├── bar.rs Status bar rendering with XFT | |
| 142 | -│ ├── font.rs Font handling | |
| 143 | -│ └── blocks/ Modular status bar widgets | |
| 189 | +│ ├── mod.rs [Re-exports: Bar, BlockCommand, BlockConfig] | |
| 190 | +│ ├── bar.rs | |
| 191 | +│ │ ├── struct Bar [Status bar window with XFT support] | |
| 192 | +│ │ ├── new() [Create bar X11 window, load font, init blocks] | |
| 193 | +│ │ ├── draw() [Render tags + blocks with underlines] | |
| 194 | +│ │ ├── update_blocks() [Update block content based on intervals] | |
| 195 | +│ │ ├── handle_click() [Detect which tag was clicked] | |
| 196 | +│ │ └── invalidate() [Mark bar as needing redraw] | |
| 197 | +│ ├── font.rs | |
| 198 | +│ │ ├── struct Font [XFT font wrapper] | |
| 199 | +│ │ ├── struct FontDraw [XFT drawing context] | |
| 200 | +│ │ └── draw_text() [Render text with color] | |
| 201 | +│ └── blocks/ | |
| 202 | +│ ├── mod.rs [Block trait, BlockConfig, BlockCommand enum] | |
| 203 | +│ ├── battery.rs [Battery status block] | |
| 204 | +│ ├── datetime.rs [Date/time formatting block] | |
| 205 | +│ └── shell.rs [Shell command execution block] | |
| 206 | +│ | |
| 144 | 207 | ├── keyboard/ |
| 145 | -│ ├── handlers.rs Keybinding actions | |
| 146 | -│ └── keycodes.rs X11 keycode constants | |
| 208 | +│ ├── mod.rs [Re-exports] | |
| 209 | +│ ├── keycodes.rs [Key constants: Q, J, RETURN, etc] | |
| 210 | +│ └── handlers.rs | |
| 211 | +│ ├── enum KeyAction [Spawn, KillClient, FocusStack, ViewTag, Restart, etc] | |
| 212 | +│ ├── enum Arg [None, Int, Str, Array] | |
| 213 | +│ ├── struct Key [Keybinding definition] | |
| 214 | +│ ├── setup_keybinds() [Register keys with X11] | |
| 215 | +│ └── handle_key_press() [Parse KeyPressEvent → KeyAction] | |
| 216 | +│ | |
| 147 | 217 | └── layout/ |
| 148 | - └── tiling.rs Tiling layout algorithm | |
| 149 | -#+end_src | |
| 218 | + ├── mod.rs [Layout trait definition] | |
| 219 | + └── tiling.rs | |
| 220 | + └── TilingLayout::arrange() [Calculate window positions]c | |
| 221 | +#+end_srsrc/ | |
| 150 | 222 | |
| 151 | 223 | * Architecture Notes |
| 152 | 224 | ** Tag System |