From 83105d025d1918c8458c6f940a2bbc0db8801502 Mon Sep 17 00:00:00 2001 From: Caleb Ephrem Date: Sat, 16 Aug 2025 10:46:08 +0300 Subject: [PATCH] add quantum theme --- themes/quantum.zsh-theme | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 themes/quantum.zsh-theme diff --git a/themes/quantum.zsh-theme b/themes/quantum.zsh-theme new file mode 100644 index 000000000..562ff1b81 --- /dev/null +++ b/themes/quantum.zsh-theme @@ -0,0 +1,39 @@ +# Quantum Theme For ZSH + +# ๐ŸŽจ Colors +local dir_color="%{$fg_bold[cyan]%}" +local branch_name_color="%{$fg_bold[yellow]%}" +local detached_color="%{$fg_bold[red]%}" +local arrow_color="%{$fg_bold[green]%}" +local reset="%{$reset_color%}" + +# ๐Ÿ“ Current folder name +function quantum_dir_name() { + if [[ "$PWD" == "$HOME" ]]; then + echo "${dir_color}~${reset}" + elif [[ "$PWD" == "/" ]]; then + echo "${dir_color}/${reset}" + else + echo "${dir_color}${PWD##*/}${reset}" + fi +} + +# ๐ŸŒฟ Git branch (symbol + name only if on branch) +function quantum_git_info() { + git rev-parse --is-inside-work-tree &>/dev/null || return + + local ref=$(git symbolic-ref --quiet HEAD 2>/dev/null) + + if [[ -n "$ref" ]]; then + # On a branch + local branch=${ref##refs/heads/} + echo " ${arrow_color}ยป${reset} ${branch_name_color}๎‚  ${branch}${reset}" + else + # Detached HEAD + local commit=$(git rev-parse --short HEAD 2>/dev/null) + echo " ${arrow_color}ยป${reset} ${detached_color}${commit}${reset}" + fi +} + +# ๐Ÿš€ Prompt +PROMPT='$(quantum_dir_name)$(quantum_git_info) ${arrow_color}ยป${reset} '