tony / oxwm

update readme Browse files
tonybtw committed 2025-09-29 parent b5923a9 commit a6ca2ea2b4501f559201123e75db4d7bfe1840c1
Showing 1 changed file with 40 additions and 47 deletions. UnifiedSplit
+40 −47 readme.org
@@ -11,53 +11,46 @@ an X display and log incoming events.
11 11
12 * Project Structure 12 * Project Structure
13 13
14 -** src/ 14 +#+begin_src sh
15 -*** main.rs 15 +src/
16 -- main() :: Creates WindowManager and calls .run() 16 +├── main.rs
17 - 17 +│ └── main()
18 -*** window_manager.rs (CORE) 18 +│ └── Creates WindowManager and calls .run()
19 -Handles all X11 events and window management 19 +│
20 - 20 +├── window_manager.rs [CORE - X11 event handling]
21 -**** struct WindowManager 21 +│ ├── struct WindowManager
22 -- connection :: X11 connection 22 +│ │ ├── connection: RustConnection [X11 connection]
23 -- windows :: Vec<Window> (all managed windows) 23 +│ │ ├── windows: Vec<Window> [All managed windows]
24 -- focused_window :: Option<Window> 24 +│ │ ├── focused_window: Option<Window>
25 -- layout :: Box<dyn Layout> 25 +│ │ └── layout: Box<dyn Layout>
26 - 26 +│ │
27 -**** Methods 27 +│ ├── new() [Initialize WM, grab root]
28 -- new() :: Initialize WM, grab root window 28 +│ ├── run() [Main event loop]
29 -- run() :: Main event loop 29 +│ ├── handle_event() [Route X11 events]
30 -- handle_event() :: Routes X11 events 30 +│ │ ├── MapRequest → add window, apply layout
31 - - MapRequest → add window, apply layout 31 +│ │ ├── UnmapNotify → remove window
32 - - UnmapNotify → remove window 32 +│ │ ├── DestroyNotify → remove window
33 - - DestroyNotify → remove window 33 +│ │ └── KeyPress → get action, handle it
34 - - KeyPress → get action, handle it 34 +│ ├── handle_key_action() [Execute keyboard actions]
35 -- handle_key_action() :: Execute keyboard actions 35 +│ ├── remove_window() [Remove from Vec, reapply layout]
36 -- remove_window() :: Remove from Vec, reapply layout 36 +│ ├── set_focus() [Focus window, update visuals]
37 -- set_focus() :: Focus window, update visuals 37 +│ ├── cycle_focus() [Move focus to next window]
38 -- cycle_focus() :: Move focus to next window 38 +│ ├── update_focus_visuals() [Set border colors]
39 -- update_focus_visuals() :: Set border colors 39 +│ └── apply_layout() [Position all windows]
40 -- apply_layout() :: Position all windows 40 +│
41 - 41 +├── keyboard/
42 -*** keyboard/ 42 +│ ├── mod.rs [Re-exports]
43 -**** mod.rs 43 +│ ├── keycodes.rs [Key constants: Q, J, RETURN, etc]
44 -- Re-exports public interface 44 +│ └── handlers.rs
45 - 45 +│ ├── enum KeyAction [SpawnTerminal, CloseWindow, CycleWindow, Quit, None]
46 -**** keycodes.rs 46 +│ ├── setup_keybinds() [Register keys with X11]
47 -- Key constants (Q, J, RETURN, etc) 47 +│ └── handle_key_press() [Parse KeyPressEvent → KeyAction]
48 - 48 +│
49 -**** handlers.rs 49 +└── layout/
50 -- enum KeyAction :: SpawnTerminal, CloseWindow, CycleWindow, Quit, None 50 +├── mod.rs [Layout trait definition]
51 -- setup_keybinds() :: Register keys with X11 51 +└── tiling.rs
52 -- handle_key_press() :: Parse key → return KeyAction 52 +└── TilingLayout::arrange() [Calculate window positions]
53 - 53 +#+end_src
54 -*** layout/
55 -**** mod.rs
56 -- Layout trait definition
57 -
58 -**** tiling.rs
59 -- TilingLayout :: Implementation
60 - - arrange() :: Calculate window positions
61 54
62 * Event Flow 55 * Event Flow
63 56