56 lines
1.5 KiB
Fish

# Minimaline theme
# A minimal Powerline-style prompt
# Author: Candifloss https://candifloss.cc
# Dependency: https://git.candifloss.cc/candifloss/PrettyPrompt
function fish_prompt
set -l exit_status $status
# Colour palette
set -l colour_user_bg 4cc954
set -l colour_pwd_bg 171717
set -l colour_status_bg 272727
set -l colour_host_bg 4cc992
set -l colour_error_bg d64444
# Set status colour (override if error)
if test $exit_status -ne 0
set colour_status_bg $colour_error_bg
end
# Prompt symbol for root user
set -l prompt_symbol '$'
if fish_is_root_user
set prompt_symbol '#'
end
# --- Segment 1: User@Host ---
# User part
set_color --background $colour_user_bg --bold $colour_pwd_bg
printf " %s" "$USER"
# Host part
set_color normal
set_color --background $colour_host_bg $colour_pwd_bg
printf "@%s " (prompt_hostname)
# Separator after Segment 1
set_color --background $colour_pwd_bg $colour_host_bg
printf " "
# --- Segment 2: Current Directory ---
# prettyprompt-pwd handles its own foreground colour
prettyprompt-pwd
# --- End separators ---
set_color --background $colour_pwd_bg
printf " "
set_color --background $colour_status_bg $colour_pwd_bg
printf ""
set_color --background normal $colour_status_bg
printf ""
# Reset and add trailing space
set_color normal
printf " "
end