fix: change more "tmux" to use TMUX_CMD_PATH
This commit is contained in:
parent
74a45912c4
commit
3206dec40b
4 changed files with 19 additions and 8 deletions
|
@ -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")"
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
8
tpm
8
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() {
|
||||
|
|
Loading…
Reference in a new issue