You are not logged in.
Hi,
I'm running a newly installed Arch Linux with Gnome and would like to hybrid-sleep via systemd when pressing the power button. But somehow systemd does nothing.
Except systemd and gnome no other power management tools are installed: no pm-utils, laptop mode tools, tlp or acpid.
Both
systemctl suspend
systemctl hibernate
work fine.
When I close the laptop's lid it also goes to sleep as expected. But when I press the power button nothing happens.
journalctl -f
just displays:
Mär 31 18:04:47 my_computer systemd-logind[1402]: Power key pressed.
nothing else.
My logind.conf:
[my_user@my_computer systemd]$ cat /etc/systemd/logind.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# You can override the directives in this file by creating files in
# /etc/systemd/logind.conf.d/*.conf.
#
# See logind.conf(5) for details
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
InhibitDelayMaxSec=2
HandlePowerKey=hybrid-sleep
HandleSuspendKey=hybrid-sleep
HandleHibernateKey=hybrid-sleep
HandleLidSwitch=hybrid-sleep
HandleLidSwitchDocked=hybrid-sleep
PowerKeyIgnoreInhibited=yes
SuspendKeyIgnoreInhibited=yes
HibernateKeyIgnoreInhibited=yes
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
systemd-inhibit reports that Gnome is blocking the power key. That is the reason why I set PowerKeyIgnoreInhibited=yes in the logind.conf:
[my_user@my_computer systemd]$ systemd-inhibit
Who: korni (UID 1000/korni, PID 667/gnome-settings-)
What: handle-power-key:handle-suspend-key:handle-hibernate-key
Why: GNOME handling keypresses
Mode: block
Who: korni (UID 1000/korni, PID 667/gnome-settings-)
What: sleep
Why: GNOME needs to lock the screen
Mode: delay
Who: NetworkManager (UID 0/root, PID 271/NetworkManager)
What: sleep
Why: NetworkManager needs to turn off networks
Mode: delay
Who: Telepathy (UID 1000/korni, PID 751/mission-control)
What: shutdown:sleep
Why: Disconnecting IM accounts before suspend/shutdown...
Mode: delay
Who: GNOME Shell (UID 1000/korni, PID 720/gnome-shell)
What: sleep
Why: GNOME needs to lock the screen
Mode: delay
5 inhibitors listed.
Via dconf-editor under org.gnome.settings-daemon.plugins.power I have the following settings:
active true
button-hibernate nothing
button-power nothing
putton-sleep nothing
button-suspend nothing
critical-battery-action hibernate
idle-brightness 30
idle-dim true
priority 0
sleep-inactive-ac-timeout 7200
sleep-inactive-ac-type hibernate
sleep-inactive-battery-timeout 600
sleep-inactive-battery-type hibernate
(Yes, I would like gnome to handle critical battery events - if this is not in the way of a solution for the power button.)
To my understanding Gnome handles the power button but with PowerKeyIgnoreInhibited=yes systemd should ignore that and hybrid-sleep, right? Another approach could be to stop gnome from careing for the power button but I so far found only one solution (http://www.tomz.pl/linux/security/81-gdm-power-button), a path I hesitate to follow since I would like to use the other media buttons.
Any suggestions on
(a) why systemd does not ignore the inhibits or
(b) how to stop gnome from taking care of the power button?
Thank you!
Offline
Did not come closer to a solution. But is seems that since Gnome 3.14 media key handling (and I believe the power off button is counted towards them) shifted from gnome-settings-daemon into gnome-shell:
https://bugs.debian.org/cgi-bin/bugrepo … bug=771922
Haven't found any information yet, how gnome shell handles those keys...
Offline
Might be a little late, but I was having a similar problem and found that the "button-power" key in dconf (org.gnome.settings-daemon.plugins.power) got apparently replaced by a "power-button-action" key. Fantastic. So my suggestion for (b) would be to set this key to 'nothing'. Let me know if this helps. Did you find a solution to (a)? Cheers.
Offline