aboutsummaryrefslogtreecommitdiff
path: root/linux/home/.config/tmux/tmux_number.sh
diff options
context:
space:
mode:
Diffstat (limited to 'linux/home/.config/tmux/tmux_number.sh')
-rwxr-xr-xlinux/home/.config/tmux/tmux_number.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/linux/home/.config/tmux/tmux_number.sh b/linux/home/.config/tmux/tmux_number.sh
new file mode 100755
index 0000000..5d239d0
--- /dev/null
+++ b/linux/home/.config/tmux/tmux_number.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -x
+dest="$1"
+[ "x""$dest" != "x" ]
+tmux list-windows -F "#{window_index}" | grep "^${dest}$" 2>&1 >/dev/null
+ret="$?"
+if [ "x""$ret" = "x0" ]; then
+ tmux swap-window -t ":${dest}"
+else
+ tmux move-window -t ":${dest}"
+fi