Detecting which workspace you're in from the command line
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?
xprop -root -notype _NET_CURRENT_DESKTOP
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
精彩评论