Created
February 3, 2015 13:28
-
-
Save 97-109-107/b70356670ae8309ffb4f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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']==True, workspaces)) | |
output = list(filter(lambda s: s['active']==True, outputs)) | |
# figure out the other workspace name | |
other_workspace = list(filter(lambda s: s['name']!=workspace[0]['output'], output)) | |
# send current to the no-active one | |
i3.command('move', 'workspace to output '+other_workspace[0]['name']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this, works well. I modified the original to have clearer variable names, debug output and to use list comprehensions.
My version: