60 lines
1.6 KiB
Fish

# Minimaline theme
# A minimal Powerline-style prompt
# Author: Candifloss https://candifloss.cc
# Dependencies:
# 1. Prettyprompt: https://git.candifloss.cc/candifloss/PrettyPrompt
# 2. Nerdfonts: https://www.nerdfonts.com/
function fish_prompt
set -l exit_status $status
# color palette
set -l color_user_bg 4cc954
set -l color_root_bg a89a64
set -l color_pwd_bg 171717
set -l color_status_bg 272727
set -l color_host_bg 4cc992
set -l color_error_bg d64444
# Set status color (override if error)
if test $exit_status -ne 0
set color_status_bg $color_error_bg
end
# Prompt symbol for root user
set -l prompt_symbol '$'
if fish_is_root_user
set prompt_symbol '#'
set color_user_bg $color_root_bg
end
# --- Segment 1: User@Host ---
# User part
set_color --background $color_user_bg --bold $color_pwd_bg
printf " %s" "$USER"
# Host part
set_color normal
set_color --background $color_host_bg $color_pwd_bg
printf "@%s " (prompt_hostname)
# Separator after Segment 1
set_color --background $color_pwd_bg $color_host_bg
printf " "
# --- Segment 2: Current Directory ---
# prettyprompt-pwd handles its own foreground color
prettyprompt-pwd
# --- End separators ---
set_color --background $color_pwd_bg
printf " "
set_color --background $color_status_bg $color_pwd_bg
printf ""
set_color --background normal $color_status_bg
printf ""
# Reset and add trailing space
set_color normal
printf " "
end