Re: Detect screen-lock in shell/c++



On Mon, 2014-11-03 at 08:43 +0100, Mathieu Slabbinck wrote:
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

As far as I know, neither Unity nor gnome-shell use gnome-screensaver
anymore. In fact, gnome-screensaver has been closed for new bugs.

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?

What do you actually want to do? Why do you need to detect the screen
saver? Or do you need to detect that the screen is locked?




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