Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In KDE's Konsole, I can do the following from the terminal:

dcop kwin KWinInterface currentDesktop

And it will tell me which desktop my terminal is connected to

( per http://stackoverflow.com/questions/738059/in-kde-how-can-i-automatically-tell-which-desktop-a-konsole-terminal-is-in/745250#745250 )

How can I determine what desktop number the current gnome terminal in a gnome session is connected to?

share|improve this question
    
are you particularly looking for a commandline interface? – quack quixote Apr 29 '10 at 18:24
    
Preferably. Otherwise I can compile some code and have that return a number on the command line. The problem with compiling code is external dependencies. We have an old Linux environment and people always post code that depends on new APIs. – Ross Rogers Apr 30 '10 at 22:56
up vote 0 down vote accepted

Per hints on this page and the XLib variable _NET_CURRENT_DESKTOP from this answer, I determined that the following would work:

% xprop -root | egrep '^_NET_CURRENT_DESKTOP'
_NET_CURRENT_DESKTOP(CARDINAL) = 0
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .