Automatic hibernate and on lid close on manjaro gnome

Hi, manjaro gnome does not suffer from random freezes like manjaro kde, so I switched to gnome

how to hibernate to disk on lid close and automatically when not in use in a period of time ?

hibernate to disk on power button press works

Hello @ahmed-derbala and welcome :wink:

File: /etc/systemd/logind.conf

HandleLidSwitch=hibernate

File: /etc/systemd/logind.conf

HandleLidSwitch=suspend-then-hibernate

File: /etc/systemd/sleep.conf

HibernateDelaySec=180min

Test it: sudo systemctl suspend-then-hibernate

:notebook: This works not everywhere and depends on firmware support.

:notebook: Gnome3 has no GUI support for handling this. It has only “suspend after a period of time”.

2 Likes

FYI, hibernation is not enabled by default and requires manual setup. See Power management/Suspend and hibernate - ArchWiki

thank you
I see no /etc/systemctl/logind.conf file already created, even /etc/systemctl does not exist
do you mean /etc/systemd/logind.conf ?

i already tested these values in /etc/systemd/logind.conf
HandleLidSwitch=hibernate
HandleLidSwitchExternalPower=hibernate
HandleLidSwitchDocked=hibernate
IdleAction=hibernate
IdleActionSec=30min

but it seems that /etc/systemd/logind.conf is being ignored. i removed # on the start of each of these lines

the option in settings > power > power button behavior > set to hibernate works , so when i press power button, my pc hibernate successfully and i can resume after

in KDE, automatic hibernate and hibernate on lid close were working flawlessly

Did you reboot afterward?

FYI, it’s better to use an override in /etc/systemd/logind.conf.d/ instead of directly editing the original file; i.e., /etc/systemd/logind.conf.d/custom.conf. See logind.conf(5) — Arch manual pages

yes, i rebooted
with creating /etc/systemd/logind.conf.d/logind.conf now my pc goes to hibernate after 30 minutes , but lid close still doesnt work

Is there a way to replicate the same behavior for the normal menu shutdown or the power button press, not just the lid closing?

For the button press, I tried adding
HandlePowerKey=suspend-then-hibernate
to “/etc/systemd/logind.conf” but that didn’t work. I’m using Manjaro gnome too.

to hibernate on buton press, you can choose in settings > power > power button behavior

creating /etc/systemd/logind.conf.d/logind.conf.d fixed the issues

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.