aboutsummaryrefslogtreecommitdiff
path: root/src/input.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/input.rs')
-rw-r--r--src/input.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/input.rs b/src/input.rs
index 955c63f4..c1e335dd 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -103,6 +103,13 @@ impl State {
// here.
self.niri.layout.advance_animations(get_monotonic_time());
+ // Power on monitors if they were off.
+ // HACK: ignore key releases so that the power-off-monitors bind can work.
+ if !matches!(&event, InputEvent::Keyboard { event } if event.state() == KeyState::Released)
+ {
+ self.niri.activate_monitors(&self.backend);
+ }
+
let comp_mod = self.backend.mod_key();
match event {
@@ -139,6 +146,9 @@ impl State {
Action::Suspend => {
self.backend.suspend();
}
+ Action::PowerOffMonitors => {
+ self.niri.deactivate_monitors(&self.backend);
+ }
Action::ToggleDebugTint => {
self.backend.toggle_debug_tint();
}