Skip to content

Instantly share code, notes, and snippets.

@benkaiser
Created February 5, 2014 11:59
Show Gist options
  • Save benkaiser/8822222 to your computer and use it in GitHub Desktop.
Save benkaiser/8822222 to your computer and use it in GitHub Desktop.
Scripts to get i3 dynamic tagging working
# Just add the following lines to your i3 config file
# dynamic tagging feature
bindsym $mod+t exec ~/.i3/get_workspace_options.py | dmenu -b | ~/.i3/go_to_workspace.py
bindsym $mod+Shift+t exec ~/.i3/get_workspace_options.py | dmenu -b | ~/.i3/move_to_workspace.py
#!/usr/bin/python3
import subprocess
import json
test = subprocess.Popen(["i3-msg","-t","get_workspaces"], stdout=subprocess.PIPE)
output = test.communicate()[0]
data = json.loads(output.decode())
data = sorted(data, key=lambda k: k['name'])
for i in data:
print(i['name'])
#!/usr/bin/python3
import subprocess
import sys
data = sys.stdin.readlines()[0]
test = subprocess.Popen(["i3-msg","workspace "+data], stdout=subprocess.PIPE)
#!/usr/bin/python3
import subprocess
import sys
data = sys.stdin.readlines()[0]
test = subprocess.Popen(["i3-msg","move container to workspace "+data], stdout=subprocess.PIPE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment