I am trying to write a bash script that needs some identifier of the current active desktop (I want my emacs-clients to connect to different servers depending on the active desktop). I have searched around and I can't seem to find a command that will get this information. Does such a thing exist?

migrated from stackoverflow.com May 26 '16 at 15:25

This question came from our site for professional and enthusiast programmers.


I'm not sure exactly what you mean by "active desktop", but the command "system_profiler" can generate a vast amount of information about your computer. Between it's various settings and text filtering, you should be able to pluck out almost anything need to know.

  • I'm sorry that was unclear. I mean the current Space (I can't tell if they stopped using that term in favor of desktop). I looked through system_profiler but it doesn't seem to have that kind of data. – qazmonk May 30 '16 at 17:03

You must log in to answer this question.

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