How to check if the screen saver works?

I have a script written in bash that I need to use differently if the screensaver is currently running. This is Linux with Xorg and KDE. The script is called from cron and connects to DISPLAY =: 0.

Any hint / idea how to check the status of the splash screen?

+3
source share
2 answers

Apparently, when launching the screensaver, in addition to the binary screensaver file, this process is also performed:

/usr/lib/kde4/libexec/kscreenlocker

So, I can just do ps uw -C kscreenlockerand check the results.

+3
source

If you are using KDE4, you can use dbus to check if the screen saver works:

$ qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.GetActive

or

$ qdbus org.kde.screensaver /ScreenSaver org.freedesktop.ScreenSaver.GetActive

gnome, , FreeDesktop, :

$ qdbus org.gnome.ScreenSaver /ScreenSaver org.gnome.ScreenSaver.GetActive

, : , X XScreenSaverQueryInfo() .

+6

Source: https://habr.com/ru/post/1777960/


All Articles