2

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?

4
  • Which login manager do you have? lightdm ? kdm ? ...
    – Hastur
    Apr 1, 2016 at 18:15
  • I'm not really sure, I'll check once my computer is back up. The initial login is also messed up. When I log in, it tries to load something, fails and then loads the usual KDE environment. Any tips on how to clean that up would be appreciated!
    – Ben
    Apr 1, 2016 at 18:22
  • Workaround posted... Easyness is an arbitrary concept... BTW it is not possible to set from the BIOS too (it is Motherboard dependent)?
    – Hastur
    Apr 1, 2016 at 18:30
  • Updated answer, I think you should find something working for you.
    – Hastur
    Apr 1, 2016 at 18:59

1 Answer 1

1

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)
2
  • 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 the gdm display manager.
    – Ben
    Apr 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"...
    – Hastur
    Apr 12, 2016 at 10:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .