You are not logged in.
I'm trying, ideally, to get closing my laptop's lid to suspend the computer if on battery power, and to do nothing if on AC. Currently, closing the lid suspends regardless.
I have acpid and pm-utils installed.
My first task, therefore, is to stop the computer from sleeping when I close the lid.
However, this has proved harder than I thought. I've commented out the file /etc/acpi/actions/pm_lid, and in /etc/systemd/logind.conf, I've changed the value of HandleLidSwitch to ignore:
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#Controllers=
#ResetControllers=cpu
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=ignore
#HandleHibernateKey=hibernate
#HandleLidSwitch=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30minand restarted the logind service and acpi with systemctl.
That didn't work, so I rebooted the machine to see if the settings hadn't carried over, but that didn't work either.
So, my question is, what else could be governing my laptop's behaviour when the lid is closed?
Last edited by Gazok (2013-06-04 19:27:54)
Offline
You have to uncomment the line which contains HandleLidSwitch (i.e. remove the #).
In order to achieve the behaviour you mentioned (only suspend when on battery, do nothing if on ac) you can do a little bash scripting in /etc/acpi/handler.sh: Check if the power cable is connected (depends on your machine, something like
$ cat /sys/class/power_supply/ADP1/online) and suspend if not in the close) case inside the button/lid) case.
Last edited by diiis (2013-06-04 20:04:57)
Offline
Oh, well, now I feel silly.
It had occurred to me, but something I read in either a forum post or a wiki somehow convinced me that it was fine as it was.
Thanks a bunch.
Offline