Re: Perform actions before/after hibernating/suspending with acpid
Reply #13 –
I wanted to used acipd to run hooks.
At the moment since I do not close a lid or use other actions I do not need it.
I teste zzz hook it worked fine.
cat /etc/zzz.d/hook.sh
#!/bin/sh
case "$1" in
pre)
DISPLAY=:0 su -c 'playerctl pause' user
# Lock the screen only when suspending since I have disk encryption no need after hibernating
if [ "$ZZZ_MODE" = "suspend" ]; then
DISPLAY=:0 su -c '~/bin/lock-screen.sh' user &
fi
;;
post)
;;
esac
I am not sure about all the options here:
On Alpine I can run xorg without libseat/seatd and elogind, I do not know why.
They are not installed and there is no process.
zzz is in the AUR and it's quick to install:
aur/zzz 0.1.1-3 [installed] [2+] [0.00%] [11 Mar 2023]
A simple program to suspend or hibernate your computer