Last active
April 4, 2017 15:57
-
-
Save mrichar1/65e3fa3051f257bf80826f587ee48371 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
"""Script to launch the specified command in the next available workspace.""" | |
import i3ipc | |
import sys | |
# Potential workspaces to use | |
WORKSPACES = set((1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) | |
def main(): | |
i3c = i3ipc.Connection() | |
active_ws = set([x['num'] for x in i3c.get_workspaces()]) | |
i3c.command('workspace number {}'.format(WORKSPACES.difference(active_ws).pop())) | |
i3c.command('exec {}'.format(sys.argv[1])) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment