mirror of
https://github.com/He4eT/dotfiles.git
synced 2026-05-04 23:47:23 +00:00
zsh: minimal-groups theme
This commit is contained in:
parent
cbd07cd3fb
commit
4045438fb0
1 changed files with 31 additions and 0 deletions
31
zsh/themes/custom-groups.zsh-theme
Normal file
31
zsh/themes/custom-groups.zsh-theme
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}["
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}▴%{$fg[white]%}]%{$reset_color%} "
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="]%{$reset_color%} "
|
||||||
|
|
||||||
|
function braille_prompt() {
|
||||||
|
local input="${1:-0}" # если аргумент не передан, по умолчанию 0
|
||||||
|
local hash=$( echo "$input" | md5sum | cut -d' ' -f1)
|
||||||
|
local braille=$(echo $hash | xxd -r -p | od -An -vtu1 | \
|
||||||
|
awk '{for(i=1;i<=NF;i++) printf "\\U%08x", 0x2800 + $i}' | xargs -0 printf "%b")
|
||||||
|
|
||||||
|
local color='\033[1;30m'
|
||||||
|
local reset='\033[0m'
|
||||||
|
local prefix='▣─□□□─────────────────╼⢸'
|
||||||
|
local postfix='⡇╾──────────╼━━━━'
|
||||||
|
echo -e "${color}${prefix}${braille}${postfix}${reset}"
|
||||||
|
}
|
||||||
|
|
||||||
|
vcs_status() {
|
||||||
|
git_prompt_info
|
||||||
|
}
|
||||||
|
|
||||||
|
precmd() {
|
||||||
|
local exit_code=$?
|
||||||
|
braille_prompt "$exit_code"
|
||||||
|
if [ $exit_code -ne 0 ]; then
|
||||||
|
echo "├╼ Exit code: $exit_code"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
PROMPT='└╼ %2~ $(vcs_status)»%b '
|
||||||
Loading…
Add table
Add a link
Reference in a new issue