Trying to trigger xautolock from opening lid to laptop
Hello,
I've managed to get xautolock to trigger Suckless.org's "slock" after 15 minutes of idling from my xinitrc. However, I'm having a hard time figuring out how to have the screen locked after shutting and opening the lid of my laptop. I found the lid action on a previous thread, so I managed to get pm-suspend working. I tried adding the following to my /etc/acpi/events/lid file to no avail.. not sure what I'm missing or if I'm just attempting this from the wrong location. As I type this I'm thinking maybe I need to reverse and have it called on wake? Code:
event=button/lid LID close |
The problem you have is that the acpid events are handled outside of the users X process environment, so slock running in the event handler will have no connection to the user or the Xserver.
The way to workaround that is to have the acpid handler send some sort of signal to a screenlocker daemon process running within the users X environment. A quick and dirty one knocked up in shellscript might look something like this: /usr/local/bin/lid-locker: Code:
#!/bin/sh pkill --signal USR1 -x lid-locker There might be more modern ways of doing something like this involving udev, or dbus, but I don't have much knowledge of those. Hope that gives you some ideas. |
That makes sense, I'm going to play around with this script idea and see if I can get it working. For the moment I figured out how to setup a shortcut to trigger slock with F12 in dwm before I close the lid. Thanks! I will report my luck.
|
All times are GMT -5. The time now is 10:46 PM. |