swaywm / swayidle

Idle management daemon for Wayland
MIT License
550 stars 50 forks source link

Additional option for the lid switch of laptops #103

Closed Kilobyte22 closed 3 years ago

Kilobyte22 commented 3 years ago

I propose two additional options lid-close and lid-open, which are triggered when the lid of a laptop is closed. A good example of a usecase would be to start a lock screen, even when a device is not configured to go to sleep when when it is closed. You could also start a timer to lift an inhibitor, and cancel said timer in the lid-open callback, allowing to delay suspend after closing the lid.

emersion commented 3 years ago

swayidle doesn't have access to lid events. Instead, your compositor (e.g. Sway) can be configured to run a command on lid switch events.