Dearest Manjaro Gnome users,
I fiddled around a lot the last weeks with my notebook and some suspend issues.
Gnome, Manjaro Testing, Wayland, Nvidia 2070 GPU.
Now it works.
The solution was, that I needed to understand, that Gnome 48 as well as systemd>256 are managing the suspend process on “lid close”. And that this “we do it both” is sometimes not working.
Suspend on lid-close on my notebook now works perfect with
- systemd managing the suspend process and
- Gnome power management disabled on some parts, e.g. lid close
What was the issue?
After dealing with the pure nvidia parts, suspend was working always through “systemctl suspend” in a terminal.
On lid-close suspend was … sometimes working - sometimes (most of the times) not.
This is solved with
dconf write /org/gnome/settings-daemon/plugins/power/lid-close-ac-action “‘nothing’”
and
dconf write /org/gnome/settings-daemon/plugins/power/lid-close-battery-action “‘nothing’”
and
configuring systemd to handle the lid-switch in the file
sudo nano /etc/systemd/logind.conf.d/logind.conf
[Login]
SleepOperation=suspend-then-hibernate suspend hibernate
HandlePowerKey=suspend
HandlePowerKeyLongPress=poweroff
HandleRebootKey=reboot
HandleRebootKeyLongPress=poweroff
HandleSuspendKey=suspend
HandleSuspendKeyLongPress=hibernate
HandleHibernateKey=hibernate
HandleHibernateKeyLongPress=ignore
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=ignore
HandleSecureAttentionKey=secure-attention-key
IdleAction=suspend-then-hibernate
IdleActionSec=30min
This configuration makes Gnome “do nothing” on lid close, and let systemd take over the job. Without the above dconf entries, Gnome takes over the suspend part, and systemd is doing nothing.
The systemd configuration might still not be perfect for all the keys on my usb keyboard, but it works on lid close - suspend is working since 3 days as it should - and I tried a lot to break it …
Probably this might help someone as well.
Happy to get additions, corrections, comments if something is not correct stated or could be done better.