aboutsummaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-11-05 09:40:54 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-11-05 10:03:51 +0300
commitcd90dfc7be11147936c2b637ae822ff0adf5a7b7 (patch)
treefc156451b6c25d454194fbe885eacf455a649c32 /src/input
parenta778ab38977b99edb79275cf3ad2ddffa24044f7 (diff)
downloadniri-cd90dfc7be11147936c2b637ae822ff0adf5a7b7.tar.gz
niri-cd90dfc7be11147936c2b637ae822ff0adf5a7b7.tar.bz2
niri-cd90dfc7be11147936c2b637ae822ff0adf5a7b7.zip
Disable laptop panel when the lid is closed
Diffstat (limited to 'src/input')
-rw-r--r--src/input/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs
index 9936102e..ffd62059 100644
--- a/src/input/mod.rs
+++ b/src/input/mod.rs
@@ -2434,6 +2434,13 @@ impl State {
return;
};
+ if switch == Switch::Lid {
+ let is_closed = evt.state() == SwitchState::On;
+ debug!("lid switch {}", if is_closed { "closed" } else { "opened" });
+ self.niri.is_lid_closed = is_closed;
+ self.reload_output_config();
+ }
+
let action = {
let bindings = &self.niri.config.borrow().switch_events;
find_configured_switch_action(bindings, switch, evt.state())