From b17d03e688714b1839ceb27c82af7f31c91a5682 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 6 Jan 2015 16:16:39 +0300 Subject: [PATCH] Rename `POWERLINE_CONFIG` to `POWERLINE_CONFIG_COMMAND` where appropriate Ref #1124 --- docs/source/configuration/local.rst | 6 +++--- powerline/bindings/bash/powerline.sh | 12 ++++++------ powerline/bindings/fish/powerline-setup.fish | 12 ++++++------ powerline/bindings/shell/powerline.sh | 12 ++++++------ powerline/bindings/tcsh/powerline.tcsh | 20 ++++++++++---------- powerline/bindings/zsh/powerline.zsh | 12 ++++++------ 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/docs/source/configuration/local.rst b/docs/source/configuration/local.rst index 8e8ea5af..720e8eb7 100644 --- a/docs/source/configuration/local.rst +++ b/docs/source/configuration/local.rst @@ -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:: diff --git a/powerline/bindings/bash/powerline.sh b/powerline/bindings/bash/powerline.sh index cb125a00..40b6e936 100644 --- a/powerline/bindings/bash/powerline.sh +++ b/powerline/bindings/bash/powerline.sh @@ -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 diff --git a/powerline/bindings/fish/powerline-setup.fish b/powerline/bindings/fish/powerline-setup.fish index fad70f7b..5856cb32 100644 --- a/powerline/bindings/fish/powerline-setup.fish +++ b/powerline/bindings/fish/powerline-setup.fish @@ -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 diff --git a/powerline/bindings/shell/powerline.sh b/powerline/bindings/shell/powerline.sh index 8940c028..e67d6861 100644 --- a/powerline/bindings/shell/powerline.sh +++ b/powerline/bindings/shell/powerline.sh @@ -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 diff --git a/powerline/bindings/tcsh/powerline.tcsh b/powerline/bindings/tcsh/powerline.tcsh index fafdb39b..e5dddade 100644 --- a/powerline/bindings/tcsh/powerline.tcsh +++ b/powerline/bindings/tcsh/powerline.tcsh @@ -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 diff --git a/powerline/bindings/zsh/powerline.zsh b/powerline/bindings/zsh/powerline.zsh index 43b2521e..751f1af1 100644 --- a/powerline/bindings/zsh/powerline.zsh +++ b/powerline/bindings/zsh/powerline.zsh @@ -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