Skip to content

Instantly share code, notes, and snippets.

@justbuchanan
Forked from 97-109-107/cycle-workspace.py
Last active October 27, 2016 05:43
Show Gist options
  • Save justbuchanan/00b8d4aac604fa6ab41b7c5acae71ee8 to your computer and use it in GitHub Desktop.
Save justbuchanan/00b8d4aac604fa6ab41b7c5acae71ee8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import i3
outputs = i3.get_outputs()
workspaces = i3.get_workspaces()
# figure out what is on, and what is currently on your screen.
workspace = list(filter(lambda s: s['focused'], workspaces))[0]
output = list(filter(lambda s: s['active'], outputs))
# figure out the other workspace name
other_workspace = list(filter(lambda s: s['name']!=workspace['output'], output))[0]
# send current to the no-active one
i3.command('move', 'workspace to output '+other_workspace['name'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment