You are not logged in.
Pages: 1
Topic closed
The current state of my power button is, that if I press it, it will shut down my PC. But, it is inconvenient for me, I want it to sleep instead of powering it off. How can I change this? These are some specs that might help.
Laptop Model: HP ProBook 440 G4
Window Manager: Dynamic-Window Manager (DWM)
Offline
https://wiki.archlinux.org/title/Power_ … th_systemd
note that for these to work properly you need to initialize your session correctly so if you are using .xinitrc to start dwm you need to ensure you follow https://wiki.archlinux.org/title/Xinit#xinitrc as well.
Last edited by V1del (2021-10-26 09:22:26)
Offline
The ProBook has a sleep button on the keyboard: that's at least worth a try getting used to.
--
saint_abroad
Offline
I don't have such a sort of button...
My PC is borrowed, & I am telling the model name by the neofetch output
Offline
https://wiki.archlinux.org/title/Power_ … th_systemd
note that for these to work properly you need to initialize your session correctly so if you are using .xinitrc to start dwm you need to ensure you follow https://wiki.archlinux.org/title/Xinit#xinitrc as well.
Thanks, this is working!
I did `HandlePowerKey=suspend` in /etc/systemd/logind.conf
then did
`systemctl kill -s HUP systemd-logind`
After this, pressing power button is only suspending it
Offline
Can HandlePowerKey=suspend be done at user level ? Caz GNOME was able to do within their settings. It somehow exposed that config to the user. Can it also be done in other DEs/WMs like when using sway ?
Offline
Please add [Solved] to your subject so that others know there is nothing left to answer.
--- asyync1024
Offline
No - and please don't necrobump.
gnome inhibits the event and does other stuff w/ its own acpi/shortcut daemon, https://wiki.archlinux.org/title/Power_ … r_managers
Whether your shortcut daemon of choice handles the power key you'll have to figure.
Caz GNOME was …
"cuz" …
Edit:
@LinuxLover471
it's unlikely that the OP still frequents the forum, but the thread will likely be closed by some mod.
Last edited by seth (2025-07-20 15:21:40)
Offline
Yeah, the OP has not been around for almost four years. I am going to go ahead and close this.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Pages: 1
Topic closed