aboutsummaryrefslogtreecommitdiff
path: root/modules/workstation/graphics/i3/dynamic-tags/move.sh
diff options
context:
space:
mode:
Diffstat (limited to 'modules/workstation/graphics/i3/dynamic-tags/move.sh')
-rwxr-xr-xmodules/workstation/graphics/i3/dynamic-tags/move.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/workstation/graphics/i3/dynamic-tags/move.sh b/modules/workstation/graphics/i3/dynamic-tags/move.sh
new file mode 100755
index 00000000000..84f39fdc3ac
--- /dev/null
+++ b/modules/workstation/graphics/i3/dynamic-tags/move.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+### Move a window to a given workspace. If it doesn't exist it creates it.
+
+I3MSG=$(command -v i3-msg) || exit 1
+JQ=$(command -v jq) || exit 2
+
+WORKSPACE=$($I3MSG -t get_workspaces | $JQ -M '.[] | .name' | tr -d '"' | sort -u | dmenu -b -i "$@")
+
+# Move the window first
+$I3MSG -t command move workspace $WORKSPACE
+
+# Then move the user
+$I3MSG workspace $WORKSPACE