1

I'm trying to write myself a little function to help me keep track of what I'm doing, the idea being that in each workspace I have a different task underway, and a different "todo.txt" file for each workspace. I can certainly specify, when I call the command, which workspace I'm in, but I'd really like to automatically detect which and alter the appropriate file.

Is there any way to determine which workspace I'm in from the command line, so I can use it in a bash function?

Narfanator
  • 5,595
  • 3
  • 39
  • 71

2 Answers2

3

xprop -root -notype _NET_CURRENT_DESKTOP

Chand Priyankara
  • 6,739
  • 2
  • 40
  • 63
1

If you're using metacity and python you can do something like this:

python -c "import wnck; s=wnck.screen_get_default(); s.force_update(); w=s.get_active_workspace();  w_num=w.get_number(); print(w_num);" 2>/dev/null
wajiw
  • 12,239
  • 17
  • 54
  • 73
  • Nope. Pure Bash. Not sure I am allowed to get Python working on this machine, as it's a work machine and they're a bit restrictive as to what I can install. – Narfanator Dec 15 '10 at 01:53