Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Change behaviour on pressing the power button (Read 1412 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Change behaviour on pressing the power button

How do I make my laptop suspend when the power button is pressed, instead of shutting down (the default behaviour)? The arch wiki explains how to do this easily with systemd (https://wiki.archlinux.org/index.php/Power_management#Power_management_with_systemd), but I'm not really sure how to do it with runit. I'm able to detect the power button keypress using acpid (https://wiki.archlinux.org/index.php/acpid), but even if I change the handler to suspend (using echo -n mem >/sys/power/state), it suspends when I press the button but it shuts down immediately after waking up. Essentially, the default behavior is not getting overriden, acpid is just adding additional steps to do before shutting down. So how do I do this with runit?

Re: Change behaviour on pressing the power button

Reply #1
I would say it is eaither caused/managed by your power manager or by elogind.

elogind can be configured at
Code: [Select]
/etc/elogind/logind.conf
/etc/elogind/logind.conf.d/
and maybve some other places (see manual pages)

 

Re: Change behaviour on pressing the power button

Reply #2
Damn, that worked perfectly. Thank you so much!