I'm using debian stretch
and KDE
. In the settings I have specified that pressing the power button suspends the system. That works great, when I'm logged in. However it does not suspend the system on the login screen.
If I accidentally wake up the system, I want to send it right back to sleep without having to log in first. Is there an easy way to achieve this?
1 Answer
Solution 1: Change or set the display manager
You can install lightdm
as display manager even with KDE [1].
Indeed it is stated [2] that
lightdm
does support suspend on lid closure independently as a built in function. It will work with all greeters. The greeters also have a button to initiate suspend or hibernate manually.
So, as simpler workaround, you can install it and suspend the computer closing the lid or clicking the suspend button.
Solution 2: logind.conf
You can try to change the default line in /etc/systemd/logind.conf
#HandlePowerKey=poweroff # default
HandlePowerKey=suspend # your choice note: uncomment it deleting the `#`
Ad Nauseam...
In general it is possible to remap each key of the keyboard.
- If you are able to do from the bios... well it will work with each operative system
Since you want that it works without logging in kde or gnome, it is convenient to find a cosy display manager (kdm, lxdm, slim, xdm,
lightdm
, gdm...) check for them...
(I know it is the solution 1).You can remap each key of the keyboard,
with
xmodmap
[3]xmodmap - utility for modifying keymaps and pointer button mappings in X
for example [4] with
dconf-tools
you can set the action for the power button press (that I think you have done in KDE, but there is the risk that the display manager didn't get it).- with
gsettings
[5] you can remap by commandline (and put as one of the duty of the startup)
-
Ideally I would like to use sulution 2 as I don't have to install additional software. I found and edited the
logind.conf
file, but I still can't suspend the system from the login screen. Any idea why? I found out, that I'm using thegdm
display manager.– BenApr 12, 2016 at 10:01 -
Check in the BIOS, it's the 1st loaded and it can override some behaviour. BTW in [ref. 2] it is stated "gdm does support suspend on lid closure but it requires gnome-power-manager to be installed. When configuring gnome-power-manager check the use as default box and the same settings will be used by gdm. " Since you are using KDE, you can incur in compatibility problem (or massive installation) when you ask gnome components. I still suggest to try with
lightdm
: it's only the "welcome and login screen"...– HasturApr 12, 2016 at 10:42
lightdm
?kdm
? ...KDE
environment. Any tips on how to clean that up would be appreciated!