Search code examples
linuxx11screensaverkde-plasma

How to check if screen saver is running?


I have a script written in bash, which I need to take different route in case screensaver is currently running. This is Linux with Xorg and KDE. Script is called from cron, and it connects to DISPLAY=:0.

Any hint/idea how to check for state of screensaver?


Solution

  • Apparently when running screensaver, aside from screensaver binary, there is also this process running:

    /usr/lib/kde4/libexec/kscreenlocker
    

    So, I can simply do ps uw -C kscreenlocker and check results.