themes/kitsune: Fix a bug that information is not updated

This commit is contained in:
Koichi Murase
2022-01-08 14:42:53 +09:00
parent 6b2d92efbd
commit a4f752cd01

View File

@@ -6,28 +6,30 @@
_omb_module_require plugin:battery
# added TITLEBAR for updating the tab and window titles with the pwd
case $TERM in
xterm*)
TITLEBAR=$(printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}")
;;
screen)
TITLEBAR=$(printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}")
;;
*)
TITLEBAR=""
;;
esac
if [ "$?" == "0" ]
then
SC="${green}^_^";
else
SC="${red}T_T";
fi
BC=`battery_percentage`
function prompt_command() {
#PS1="${TITLEBAR}[\u@\h \W $(scm_prompt_info)]\$ "
PS1="\n${cyan}┌─${bold_white}[\u@\h]${cyan}${bold_yellow}(\w)$(scm_prompt_info)\n${cyan}└─${bold_green}[\A]-${green}($BC%)${bold_cyan}-[${green}${bold_green}\$${bold_cyan}]${green} "
local status=$?
# added TITLEBAR for updating the tab and window titles with the pwd
local TITLEBAR
case $TERM in
xterm* | screen)
TITLEBAR=$'\1\e]0;'$USER@${HOSTNAME%%.*}:${PWD/#$HOME/~}$'\e\\\2' ;;
*)
TITLEBAR= ;;
esac
local SC
if ((status == 0)); then
SC="$cyan-$bold_green(${green}^_^$bold_green)";
else
SC="$cyan-$bold_green(${red}T_T$bold_green)";
fi
local BC=$(battery_percentage)
[[ $BC == no && $BC == -1 ]] && BC=
BC=${BC:+${cyan}-${green}($BC%)}
PS1=$TITLEBAR"\n${cyan}┌─${bold_white}[\u@\h]${cyan}${bold_yellow}(\w)$(scm_prompt_info)\n${cyan}└─${bold_green}[\A]$SC$BC${cyan}-${bold_cyan}[${green}${bold_green}\$${bold_cyan}]${green} "
}
# scm theming