How can I determine what gnome desktop number a gnome terminal is connected to?

1

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 https://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?

Ross Rogers

Posted 2010-04-29T18:06:58.457

Reputation: 3 025

are you particularly looking for a commandline interface? – quack quixote – 2010-04-29T18:24:35.387

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 – 2010-04-30T22:56:59.183

Answers

0

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

Ross Rogers

Posted 2010-04-29T18:06:58.457

Reputation: 3 025