summaryrefslogtreecommitdiff
path: root/.i3
diff options
context:
space:
mode:
authorRené Neumann <rene.neumann@in.tum.de>2013-06-06 11:47:31 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2013-06-06 11:50:04 +0200
commit346139a617b044329efcc0a17fdbdf11cf31971e (patch)
tree86f8f7b3fd41bd9e6109a1b6459bdf5464b10068 /.i3
parent0a90042ee56790b745a876fa21901ae9b33ff070 (diff)
downloaddotfiles-346139a617b044329efcc0a17fdbdf11cf31971e.tar.gz
dotfiles-346139a617b044329efcc0a17fdbdf11cf31971e.tar.bz2
dotfiles-346139a617b044329efcc0a17fdbdf11cf31971e.zip
i3: new temporary workspace
Diffstat (limited to '.i3')
-rw-r--r--.i3/config5
-rwxr-xr-x.i3/scripts/new_workspace.py23
2 files changed, 27 insertions, 1 deletions
diff --git a/.i3/config b/.i3/config
index 407a1e9..f72bdc4 100644
--- a/.i3/config
+++ b/.i3/config
@@ -153,7 +153,10 @@ bindsym $mod+g exec $nsi $script/workspaces.sh
bindsym $mod+Shift+g exec $nsi $script/workspaces.sh move
# rename «3
-bindsym $mod+n exec $nsi i3-input -F 'rename workspace to "%s"' -P 'Rename workspace: '
+bindsym $mod+Shift+n exec $nsi i3-input -F 'rename workspace to "%s"' -P 'Rename workspace: '
+
+# new temp workspace «3
+bindsym $mod+n exec $nsi $script/new_workspace.py
# Resizing «2
#############
diff --git a/.i3/scripts/new_workspace.py b/.i3/scripts/new_workspace.py
new file mode 100755
index 0000000..cfb73d1
--- /dev/null
+++ b/.i3/scripts/new_workspace.py
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+
+#
+# Switch to a new workspace, which gets the first free numbe >= 0
+#
+
+import sys
+from os.path import realpath, dirname
+
+cwd = realpath(dirname(__file__))
+sys.path.insert(1, cwd)
+
+import i3
+
+nums = (w["num"] for w in i3.get_workspaces())
+nums = filter(lambda n: n is not None and n >= 0, nums)
+
+for i,n in enumerate(sorted(nums)):
+ if i != n:
+ i3.workspace(str(i))
+ break
+else:
+ i3.workspace(str(i+1))