From 9049818b25da98ddaaa0d23cfb69707fbbf8815d Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Thu, 27 Apr 2017 19:48:15 +0100 Subject: [PATCH] Add optional target window argument to newly added layout helpers --- lib/layout-helpers.sh | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/lib/layout-helpers.sh b/lib/layout-helpers.sh index bef4955..cf862f9 100644 --- a/lib/layout-helpers.sh +++ b/lib/layout-helpers.sh @@ -105,20 +105,42 @@ select_pane() { tmuxifier-tmux select-pane -t "$session:$window.$1" } +# Balance windows vertically with the "even-vertical" layout. +# +# Arguments: +# - $1: (optional) Window ID or name to operate on. +# balance_windows_vertical() { - tmuxifier-tmux select-layout even-vertical + tmuxifier-tmux select-layout -t "$session:${1:-$window}" even-vertical } +# Balance windows horizontally with the "even-horizontal" layout. +# +# Arguments: +# - $1: (optional) Window ID or name to operate on. +# balance_windows_horizontal() { - tmuxifier-tmux select-layout even-horizontal + tmuxifier-tmux select-layout -t "$session:${1:-$window}" even-horizontal } +# Turn on synchronize-panes in a window. +# +# Arguments: +# - $1: (optional) Window ID or name to operate on. +# synchronize_on() { - tmuxifier-tmux set-window-option synchronize-panes on + tmuxifier-tmux set-window-option -t "$session:${1:-$window}" \ + synchronize-panes on } +# Turn off synchronize-panes in a window. +# +# Arguments: +# - $1: (optional) Window ID or name to operate on. +# synchronize_off() { - tmuxifier-tmux set-window-option synchronize-panes off + tmuxifier-tmux set-window-option -t "$session:${1:-$window}" \ + synchronize-panes off } # Send/paste keys to the currently active pane/window.