Well, I've switched to KDE now

David L idht4n at gmail.com
Fri May 6 14:25:35 UTC 2011

On Wed, May 4, 2011 at 8:23 PM, David L wrote:
> One thing
> I do is query the screensaver in a cron job to log
> my consulting hours.  So I figured I'd attempt to use
> a portable way of doing that, so I tried:
> xdg-screensaver status
FWIW, this seems to work to query screensaver status in KDE:

qdbus org.freedesktop.ScreenSaver /ScreenSaver

That can be combined with this wmctrl command:

wmctrl -d | awk '($2=="*"){print}' |awk '{for
(x=10;x<=NF;x++){printf("%s ",$x)}}'

to get the name of the active desktop, which can be used
to log what you were doing at any given time.  I find this
very useful for logging hours if I name my desktops by
the projects I'm working on.


More information about the test mailing list