1
Fork 0
This commit is contained in:
caem 2025-01-24 12:49:08 +01:00
parent a2fdbd2cb0
commit 14fc2fe827
Signed by: caem
GPG key ID: 69A830D03203405F

View file

@ -1,21 +1,22 @@
#!/usr/bin/env zsh
# TODO: Add vcs and nix shell indicator
# TODO: Add vcs
# stt colors
local c0=$'\e[0;0m'
local c31=$'\e[31;0m'
local c33=$'\e[33;0m'
local c34=$'\e[34;0m'
local c35=$'\e[35;0m'
local c38=$'\e[38;0m'
local c0='%{\e[0;0m%}'
local c31='%{\e[31;0m%}'
local c33='%{\e[33;0m%}'
local c34='%{\e[34;0m%}'
local c35='%{\e[35;0m%}'
local c38='%{\e[38;0m%}'
# end colors
nix_shell_ps1_t=" $c34{$c33󱄅 shell$c34}$c0"
local nix_shell_ps1_t=" $c34{$c33󱄅 shell$c34}$c0"
local path_no_ghostty="$(echo "$PATH" | sed -e 's/:\/nix\/store\/.*-ghostty-.*\/bin://g')"
if [ -n "$IN_NIX_SHELL" ]; then
nix_shell_ps1="$nix_shell_ps1_t"
elif [[ "$PATH" == *"/nix/store"* ]]; then
local nix_shell_ps1="$nix_shell_ps1_t"
elif [[ "$path_no_ghostty" == *"/nix/store"* ]]; then
IN_NIX_SHELL=true
nix_shell_ps1="$nix_shell_ps1_t"
local nix_shell_ps1="$nix_shell_ps1_t"
fi
export PS1="${c35}[${c31}%3~${nix_shell_ps1}${c35}]${c0}# "