Reputation: 5813
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?
Upvotes: 1
Views: 1329
Reputation: 12269
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
Upvotes: 1