#!/usr/bin/python from get_workspaces import get_workspaces_list import subprocess dmenu = subprocess.Popen(['dmenu', '-p', 'Workspaces'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) selected = dmenu.communicate('\n'.join(get_workspaces_list())) subprocess.call(['i3-msg', 'move container to workspace', selected[0].rstrip()], stdout=subprocess.PIPE)
#!/usr/bin/python from get_workspaces import get_workspaces_list import subprocess import sys offset = int(sys.argv[1]) workspaces = get_workspaces_list() if offset < len(workspaces): subprocess.call(['i3-msg', 'workspace', workspaces[offset]], stdout=subprocess.PIPE)