Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 )

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'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.