Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import json
- import subprocess
- import time
- def i3_msg(args):
- return json.loads(subprocess.check_output(["i3-msg"] + args))
- def main():
- outputs = i3_msg(["-t", "get_outputs"])
- spaces = i3_msg(["-t", "get_workspaces"])
- next_space = max([space['num'] for space in spaces])
- for output in outputs:
- if output['active']:
- next_space += 1
- i3_msg(["workspace", str(output['current_workspace'])])
- i3_msg(["workspace", str(next_space)])
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement