summaryrefslogtreecommitdiff
path: root/.i3/scripts/workspaces.sh
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2013-06-01 19:11:26 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2013-06-01 19:11:26 +0200
commitce1ffffc2a387672d7f7c9ed8ab57714c3b61ee2 (patch)
tree72ed07c833cc8f19769f2ff2bf388d21608befa7 /.i3/scripts/workspaces.sh
parentd3208d139fcb1725932c4951d02531b59b676eb1 (diff)
downloaddotfiles-ce1ffffc2a387672d7f7c9ed8ab57714c3b61ee2.tar.gz
dotfiles-ce1ffffc2a387672d7f7c9ed8ab57714c3b61ee2.tar.bz2
dotfiles-ce1ffffc2a387672d7f7c9ed8ab57714c3b61ee2.zip
Better workspace chooser
Diffstat (limited to '.i3/scripts/workspaces.sh')
-rwxr-xr-x.i3/scripts/workspaces.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/.i3/scripts/workspaces.sh b/.i3/scripts/workspaces.sh
new file mode 100755
index 0000000..8151990
--- /dev/null
+++ b/.i3/scripts/workspaces.sh
@@ -0,0 +1,24 @@
+#!/bin/zsh
+
+cmd=$1
+cwd=${0:h}
+
+workspaces () {
+ python <<EOF
+import sys
+sys.path.insert(1, "$cwd")
+
+import i3
+
+names = sorted(w["name"] for w in i3.get_workspaces())
+print("\n".join(names))
+EOF
+}
+
+selection=`workspaces| dmenu -b`
+if (( ! $? )); then
+ case $cmd in
+ move) i3-msg move container to workspace $selection;;
+ *) i3-msg workspace $selection;;
+ esac
+fi