You are not logged in.
Hi everyone, I've read through the [power management suspend and hibernate](https://wiki.archlinux.org/index.php/Po … _hibernate), looked at some posts on this forum, and tried finding info on how to use systemd to go from sleep to hibernate automatically on a laptop (Dell XPS 13 9370). Specifically,
1) On lid close, or after 10 minutes of inactivity, put the system into suspend mode (low power state, fast start).
2) After another 20 minutes, hibernate (suspend-to-ram, no power state).
I've set up hibernate to work on its own, and can do a systemctl suspend-then-hibernate. However, I am unable to get the system to suspend-then-hibernate on a lid close event (trying to edit /etc/systemd/sleep.conf onlidclose event is futile, same issue [as this poster](https://bbs.archlinux.org/viewtopic.php … 8#p1815248).
I found this [post on using a oneshot service](https://gist.github.com/atmoz/17ad12742 … 035d511ce7) put the solution is very hacky- I'm surprised there isn't an easier way to go about this.
Thank you for your assistance.
Last edited by mhamrah (2019-11-18 14:12:59)
Offline
man 5 logind.conf
Offline
Thank you Seth. Do you suggest setting anything else beyond IdleAction and IdleActionSec? I'm curious if there are any recommendations wrt HandleLidSwitch in the laptop case and any issues with sleep.conf settings.
Offline
You want to set HandleLidSwitch to "suspend-then-hibernate" and HibernateDelaySec in sleep.conf (to "20min")
Don't forget to "systemctl restart systemd-logind"
Edit: the IdleAction will rely on a signal from the login session (gnome and i believe kde support this, hardly anything else does)
Last edited by seth (2019-11-17 22:20:01)
Offline
Perfect, thank you.
Offline
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline