Re: Checking whether Gnome screensaver currently active

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

 



On 01/17/2011 04:25 PM, JB wrote:
> JB<jb.1234abcd<at>  gmail.com>  writes:
>
>> ...
> Google search: linux keyboard mouse activity
>
> Example:
> http://stackoverflow.com/questions/222606/detecting-keyboard-mouse-activity-in-linux

Thanks.  That little C program will (with a suitable value for the DISPLAY
environment variable) report the idle time when run from a cron job, but
what I really need is whether the screensaver is running (screen locked)
rather than how recently the cat might have stepped on my keyboard or
moved the mouse.  Sorry that I wasn't very clear about that before.

Right now, checking on the number of child processes of gnome-screensaver
still looks like my best bet:

     ssID=$(pgrep -n gnome-screensav)
     if [ "$ssID" ] && [ $(ps -g $ssID -o pid= | wc -l) -lt 2 ]; then
         # Screen saver enabled but not active
         ...
     fi

-- 
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux