tony / oxwm

fixed reloadsig for now.. Browse files
tonybtw committed 2025-10-05 parent a3977f8 commit 99cb352473a24332d531ce59efc63e7b0dad47d0
Showing 2 changed files with 28 additions and 2 deletions. UnifiedSplit
+2 −0 src/config.rs
@@ -15,6 +15,7 @@ pub const FONT: &str = "JetBrainsMono Nerd Font:style=Bold:size=14";
15 15 // DEFAULTS
16 16 // ========================================
17 17 pub const TERMINAL: &str = "alacritty";
18 +pub const XCLOCK: &str = "xclock";
18 19 pub const MODKEY: KeyButMask = KeyButMask::MOD1;
19 20
20 21 // ========================================
@@ -79,6 +80,7 @@ pub const TAGS: [&str; TAG_COUNT] = ["1", "2", "3", "4", "5", "6", "7", "8", "9"
79 80 #[rustfmt::skip]
80 81 pub const KEYBINDINGS: &[Key] = &[
81 82 Key::new(&[MODKEY], keycodes::RETURN, KeyAction::Spawn, Arg::Str(TERMINAL)),
83 + Key::new(&[MODKEY], keycodes::F, KeyAction::Spawn, Arg::Str(XCLOCK)),
82 84
83 85 Key::new(&[MODKEY], keycodes::S, KeyAction::Spawn, Arg::Array(SCREENSHOT_CMD)),
84 86 Key::new(&[MODKEY], keycodes::D, KeyAction::Spawn, Arg::Array(DMENU_CMD)),
+26 −2 src/window_manager.rs
@@ -97,13 +97,36 @@ impl WindowManager {
97 97 continue;
98 98 }
99 99
100 - if attrs.map_state == MapState::VIEWABLE || attrs.map_state == MapState::UNMAPPED {
100 + if attrs.map_state == MapState::VIEWABLE {
101 101 println!(
102 - " -> Managing window, tagging with {:b}",
102 + " -> Managing VIEWABLE window, tagging with {:b}",
103 103 self.selected_tags
104 104 );
105 105 self.windows.push(window);
106 106 self.window_tags.insert(window, self.selected_tags);
107 + continue;
108 + }
109 +
110 + if attrs.map_state == MapState::UNMAPPED {
111 + let has_wm_class = match self
112 + .connection
113 + .get_property(false, window, AtomEnum::WM_CLASS, AtomEnum::STRING, 0, 1024)?
114 + .reply()
115 + {
116 + Ok(prop) => !prop.value.is_empty(),
117 + Err(_) => false,
118 + };
119 +
120 + if has_wm_class {
121 + println!(
122 + " -> Managing UNMAPPED window (has WM_CLASS), tagging with {:b}",
123 + self.selected_tags
124 + );
125 + self.windows.push(window);
126 + self.window_tags.insert(window, self.selected_tags);
127 + } else {
128 + println!(" -> Skipped UNMAPPED (no WM_CLASS)");
129 + }
107 130 } else {
108 131 println!(" -> Skipped (map_state={:?})", attrs.map_state);
109 132 }
@@ -371,6 +394,7 @@ impl WindowManager {
371 394 }
372 395 Ok(None)
373 396 }
397 +
374 398 fn apply_layout(&self) -> Result<()> {
375 399 let screen_width = self.screen.width_in_pixels as u32;
376 400 let screen_height = self.screen.height_in_pixels as u32;