4

I want to set the system to go to hybrid-sleep after some idle time.

I have an option in System Settings -> Power to suspend.

How can I change it to hybrid-sleep?

  • Probably commandline only :P – Rinzwind Sep 17 '16 at 17:58
  • 1
    No. There is one way, but not a perfect one. I can change /lib/systemd/system/systemd-hybrid-sleep.servece to use hybrid-sleep. But there must be some way to change it in DE. – Pilot6 Sep 17 '16 at 18:03
  • No there isn't. systemd and pm-utils conflict. – Rinzwind Sep 17 '16 at 18:04
  • Why are you so sure? It is set somewhere either in source or in some config file. – Pilot6 Sep 17 '16 at 18:05
  • Simple: if there was a method in the DE to change it it would be in power management and it is not. systemd seems to be made as a replacement for all services in Linux (So not just Unity) but the creators also did not bother with the different DE's. Regarding "config file" unit files are kept in /etc/systemd/system with a copy in /lib/systemd/system – Rinzwind Sep 17 '16 at 18:15
3

I got an answer at Russian Ubuntu forums.

http://forum.ubuntu.ru/index.php?topic=282013.msg2221520#msg2221520

In /etc/systemd/logind.conf change

#IdleAction=ignore
#IdleActionSec=30min

to

IdleAction=hybrid-sleep
IdleActionSec=1800

For some reason 30min does not work. It works in seconds, that is OK.

Another option is to change the systemd.suspend service. It allows to use the GUI setting for idle timeout. But I do not recommend to use this one, since there is a perfect CLI solution.

I changed the systemd suspend service, but I do not think it is a perfect solution. But for a desktop without a UPS it may be a good option.

I changed a line in /lib/systemd/system/systemd-suspend.service from

ExecStart=/lib/systemd/systemd-sleep suspend

to

ExecStart=/lib/systemd/systemd-sleep hybrid-sleep
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.