summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-10-08 13:12:56 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-10-08 13:12:56 +0200
commit0033f5386467f32dcee4dbb9cea0f92dd4fe9dc2 (patch)
tree2e6362f355482e19d3f0354e3770bebde6436987
parent62f92d6ed11b8892d32b59178b07e1d52c154bc6 (diff)
parentd9b55a1b4ce254afce95ec836d819d19da5b0d6e (diff)
Merge branch 'main' of db:dotfiles
-rwxr-xr-xbin/extra/supd7
-rw-r--r--config/essentials/zsh/.zshrc11
2 files changed, 8 insertions, 10 deletions
diff --git a/bin/extra/supd b/bin/extra/supd
index 83a606b..4975b94 100755
--- a/bin/extra/supd
+++ b/bin/extra/supd
@@ -19,8 +19,11 @@ check ()
printf 'Up to date.' ||
printf 'Couldn'\''t update.'
printf ' '
- printf '%s\n' "$(git status --short 2> /dev/null |
- awk 'NR==1 {print $1}')"
+ printf '%s %s\n' "$(git status --short 2> /dev/null |
+ awk 'NR==1 {print $1}')" "$(git branch -v 2>/dev/null |
+ grep '^\*' | cut -f2 -d'[' | cut -f1 -d' ' |
+ sed 's/ahead/↑/;s/behind/↓/;s/\*//')"
+
done
}
diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc
index 9b6fa48..2499c45 100644
--- a/config/essentials/zsh/.zshrc
+++ b/config/essentials/zsh/.zshrc
@@ -106,14 +106,9 @@ RPROMPT='%F{blue}$(parse_git_remote)%f%F{red}$(parse_git_status)%f%F{green}$(par
setopt prompt_subst
parse_git_remote() {
- b="$(git branch -v 2>/dev/null | grep "^*" | cut -f2 -d'[' | cut -f1 -d' ')"
- if [ "$b" = "behind" ]
- then
- printf "↓ "
- elif [ "$b" = "ahead" ]
- then
- printf "↑ "
- fi
+ git branch -v 2>/dev/null |
+ grep '^\*' | cut -f2 -d'[' | cut -f1 -d' ' |
+ sed 's/ahead/↑/;s/behind/↓/;s/\*//'
}
parse_git_branch() {
git symbolic-ref --short HEAD 2> /dev/null || git rev-parse --short HEAD 2> /dev/null