Update fastfetch.nix

This commit is contained in:
ediblerope 2025-12-21 14:11:48 +00:00 committed by GitHub
parent 80b794ed23
commit 1754e702de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,26 +41,38 @@
''; '';
# Set up bash with fastfetch and a nice prompt # Set up bash with fastfetch and a nice prompt
programs.bash.promptInit = '' programs.bash.promptInit = ''
# Stylish prompt with icons # Powerline-style prompt with background colors
# Color definitions # Color definitions
RESET="\[\033[0m\]" RESET="\[\033[0m\]"
CYAN="\[\033[0;36m\]"
BLUE="\[\033[0;34m\]" # Powerline separator
PURPLE="\[\033[0;35m\]" SEP=""
GREEN="\[\033[0;32m\]"
YELLOW="\[\033[0;33m\]" # Background colors with foreground text
BCYAN="\[\033[1;36m\]" BG_BLUE="\[\033[48;5;33m\]" # Blue background
BBLUE="\[\033[1;34m\]" BG_PURPLE="\[\033[48;5;98m\]" # Purple background
BPURPLE="\[\033[1;35m\]" BG_GREEN="\[\033[48;5;35m\]" # Green background
BGREEN="\[\033[1;32m\]"
# Foreground colors for separators
FG_BLUE="\[\033[38;5;33m\]"
FG_PURPLE="\[\033[38;5;98m\]"
FG_GREEN="\[\033[38;5;35m\]"
# White text
WHITE="\[\033[97m\]"
# Function to get git branch # Function to get git branch
parse_git_branch() { parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' local branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
if [ -n "$branch" ]; then
echo -e "''${BG_PURPLE}''${FG_GREEN}''${SEP}''${BG_PURPLE}''${WHITE} $branch ''${RESET}''${FG_PURPLE}''${SEP}"
else
echo -e "''${RESET}''${FG_GREEN}''${SEP}"
fi
} }
# Clean prompt with colored chevrons # Powerline prompt
PS1="''${BCYAN}''${BPURPLE}''${RESET} ''${BGREEN}\w''${RESET}''${YELLOW}\$(parse_git_branch)''${RESET} ''${BPURPLE}''${RESET} " PS1="''${BG_GREEN}''${WHITE} \w ''${RESET}\$(parse_git_branch)''${RESET} "
''; '';
programs.bash.interactiveShellInit = '' programs.bash.interactiveShellInit = ''
# Run fastfetch on terminal start # Run fastfetch on terminal start