Detect screen-lock in shell/c++



I have a cross-platform application that runs on Ubuntu 14.04 (Unity & GNome) & Fedora (GNome). There I need to determine if the screensaver is active or not and if the screen is locked or not.

I found out that I can get the screensaver info with: gnome-screensaver-command -q

But I cannot seem to figure out how I can detect a screen lock. For example on Unity I can use:

gdbus call -e -d com.canonical.Unity -o /com/canonical/Unity/Session -m com.canonical.Unity.Session.IsLocked

but that's a Unity-specific item. So what's the best approach to get screen lock in GNome?

Grtz

Mathieu



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]