fix(shell): fixes to zsh and bash configs

This commit is contained in:
2024-11-16 16:30:57 +02:00
parent aa70eab5fb
commit 392628e733
3 changed files with 67 additions and 25 deletions

View File

@@ -14,10 +14,45 @@ source "$DOTFILES/config/shared.sh"
# Import ssh keys in keychain
ssh-add -A 2>/dev/null
x-have oh-my-posh && {
eval "$(oh-my-posh init bash --config "$DOTFILES/config/omp/own.toml")"
}
x-have antidot && {
eval "$(antidot init)"
}
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return ;;
esac
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm* | rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*) ;;
esac
x-have oh-my-posh && {
eval "$(oh-my-posh init bash --config "$DOTFILES/config/omp/own.toml")"
}