469,343 Members | 5,388 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,343 developers. It's quick & easy.

Detect current virtual desktop

Hello Pythonists,

I'd like to write for myself a tiny program that counts time spent on each
virtual desktop (in GNOME). In order to do that, I need my program to
detect the current virtual desktop. I've googled for it for about one hour
and couldn't find any solution. The closest thing I found is set of
tutorials: http://www.pygtk.org/articles.html Unfortunately, none of them
answers my questions:

How to detect current virtual desktop in GNOME? How to detect a virtual
desktop change?

--
http://automatthias.wordpress.com
Aug 21 '06 #1
2 2124
Maciej Bliziński wrote:
How to detect current virtual desktop in GNOME? How to detect a virtual
desktop change?
Take a look at http://wallpapoz.sourceforge.net/
Harald
Aug 21 '06 #2
On Mon, 21 Aug 2006 12:52:59 +0200, Harald Karner wrote:
Maciej Bliziński wrote:
>How to detect current virtual desktop in GNOME? How to detect a virtual
desktop change?
Take a look at http://wallpapoz.sourceforge.net/
Harald, many thanks.

By the way, I have found the line of code I was interested in. It is
stunningly simple, just calls the xprop command:

os.popen('xprop -root _NET_CURRENT_DESKTOP').read()

--
http://automatthias.wordpress.com

Aug 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by Jim Hubbard | last post: by
9 posts views Thread by Tim | last post: by
reply views Thread by =?Utf-8?B?am1hZ2FyYW0=?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.