Add optional target window argument to newly added layout helpers

This commit is contained in:
2017-04-27 19:48:15 +01:00
parent 47ef3bd857
commit 9049818b25

View File

@@ -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.