diff options
| author | Ewy~ <ewy0@protonmail.com> | 2025-01-13 23:11:54 +0100 |
|---|---|---|
| committer | Ewy~ <ewy0@protonmail.com> | 2025-01-13 23:11:54 +0100 |
| commit | 2b3cd782b3a94ff458418c4d8b5eeb3dca0a1bc9 (patch) | |
| tree | 220c4c5a0c35b5d9051f21537c747265ff3d0f68 /.config | |
| parent | 9fa95d851dbbe1d866b85848f6215e8e2d1dedf0 (diff) | |
added theme
Diffstat (limited to '.config')
| -rw-r--r-- | .config/zsh/themes/ewout.zsh-theme | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/.config/zsh/themes/ewout.zsh-theme b/.config/zsh/themes/ewout.zsh-theme new file mode 100644 index 0000000..78fff90 --- /dev/null +++ b/.config/zsh/themes/ewout.zsh-theme @@ -0,0 +1,36 @@ +autoload colors && colors + +__git() { + command -v git > /dev/null || return + [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == true ]] && echo " $(git branch --show-current)" +} + +__wrap() { + [ -z "$@" ] && return + echo "─[$@]─" +} + +__exitStatus() { + code=$1 + [ $1 != 0 ] && echo $code +} + +__exitFace() { + code=$1 + [ $1 = 0 ] && echo "$fg[green]:3$reset_color" + [ $1 != 0 ] && echo "$fg[red]D:$reset_color" +} + +__prompt() { + echo "%# " +} + +__generate_prompt() { + lastExit="$?" + cat <<ENDPROMPT +╭$(__wrap $(__exitStatus $lastExit))$(__wrap '%~')$(__wrap '%n')$(__wrap $(__git))┄ +╰$(__wrap $(__exitFace $lastExit))┄ $(__prompt) +ENDPROMPT +} + +PROMPT='$(__generate_prompt)' |
