How to get number and/or name (or tag/id... etc) of currently used virtual desktop ?
Command line, scripting, C/C++ solutions allowed (, while portable to C/C++ are preferred). ;)
I'm mostly interested in KDE and GNOME, as well as dwm, xmonad, awesome - solutions for other desktop environments are welcome (I would love to support as much as I can, in order to provide as universal solution as possible).
Btw. For those interested, To be more specific about usecase: I'm interested in timetracking oriented around desktop + windows focus + xevents + multiplescreen. Currently there exist separate solutions for this (ktimetracker tracks tasks depending on desktops, while it's app tracking is very poor - no regular expressions support, just exact window titles -> not very usefull. On the other hand, workrave tracks keyboard and mouse activity, but is unaware of desktop->task I work on.), I'd like to do something, that merges those information in order to achieve more precise picture (maybe incorporating Association rule learning or other Data mining technique) of activities I have (in order to achieve more precise information related with my habits, in order with "ant-RSI fight" ;) ).
So if your desktop follows in different paradigm, than "Virtual Desktop + Windows (with Names and Titles)" please, show code/cli snippet, that shows information about currently used window/frame/app + currently selected desktop/task/tags (eventually screen).
awesomeis going to play a different game. That's why I use and is the one that specifically handles VD's using an entirely different paradigm. I thinkxmonadanddwmare much like it. They are known as dynamic or framework managers and don't have the kind of desktop paradigm that Gnome/KDE based WM's typically do. You can probably come up with something that works across stock Gnome/KDE/XFCE ... however I would seriously question whether you are on the right track at all. It sounds like you are trying to work this problem backwards.arbtt: "arbtt is a background daemon that stores which windows are open, which one has the focus and how long since your last action (and possibly more sources later), and stores this. It is also a program that will, based on expressive rules you specify, derive what you were doing, and what for."