diff options
| author | Duncan Overbruck <mail@duncano.de> | 2025-03-27 19:38:14 +0100 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-05-10 12:14:41 -0700 |
| commit | 9d3d7cb0e973827e5fcaa5d312a05695564a44c0 (patch) | |
| tree | d8b340220a4127d79a18d2e634ce80d13dd6048c /src/input | |
| parent | 398bc78ea073e0e61c6ba67ddcbaad0a5d574eeb (diff) | |
| download | niri-9d3d7cb0e973827e5fcaa5d312a05695564a44c0.tar.gz niri-9d3d7cb0e973827e5fcaa5d312a05695564a44c0.tar.bz2 niri-9d3d7cb0e973827e5fcaa5d312a05695564a44c0.zip | |
add {toggle,set,unset}-urgent cli actions
Diffstat (limited to 'src/input')
| -rw-r--r-- | src/input/mod.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs index 1f790f16..1204ff5b 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -1971,6 +1971,37 @@ impl State { self.niri.queue_redraw_all(); } } + Action::ToggleUrgent(id) => { + let window = self + .niri + .layout + .workspaces_mut() + .find_map(|ws| ws.windows_mut().find(|w| w.id().get() == id)); + if let Some(window) = window { + let urgent = window.is_urgent(); + window.set_urgent(!urgent); + } + } + Action::SetUrgent(id) => { + let window = self + .niri + .layout + .workspaces_mut() + .find_map(|ws| ws.windows_mut().find(|w| w.id().get() == id)); + if let Some(window) = window { + window.set_urgent(true); + } + } + Action::UnsetUrgent(id) => { + let window = self + .niri + .layout + .workspaces_mut() + .find_map(|ws| ws.windows_mut().find(|w| w.id().get() == id)); + if let Some(window) = window { + window.set_urgent(false); + } + } } } |
