LukeShortCloud / rootpages

Root Pages is a collection of easy-to-reference tutorials and guides primarily for Linux and other UNIX-like systems.
Other
55 stars 6 forks source link

[computer_hardware] Handle power button #1120

Open LukeShortCloud opened 4 months ago

LukeShortCloud commented 4 months ago

Configure systemd-login to change the behavior of the power related buttons. All of the buttons that can be managed:

HandlePowerKey=, HandlePowerKeyLongPress=, HandleRebootKey=, HandleRebootKeyLongPress=, HandleSuspendKey=, HandleSuspendKeyLongPress=, HandleHibernateKey=, HandleHibernateKeyLongPress=, HandleLidSwitch=, HandleLidSwitchExternalPower=, HandleLidSwitchDocked=

A "LongPress" is holding down the button for 5 seconds.

All of the allowed options: Can be one of "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate", "lock", and "factory-reset"

https://www.freedesktop.org/software/systemd/man/latest/logind.conf.html