diff options
author | luxagraf <sng@luxagraf.net> | 2023-06-15 15:58:59 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-06-15 15:58:59 -0500 |
commit | ab987e10f154f5536bb8fd936ae0966e909fa969 (patch) | |
tree | 9de5076f38b71ececb1bc94f8d9d19170898d603 /tmuxsh/_tmux_goto_demo,--.jump.to.named.window.(demo.window.empty.space) |
added all my scriptssynced/master
Diffstat (limited to 'tmuxsh/_tmux_goto_demo,--.jump.to.named.window.(demo.window.empty.space)')
-rwxr-xr-x | tmuxsh/_tmux_goto_demo,--.jump.to.named.window.(demo.window.empty.space) | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tmuxsh/_tmux_goto_demo,--.jump.to.named.window.(demo.window.empty.space) b/tmuxsh/_tmux_goto_demo,--.jump.to.named.window.(demo.window.empty.space) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_demo,--.jump.to.named.window.(demo.window.empty.space) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" |