summaryrefslogtreecommitdiff
path: root/zsh
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-03-01 12:31:08 -0600
committerzachir <zachir@librem.one>2023-03-01 12:31:08 -0600
commit6ca0743b41aa65286e46fb24c392b6bb2b0ae70e (patch)
treec37eab3878c586ea7c74c27eb7f584abf7011799 /zsh
parentbd023dbd59142a859bff7b0f4cf6d3a9d29cd85c (diff)
change zsh prompt color mechanics
Diffstat (limited to 'zsh')
-rw-r--r--zsh/.zshrc17
1 files changed, 14 insertions, 3 deletions
diff --git a/zsh/.zshrc b/zsh/.zshrc
index 9bbea72..a24a43a 100644
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -36,9 +36,18 @@ if [ "$TERM" = "st-256color" ] || [ "$TERM" = "xterm-256color" ]; then
zle -N zle-line-finish
fi
-which pacman >/dev/null && COLOR1="014"
-which apt >/dev/null && COLOR1="010"
-which syspatch >/dev/null && COLOR1="009"
+unset COLOR1
+ZSHTHEMERC="${ZDOTDIR:-$HOME}/.zsh_theme"
+[ -f "$ZSHTHEMERC" ] && . "$ZSHTHEMERC"
+
+if [ -z "$COLOR1" ]; then
+ case "$(whoami)" in
+ zachir) COLOR1="014" ;;
+ git) COLOR1="013" ;;
+ subsonic) COLOR1="012" ;;
+ *) COLOR1="015" ;;
+ esac
+fi
MYPROMPT='%B%S%F{'"$COLOR1"'}[%n@%m]:%f%s%F{015}%~%f%S%F{'"$COLOR1"'}%#%f%s%b '
function zle-line-init zle-keymap-select {
@@ -48,6 +57,8 @@ function zle-line-init zle-keymap-select {
zle reset-prompt
}
+unset COLOR1
+
zle -N zle-line-init
zle -N zle-keymap-select
export KEYTIMEOUT=1