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]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux