You are not logged in.
I'm interested in using systemd-inhibit to keep my laptop from sleeping when the lid closes for certain situations. When I run the command below, the laptop will still go to sleep when I close the lid. Am I calling the command wrong?
systemd-inhibit --what=handle-lid-switch i3lock -n
# the -n flag indicates no i3lock forking
Lenovo X200
$ uname -a
Linux bns-kharselim 4.7.1-1-ARCH #1 SMP PREEMPT Wed Aug 17 08:13:35 CEST 2016 x86_64 GNU/Linux
Thanks.
Last edited by CTAG (2016-10-04 18:38:32)
Offline
We don't know how you're calling systemd-inhibit. As root? Is the DISPLAY variable available? Do you have polkit installed? Does the i3lock command run successfully from the shell you've run systemd-inhibit from?
Last edited by Alad (2016-08-23 22:16:33)
Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Offline
The command doesn't work as either my own user or root.
DISPLAY is set to :0.
i3lock runs successfully, I've also tried substituting other programs like geany.
$ pacman -Qs polkit
local/polkit 0.113-4
Application development toolkit for controlling system-wide privileges
local/polkit-kde 0.99.0-6
Daemon providing a polkit authentication UI for KDE
local/polkit-qt4 0.112.0+git20160226-1
A library that allows developers to access PolicyKit API with a nice Qt-style API
local/polkit-qt5 0.112.0+git20160226-1
A library that allows developers to access PolicyKit API with a nice Qt-style API
Thanks.
Offline
I confirm that systemd-inhibit doesn't work for me either.
EDIT: Found a probably related bug report on launchpad: https://bugs.launchpad.net/ubuntu/+sour … ug/1615612
Last edited by orestisf (2016-08-25 10:45:56)
Offline
Sorry if I'm resurrecting a dead thread, but I just ran into this issue and I found a solution.
Turns out in /etc/systemd/logind.conf, LidSwitchIgnoreInhibited defaults to yes.
Uncomment the line, set it to no, and restart fixes the issue for me.
Last edited by joehillen (2016-10-04 18:54:15)
Offline
This appears to have solved the problem for me.
Thank you, joehillen.
Offline