Rename `POWERLINE_CONFIG` to `POWERLINE_CONFIG_COMMAND` where appropriate
Ref #1124
This commit is contained in:
parent
983315b2c5
commit
b17d03e688
|
@ -121,9 +121,9 @@ Prompt command
|
|||
|
||||
In addition to the above configuration options you can use
|
||||
``$POWERLINE_COMMAND`` environment variable to tell shell or tmux to use
|
||||
specific powerline implementation and ``$POWERLINE_CONFIG`` to tell zsh or tmux
|
||||
where ``powerline-config`` script is located. This is mostly useful for putting
|
||||
powerline into different directory.
|
||||
specific powerline implementation and ``$POWERLINE_CONFIG_COMMAND`` to tell zsh
|
||||
or tmux where ``powerline-config`` script is located. This is mostly useful for
|
||||
putting powerline into different directory.
|
||||
|
||||
.. note::
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ _powerline_set_prompt() {
|
|||
_powerline_setup_prompt() {
|
||||
VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||
if test -z "${POWERLINE_COMMAND}" ; then
|
||||
POWERLINE_COMMAND="$("$POWERLINE_CONFIG" shell command)"
|
||||
POWERLINE_COMMAND="$("$POWERLINE_CONFIG_COMMAND" shell command)"
|
||||
fi
|
||||
test "x$PROMPT_COMMAND" != "x${PROMPT_COMMAND%_powerline_set_prompt*}" ||
|
||||
PROMPT_COMMAND=$'_powerline_set_prompt\n'"${PROMPT_COMMAND}"
|
||||
|
@ -83,17 +83,17 @@ _powerline_setup_prompt() {
|
|||
PS3="$(_powerline_local_prompt left '' 0 0 select)"
|
||||
}
|
||||
|
||||
if test -z "${POWERLINE_CONFIG}" ; then
|
||||
if test -z "${POWERLINE_CONFIG_COMMAND}" ; then
|
||||
if which powerline-config >/dev/null ; then
|
||||
POWERLINE_CONFIG=powerline-config
|
||||
POWERLINE_CONFIG_COMMAND=powerline-config
|
||||
else
|
||||
POWERLINE_CONFIG="$(dirname "$BASH_SOURCE")/../../../scripts/powerline-config"
|
||||
POWERLINE_CONFIG_COMMAND="$(dirname "$BASH_SOURCE")/../../../scripts/powerline-config"
|
||||
fi
|
||||
fi
|
||||
|
||||
if "${POWERLINE_CONFIG}" shell --shell=bash uses prompt ; then
|
||||
if "${POWERLINE_CONFIG_COMMAND}" shell --shell=bash uses prompt ; then
|
||||
_powerline_setup_prompt
|
||||
fi
|
||||
if "${POWERLINE_CONFIG}" shell --shell=bash uses tmux ; then
|
||||
if "${POWERLINE_CONFIG_COMMAND}" shell --shell=bash uses tmux ; then
|
||||
_powerline_init_tmux_support
|
||||
fi
|
||||
|
|
|
@ -21,17 +21,17 @@ function powerline-setup
|
|||
end
|
||||
end
|
||||
|
||||
if test -z "$POWERLINE_CONFIG"
|
||||
if test -z "$POWERLINE_CONFIG_COMMAND"
|
||||
if which powerline-config >/dev/null
|
||||
set -g POWERLINE_CONFIG powerline-config
|
||||
set -g POWERLINE_CONFIG_COMMAND powerline-config
|
||||
else
|
||||
set -g POWERLINE_CONFIG (dirname (status -f))/../../../scripts/powerline-config
|
||||
set -g POWERLINE_CONFIG_COMMAND (dirname (status -f))/../../../scripts/powerline-config
|
||||
end
|
||||
end
|
||||
|
||||
if eval $POWERLINE_CONFIG shell --shell=fish uses prompt
|
||||
if eval $POWERLINE_CONFIG_COMMAND shell --shell=fish uses prompt
|
||||
if test -z "$POWERLINE_COMMAND"
|
||||
set -g POWERLINE_COMMAND (eval $POWERLINE_CONFIG shell command)
|
||||
set -g POWERLINE_COMMAND (eval $POWERLINE_CONFIG_COMMAND shell command)
|
||||
end
|
||||
function --on-variable fish_bind_mode _powerline_bind_mode
|
||||
set -g -x _POWERLINE_MODE $fish_bind_mode
|
||||
|
@ -81,7 +81,7 @@ function powerline-setup
|
|||
_powerline_set_default_mode
|
||||
_powerline_update
|
||||
end
|
||||
if eval $POWERLINE_CONFIG shell --shell=fish uses tmux
|
||||
if eval $POWERLINE_CONFIG_COMMAND shell --shell=fish uses tmux
|
||||
if test -n "$TMUX"
|
||||
if tmux refresh -S ^/dev/null
|
||||
function _powerline_tmux_setenv
|
||||
|
|
|
@ -100,7 +100,7 @@ _powerline_set_set_jobs() {
|
|||
|
||||
_powerline_set_command() {
|
||||
if test -z "${POWERLINE_COMMAND}" ; then
|
||||
POWERLINE_COMMAND="$("$POWERLINE_CONFIG" shell command)"
|
||||
POWERLINE_COMMAND="$("$POWERLINE_CONFIG_COMMAND" shell command)"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -214,11 +214,11 @@ _powerline_init_tmux_support() {
|
|||
fi
|
||||
}
|
||||
|
||||
if test -z "${POWERLINE_CONFIG}" ; then
|
||||
if test -z "${POWERLINE_CONFIG_COMMAND}" ; then
|
||||
if which powerline-config >/dev/null ; then
|
||||
POWERLINE_CONFIG=powerline-config
|
||||
POWERLINE_CONFIG_COMMAND=powerline-config
|
||||
else
|
||||
POWERLINE_CONFIG="$(dirname "$_POWERLINE_SOURCED")/../../../scripts/powerline-config"
|
||||
POWERLINE_CONFIG_COMMAND="$(dirname "$_POWERLINE_SOURCED")/../../../scripts/powerline-config"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -227,9 +227,9 @@ _POWERLINE_USED_SHELL=${0#-}
|
|||
_POWERLINE_USED_SHELL=${_POWERLINE_USED_SHELL#/usr}
|
||||
_POWERLINE_USED_SHELL=${_POWERLINE_USED_SHELL#/bin/}
|
||||
|
||||
if "${POWERLINE_CONFIG}" shell uses tmux ; then
|
||||
if "${POWERLINE_CONFIG_COMMAND}" shell uses tmux ; then
|
||||
_powerline_init_tmux_support $_POWERLINE_USED_SHELL
|
||||
fi
|
||||
if "${POWERLINE_CONFIG}" shell --shell=bash uses prompt ; then
|
||||
if "${POWERLINE_CONFIG_COMMAND}" shell --shell=bash uses prompt ; then
|
||||
_powerline_setup_prompt $_POWERLINE_USED_SHELL
|
||||
fi
|
||||
|
|
|
@ -5,31 +5,31 @@
|
|||
# Guess this relies on `$_` being set as to last argument to previous command
|
||||
# which must be `.` or `source` in this case
|
||||
set POWERLINE_SOURCED=($_)
|
||||
if ! $?POWERLINE_CONFIG then
|
||||
if ! $?POWERLINE_CONFIG_COMMAND then
|
||||
if ( { which powerline-config > /dev/null } ) then
|
||||
set POWERLINE_CONFIG="powerline-config"
|
||||
set POWERLINE_CONFIG_COMMAND="powerline-config"
|
||||
else
|
||||
set POWERLINE_CONFIG="$POWERLINE_SOURCED[2]:h:h:h:h/scripts/powerline-config"
|
||||
set POWERLINE_CONFIG_COMMAND="$POWERLINE_SOURCED[2]:h:h:h:h/scripts/powerline-config"
|
||||
endif
|
||||
else
|
||||
if "$POWERLINE_CONFIG" == "" then
|
||||
if "$POWERLINE_CONFIG_COMMAND" == "" then
|
||||
if ( { which powerline-config > /dev/null } ) then
|
||||
set POWERLINE_CONFIG="powerline-config"
|
||||
set POWERLINE_CONFIG_COMMAND="powerline-config"
|
||||
else
|
||||
set POWERLINE_CONFIG="$POWERLINE_SOURCED[2]:h:h:h:h/scripts/powerline-config"
|
||||
set POWERLINE_CONFIG_COMMAND="$POWERLINE_SOURCED[2]:h:h:h:h/scripts/powerline-config"
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
if ( { $POWERLINE_CONFIG shell --shell=tcsh uses tmux } ) then
|
||||
if ( { $POWERLINE_CONFIG_COMMAND shell --shell=tcsh uses tmux } ) then
|
||||
alias _powerline_tmux_set_pwd 'if ( $?TMUX && { tmux refresh -S >&/dev/null } ) tmux setenv -g TMUX_PWD_`tmux display -p "#D" | tr -d %` $PWD:q ; if ( $?TMUX ) tmux refresh -S >&/dev/null'
|
||||
alias cwdcmd "`alias cwdcmd` ; _powerline_tmux_set_pwd"
|
||||
endif
|
||||
if ( { $POWERLINE_CONFIG shell --shell=tcsh uses prompt } ) then
|
||||
if ( { $POWERLINE_CONFIG_COMMAND shell --shell=tcsh uses prompt } ) then
|
||||
if ! $?POWERLINE_COMMAND then
|
||||
set POWERLINE_COMMAND="`$POWERLINE_CONFIG:q shell command`"
|
||||
set POWERLINE_COMMAND="`$POWERLINE_CONFIG_COMMAND:q shell command`"
|
||||
else
|
||||
if "$POWERLINE_COMMAND" == "" then
|
||||
set POWERLINE_COMMAND="`$POWERLINE_CONFIG:q shell command`"
|
||||
set POWERLINE_COMMAND="`$POWERLINE_CONFIG_COMMAND:q shell command`"
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ _powerline_setup_prompt() {
|
|||
}
|
||||
else
|
||||
if test -z "${POWERLINE_COMMAND}" ; then
|
||||
POWERLINE_COMMAND="$($POWERLINE_CONFIG shell command)"
|
||||
POWERLINE_COMMAND="$($POWERLINE_CONFIG_COMMAND shell command)"
|
||||
fi
|
||||
|
||||
local add_args='-r .zsh'
|
||||
|
@ -183,21 +183,21 @@ _powerline_add_widget() {
|
|||
fi
|
||||
}
|
||||
|
||||
if test -z "${POWERLINE_CONFIG}" ; then
|
||||
if test -z "${POWERLINE_CONFIG_COMMAND}" ; then
|
||||
if which powerline-config >/dev/null ; then
|
||||
export POWERLINE_CONFIG=powerline-config
|
||||
export POWERLINE_CONFIG_COMMAND=powerline-config
|
||||
else
|
||||
export POWERLINE_CONFIG="$_POWERLINE_SOURCED:h:h:h:h/scripts/powerline-config"
|
||||
export POWERLINE_CONFIG_COMMAND="$_POWERLINE_SOURCED:h:h:h:h/scripts/powerline-config"
|
||||
fi
|
||||
fi
|
||||
|
||||
setopt promptpercent
|
||||
setopt promptsubst
|
||||
|
||||
if ${POWERLINE_CONFIG} shell --shell=zsh uses prompt ; then
|
||||
if "${POWERLINE_CONFIG_COMMAND}" shell --shell=zsh uses prompt ; then
|
||||
_powerline_setup_prompt
|
||||
_powerline_init_modes_support
|
||||
fi
|
||||
if ${POWERLINE_CONFIG} shell --shell=zsh uses tmux ; then
|
||||
if "${POWERLINE_CONFIG_COMMAND}" shell --shell=zsh uses tmux ; then
|
||||
_powerline_init_tmux_support
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue