logind.conf not working, closing lid will not suspend laptop
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Switch On Looping
--
Chapters
00:00 Logind.Conf Not Working, Closing Lid Will Not Suspend Laptop
01:51 Accepted Answer Score 3
02:07 Answer 2 Score 3
02:46 Answer 3 Score 4
03:29 Thank you
--
Full question
https://superuser.com/questions/958594/l...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #laptop #gnome3 #suspend #fedora22
#avk47
ANSWER 1
Score 4
In my case (xubuntu 20.04), I had logind.conf allright like so:
$> sudo cat /etc/systemd/logind.conf |grep Lid
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=suspend
LidSwitchIgnoreInhibited=yes
BUT what was "inhibiting logind from doing its job I had to figure with this command:
$> systemd-inhibit --list --mode=block
WHO UID USER PID COMM WHAT WHY >
xfce4-power-manager 1000 riccardo 1838 xfce4-power-man handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch xfce4-power-manager handles these eve>
1 inhibitors listed.
Clearly the xfce4-power-manager was messing.
I opened sfce4-settings-manager -> Power Manager and there I found there were two options for Lid closed on docked or undocked laptop which I had to configure to "suspend". Did that and all worked all right.
ACCEPTED ANSWER
Score 3
I have solved the problem by removing ignore-lid-switch-tweak program from startup programs.
From terminal run: gnome-session-properties then remove ignore-lid-switch-tweak.
ANSWER 3
Score 3
I arrived here because I had the opposite problem (lid closing was not being ignored, which is what I needed).
I had solved this issue once before, but it seems the latest versions of Fedora (I'm on Fedora 28 now), requires these two entries now, whereas before only the first one was necessary:
user$ sudo vi /etc/systemd/logind.conf
HandleLidSwitch=ignore <---- Set both of these
HandleLidSwitchDocked=ignore <---- to ignore lid events.
user$ sudo systemctl restart systemd-logind
I hope that helps someone else. Please don't downvote because I added a solution for the opposite problem. :)