dkjf
This commit is contained in:
parent
a2fdbd2cb0
commit
14fc2fe827
1 changed files with 12 additions and 11 deletions
|
@ -1,21 +1,22 @@
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
# TODO: Add vcs and nix shell indicator
|
# TODO: Add vcs
|
||||||
|
|
||||||
# stt colors
|
# stt colors
|
||||||
local c0=$'\e[0;0m'
|
local c0='%{\e[0;0m%}'
|
||||||
local c31=$'\e[31;0m'
|
local c31='%{\e[31;0m%}'
|
||||||
local c33=$'\e[33;0m'
|
local c33='%{\e[33;0m%}'
|
||||||
local c34=$'\e[34;0m'
|
local c34='%{\e[34;0m%}'
|
||||||
local c35=$'\e[35;0m'
|
local c35='%{\e[35;0m%}'
|
||||||
local c38=$'\e[38;0m'
|
local c38='%{\e[38;0m%}'
|
||||||
# end colors
|
# 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
|
if [ -n "$IN_NIX_SHELL" ]; then
|
||||||
nix_shell_ps1="$nix_shell_ps1_t"
|
local nix_shell_ps1="$nix_shell_ps1_t"
|
||||||
elif [[ "$PATH" == *"/nix/store"* ]]; then
|
elif [[ "$path_no_ghostty" == *"/nix/store"* ]]; then
|
||||||
IN_NIX_SHELL=true
|
IN_NIX_SHELL=true
|
||||||
nix_shell_ps1="$nix_shell_ps1_t"
|
local nix_shell_ps1="$nix_shell_ps1_t"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export PS1="${c35}[${c31}%3~${nix_shell_ps1}${c35}]${c0}# "
|
export PS1="${c35}[${c31}%3~${nix_shell_ps1}${c35}]${c0}# "
|
||||||
|
|
Loading…
Add table
Reference in a new issue