I'm looking for a cross Linux method to detect if screensaver (both XScrenSaver and non-XSCreenSaver) is running or if locked screen is up. Bash or C method would be awesome. Can you please help me find this method?
I was going by this x11 method here:https://askubuntu.com/questions/567309/methods-to-detect-screensaver-and-or-locked (spent two weeks on it!: https://github.com/Noitidart/_scratchpad/blob/master/ScreensaverWindowExists%20addon%20test%20template.js)
But that method fails on Ubuntu (and maybe Mint) which are the most common Linux distributions.