mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
add {toggle,set,unset}-urgent cli actions
This commit is contained in:
committed by
Ivan Molodetskikh
parent
398bc78ea0
commit
9d3d7cb0e9
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user