fixed reloadsig for now..
Browse files
+2 −0 src/config.rs
| @@ -15,6 +15,7 @@ pub const FONT: &str = "JetBrainsMono Nerd Font:style=Bold:size=14"; | |||
| 15 | // DEFAULTS | 15 | // DEFAULTS |
| 16 | // ======================================== | 16 | // ======================================== |
| 17 | pub const TERMINAL: &str = "alacritty"; | 17 | pub const TERMINAL: &str = "alacritty"; |
| 18 | +pub const XCLOCK: &str = "xclock"; | ||
| 18 | pub const MODKEY: KeyButMask = KeyButMask::MOD1; | 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 | #[rustfmt::skip] | 80 | #[rustfmt::skip] |
| 80 | pub const KEYBINDINGS: &[Key] = &[ | 81 | pub const KEYBINDINGS: &[Key] = &[ |
| 81 | Key::new(&[MODKEY], keycodes::RETURN, KeyAction::Spawn, Arg::Str(TERMINAL)), | 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 | Key::new(&[MODKEY], keycodes::S, KeyAction::Spawn, Arg::Array(SCREENSHOT_CMD)), | 85 | Key::new(&[MODKEY], keycodes::S, KeyAction::Spawn, Arg::Array(SCREENSHOT_CMD)), |
| 84 | Key::new(&[MODKEY], keycodes::D, KeyAction::Spawn, Arg::Array(DMENU_CMD)), | 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 | continue; | 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 | println!( | 101 | println!( |
| 102 | - " -> Managing window, tagging with {:b}", | 102 | + " -> Managing VIEWABLE window, tagging with {:b}", |
| 103 | self.selected_tags | 103 | self.selected_tags |
| 104 | ); | 104 | ); |
| 105 | self.windows.push(window); | 105 | self.windows.push(window); |
| 106 | self.window_tags.insert(window, self.selected_tags); | 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 | } else { | 130 | } else { |
| 108 | println!(" -> Skipped (map_state={:?})", attrs.map_state); | 131 | println!(" -> Skipped (map_state={:?})", attrs.map_state); |
| 109 | } | 132 | } |
| @@ -371,6 +394,7 @@ impl WindowManager { | |||
| 371 | } | 394 | } |
| 372 | Ok(None) | 395 | Ok(None) |
| 373 | } | 396 | } |
| 397 | + | ||
| 374 | fn apply_layout(&self) -> Result<()> { | 398 | fn apply_layout(&self) -> Result<()> { |
| 375 | let screen_width = self.screen.width_in_pixels as u32; | 399 | let screen_width = self.screen.width_in_pixels as u32; |
| 376 | let screen_height = self.screen.height_in_pixels as u32; | 400 | let screen_height = self.screen.height_in_pixels as u32; |