mirror of https://gitlab.com/ceda_ei/wish
Add checks for adding powerline to right prompt
This commit is contained in:
parent
b389774a50
commit
f8254ba89a
6
wish.sh
6
wish.sh
|
@ -141,12 +141,13 @@ function wish_main() {
|
||||||
WISH_STATE=1
|
WISH_STATE=1
|
||||||
WISH_RPL=0
|
WISH_RPL=0
|
||||||
for i in $(seq 0 $((${#WISH_RIGHT_PLUGINS[@]} - 1))); do
|
for i in $(seq 0 $((${#WISH_RIGHT_PLUGINS[@]} - 1))); do
|
||||||
if [[ -v WISH_POWERLINE && WISH_POWERLINE != 0 ]]; then
|
if [[ -v WISH_POWERLINE ]] && [[ $WISH_POWERLINE != 0 ]]; then
|
||||||
|
if wish_${WISH_RIGHT_PLUGINS[$i]}_end $prev; then
|
||||||
if [[ $i == 0 ]]; then
|
if [[ $i == 0 ]]; then
|
||||||
local plugin=${WISH_RIGHT_PLUGINS[$i]}
|
local plugin=${WISH_RIGHT_PLUGINS[$i]}
|
||||||
local fg_name="WISH_${plugin^^}_BG"
|
local fg_name="WISH_${plugin^^}_BG"
|
||||||
wish_append -1 ${!fg_name}
|
wish_append -1 ${!fg_name}
|
||||||
else
|
elif wish_${WISH_RIGHT_PLUGINS[$(($i - 1))]}_start $prev; then
|
||||||
local plugin=${WISH_RIGHT_PLUGINS[$i]}
|
local plugin=${WISH_RIGHT_PLUGINS[$i]}
|
||||||
local prev_plugin=${WISH_RIGHT_PLUGINS[$(($i-1))]}
|
local prev_plugin=${WISH_RIGHT_PLUGINS[$(($i-1))]}
|
||||||
local fg_name="WISH_${plugin^^}_BG"
|
local fg_name="WISH_${plugin^^}_BG"
|
||||||
|
@ -154,6 +155,7 @@ function wish_main() {
|
||||||
wish_append ${!bg_name} ${!fg_name}
|
wish_append ${!bg_name} ${!fg_name}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
wish_${WISH_RIGHT_PLUGINS[$i]}_main $prev
|
wish_${WISH_RIGHT_PLUGINS[$i]}_main $prev
|
||||||
done
|
done
|
||||||
PS1=$PS1"\[\e7\e[$(($COLUMNS - $WISH_RPL + 1))G$WISH_RIGHT_PS1\e8\]$WISH_LEFT_PS1\[\033[0;5;0m\]"
|
PS1=$PS1"\[\e7\e[$(($COLUMNS - $WISH_RPL + 1))G$WISH_RIGHT_PS1\e8\]$WISH_LEFT_PS1\[\033[0;5;0m\]"
|
||||||
|
|
Loading…
Reference in New Issue