diff options
Diffstat (limited to 'crates/core/src/event.rs')
| -rw-r--r-- | crates/core/src/event.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/core/src/event.rs b/crates/core/src/event.rs index 9b464b5..eb2d8aa 100644 --- a/crates/core/src/event.rs +++ b/crates/core/src/event.rs @@ -60,4 +60,11 @@ pub enum Event { MouseMotion { x: i32, y: i32 }, MonitorAdded(Monitor), MonitorRemoved(MonitorId), + /// The laptop lid was closed or opened. Emitted by the udev backend from + /// libinput switch events; `closed` is true when the lid is shut. + /// + /// Exposed to config as `srd.on_lid("closed"/"open", fn)` so a session + /// can lock and suspend, which is otherwise impossible: a laptop that + /// does nothing on lid-close is a real problem, not a nicety. + LidSwitch { closed: bool }, } |