summaryrefslogtreecommitdiffstats
path: root/Examples
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2018-11-01 09:32:00 +0100
committerDave Davenport <qball@gmpclient.org>2018-11-01 09:32:00 +0100
commit1ed94ead7e20161482bccbaa0eeb1f3006c743d4 (patch)
tree9c7e17ece20a8532f48977364a9fc779dbe459a6 /Examples
parent6146d25b3689e361b81850e8cbf05e0e990ca335 (diff)
Add missing Example script
Fixes: #869
Diffstat (limited to 'Examples')
-rwxr-xr-xExamples/i3_empty_workspace.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/Examples/i3_empty_workspace.sh b/Examples/i3_empty_workspace.sh
new file mode 100755
index 00000000..b4c28dc0
--- /dev/null
+++ b/Examples/i3_empty_workspace.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+MAX_DESKTOPS=20
+
+WORKSPACES=$(seq -s '\n' 1 1 ${MAX_DESKTOPS})
+
+EMPTY_WORKSPACE=$( (i3-msg -t get_workspaces | tr ',' '\n' | grep num | awk -F: '{print int($2)}' ; \
+ echo -e ${WORKSPACES} ) | sort -n | uniq -u | head -n 1)
+
+i3-msg workspace ${EMPTY_WORKSPACE}