I'd like to run a script if the XFCE session is locked and unlocked. Is there a way that I can intercept this and perform certain actions when the desktop is locked or unlocked?
I have found following solutions:
for Gnome – Run script on screen lock/unlock
for xscreensaver
– How do I run a script on unlock?
But I'm using light-locker
and no screen saver. I was trying to monitor DBUS but it doesn't seem the light-locker
emits any signals.
One option would be to modify xflock4
but that would help only with screen locking.
Is there any way for light-locker
?
Best Answer
The previous answer helped me write this fragment of bash script that handles Lock and Unlock session events for the current session. I use it to suspend browser processes when the session is locked and to resume them when it unlocks. Tested under Debian unstable (Xfce 4.12) Enjoy!