powerline-no

This commit is contained in:
Geoffrey Frogeye 2020-08-08 11:33:43 +02:00
parent f03d13f7db
commit af463d0f77
Signed by: geoffrey
GPG key ID: D8A7ECA00A8CD3DD
2 changed files with 48 additions and 37 deletions

View file

@ -13,6 +13,8 @@ HISTCONTROL=ignoreboth:erasedups
# Prompt customization
if command -v powerline-go > /dev/null
then
INTERACTIVE_BASHPID_TIMER="${HOME}/.cache/bash_timer_$$"
PS0='$(echo $SECONDS > "$INTERACTIVE_BASHPID_TIMER")'
@ -34,6 +36,10 @@ function _update_ps1() {
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
else
export PS1="\[\e]2;\u@\H \w\a\]\[\e[0;37m\][\[\e[0;${col}m\]\u\[\e[0;37m\]@\[\e[0;34m\]\h \[\e[0;36m\]\W\[\e[0;37m\]]\$\[\e[0m\] "
fi
# Completion
trysource /usr/share/bash-completion/bash_completion

View file

@ -48,6 +48,8 @@ function preexec() {
__TIMER=$EPOCHREALTIME
}
if command -v powerline-go > /dev/null
then
function powerline_precmd() {
local __ERRCODE=$?
local __DURATION=0
@ -73,6 +75,9 @@ function install_powerline_precmd() {
}
install_powerline_precmd
else
export PS1="\[\e]2;\u@\H \w\a\]\[\e[0;37m\][\[\e[0;${col}m\]\u\[\e[0;37m\]@\[\e[0;34m\]\h \[\e[0;36m\]\W\[\e[0;37m\]]\$\[\e[0m\] "
fi
# Cursor based on mode
if [ $TERM = "linux" ]; then