diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-05 09:40:54 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-05 10:03:51 +0300 |
| commit | cd90dfc7be11147936c2b637ae822ff0adf5a7b7 (patch) | |
| tree | fc156451b6c25d454194fbe885eacf455a649c32 /src/input | |
| parent | a778ab38977b99edb79275cf3ad2ddffa24044f7 (diff) | |
| download | niri-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.rs | 7 |
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()) |
