You are not logged in.
Hello,
I am using i3wm on Arch Linux. I set xss-lock to be auto start through i3 config. I use a fork of i3lock called i3lock-fancy to lock the machine. Since I am on a laptop I need to be able to run a script when the lid is closed. That script basically does is lock the screen and suspend the machine.
The line in i3 config.
exec --no-startup-id xss-lock --transfer-sleep-lock -- ~/.config/i3/lidclose.sh --noforklidclose.sh
playing = (`pacmd list-sink-inputs | grep -c 'state: RUNNING'`)
if [ $playing -eq 0 ]
then
~/.config/i3/suspend.sh
else
~/.config/i3/lock.sh
filogind.conf
HandleLidSwitch=ignoreWhen I close the lid it does nothing. And I also checked whether xss-lock is running and it is running.
What's wrong here. Please help with this.
Thank you.
Last edited by pvsakith (2020-07-18 05:20:24)
Offline
xss-lock
xss-lock subscribes to the systemd-events suspend, hibernate, lock-session, and unlock-session with appropriate actions (run locker and wait for user to unlock or kill locker). xss-lock also reacts to DPMS events and runs or kills the locker in response.
Where does the systemd event com from?
You might want to use acpid instead (because you want a conditional response to the HW event)
Offline
playing = (`pacmd list-sink-inputs | grep -c 'state: RUNNING'`)
Is this supposed to be a shell script? Have you tested it at all? At a minimum, you need to remove the spaces around the '='.
And your usage of brackets and backticks makes very little sense. Please use "$(...)" instead.
Offline
Thanks however I resolved the issue by setting the HandleLidSwitch=lock. Idk how but it worked. No xss-lock will run my script.
Offline