#!/usr/bin/env python # # Written by nigeltao@gnome.org. # Released into the public domain on January 2007. # # This program changes the active workspace (as given by a command line arg). import gobject, gtk, sys, wnck if len(sys.argv) != 2: print "Usage: " + sys.argv[0] + " n" print " where n is the (0-based) number of the workspace you want to activate." print " For example, to activate the 2nd workspace, do" print " " + sys.argv[0] + " 1" sys.exit(1) n = int(sys.argv[1]) s = wnck.screen_get_default() gobject.idle_add(lambda: s.get_workspace(n).activate(gtk.get_current_event_time())) gobject.idle_add(gtk.main_quit) gtk.main()