From cd90dfc7be11147936c2b637ae822ff0adf5a7b7 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 5 Nov 2024 09:40:54 +0300 Subject: Disable laptop panel when the lid is closed --- src/input/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/input') 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()) -- cgit