diff --git a/scripts/check_tmux_version.sh b/scripts/check_tmux_version.sh index f5db448..2e342fa 100755 --- a/scripts/check_tmux_version.sh +++ b/scripts/check_tmux_version.sh @@ -13,7 +13,7 @@ source "$SCRIPTS_DIR/tmux_cmd_path.sh" get_tmux_option() { local option=$1 local default_value=$2 - local option_value=$(tmux show-option -gqv "$option") + local option_value=$($TMUX_CMD_PATH show-option -gqv "$option") if [ -z "$option_value" ]; then echo "$default_value" else @@ -56,7 +56,7 @@ get_digits_from_string() { } tmux_version_int() { - local tmux_version_string=$(tmux -V) + local tmux_version_string=$($TMUX_CMD_PATH -V) echo "$(get_digits_from_string "$tmux_version_string")" } diff --git a/scripts/helpers/plugin_functions.sh b/scripts/helpers/plugin_functions.sh index f33d215..b249cee 100644 --- a/scripts/helpers/plugin_functions.sh +++ b/scripts/helpers/plugin_functions.sh @@ -1,6 +1,11 @@ # using @tpm_plugins is now deprecated in favor of using @plugin syntax tpm_plugins_variable_name="@tpm_plugins" +CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPTS_DIR="$CURRENT_DIR/../../scripts" +HELPERS_DIR="$SCRIPTS_DIR/helpers" +source "$SCRIPTS_DIR/tmux_cmd_path.sh" + # manually expanding tilde char or `$HOME` variable. _manual_expansion() { local path="$1" @@ -9,7 +14,7 @@ _manual_expansion() { } _tpm_path() { - local string_path="$(tmux start-server\; show-environment -g TMUX_PLUGIN_MANAGER_PATH | cut -f2 -d=)/" + local string_path="$($TMUX_CMD_PATH start-server\; show-environment -g TMUX_PLUGIN_MANAGER_PATH | cut -f2 -d=)/" _manual_expansion "$string_path" } diff --git a/scripts/helpers/tmux_utils.sh b/scripts/helpers/tmux_utils.sh index e39946a..778e29e 100644 --- a/scripts/helpers/tmux_utils.sh +++ b/scripts/helpers/tmux_utils.sh @@ -1,3 +1,9 @@ + +CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPTS_DIR="$CURRENT_DIR/../../scripts" +HELPERS_DIR="$SCRIPTS_DIR/helpers" +source "$SCRIPTS_DIR/tmux_cmd_path.sh" + reload_tmux_environment() { - tmux source-file ~/.tmux.conf >/dev/null 2>&1 + $TMUX_CMD_PATH source-file ~/.tmux.conf >/dev/null 2>&1 } diff --git a/tpm b/tpm index e8d79d5..cadad42 100755 --- a/tpm +++ b/tpm @@ -11,7 +11,7 @@ source "$SCRIPTS_DIR/variables.sh" get_tmux_option() { local option="$1" local default_value="$2" - local option_value="$(tmux show-option -gqv "$option")" + local option_value="$($TMUX_CMD_PATH show-option -gqv "$option")" if [ -z "$option_value" ]; then echo "$default_value" else @@ -60,13 +60,13 @@ source_plugins() { # prefix + alt + u - remove unused TPM plugins and reloads TMUX environment set_tpm_key_bindings() { local install_key="$(get_tmux_option "$install_key_option" "$default_install_key")" - tmux bind-key "$install_key" run-shell "$BINDINGS_DIR/install_plugins" + $TMUX_CMD_PATH bind-key "$install_key" run-shell "$BINDINGS_DIR/install_plugins" local update_key="$(get_tmux_option "$update_key_option" "$default_update_key")" - tmux bind-key "$update_key" run-shell "$BINDINGS_DIR/update_plugins" + $TMUX_CMD_PATH bind-key "$update_key" run-shell "$BINDINGS_DIR/update_plugins" local clean_key="$(get_tmux_option "$clean_key_option" "$default_clean_key")" - tmux bind-key "$clean_key" run-shell "$BINDINGS_DIR/clean_plugins" + $TMUX_CMD_PATH bind-key "$clean_key" run-shell "$BINDINGS_DIR/clean_plugins" } supported_tmux_version_ok() {