Watch screensaver on Linux XFCE desktop and toggle a helper on/off

One little automation I’ve just ported over from my old Openhab setup to my new Home Assistant is this code that runs on my Linux desktop machine to turn on a presence toggle for my office. Since I leave my workstation on all the time, it simply watches for screensaver on and screensaver off events on the dbus, and switches a toggle helper off and on respectively. The dbus keyword its looking for is org.xfce.ScreenSaver, but this could probably be changed for other desktop environments and work without much tweaking.

If anyone finds this little code snippet useful, please let me know!

1 Like