diff options
author | Karel Kočí <cynerd@email.cz> | 2022-06-08 18:05:18 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2022-06-08 18:05:18 +0200 |
commit | f2e5e9e814cb860b005faeeddec2959768c0f559 (patch) | |
tree | fb50f952f71ca8e392224fe5a21324ade2c0268f /zshrc.d/prompt | |
parent | cad0481b467ea397a67fef6e6c3cbc59d43a148c (diff) | |
download | shellrc-f2e5e9e814cb860b005faeeddec2959768c0f559.tar.gz shellrc-f2e5e9e814cb860b005faeeddec2959768c0f559.tar.bz2 shellrc-f2e5e9e814cb860b005faeeddec2959768c0f559.zip |
zshrc: path to git-prompt on nixos
Diffstat (limited to 'zshrc.d/prompt')
-rw-r--r-- | zshrc.d/prompt | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/zshrc.d/prompt b/zshrc.d/prompt index 72cbf44..2f84536 100644 --- a/zshrc.d/prompt +++ b/zshrc.d/prompt @@ -8,14 +8,18 @@ PROMPT="%(?..%{$fg_bold[yellow]%}EXIT: %? )%{$fg_bold[$NCOLOR]%}%n@%m:%{$fg_bold[blue]%}%1~%{$fg_bold[$NCOLOR]%}%(!.#.$)%{$reset_color%} " unset NCOLOR -if [ -e /usr/share/git/git-prompt.sh ]; then - source /usr/share/git/git-prompt.sh - export GIT_PS1_SHOWCOLORHINTS=y - export GIT_PS1_SHOWDIRTYSTATE=y - export GIT_PS1_SHOWUNTRACKEDFILES=y - export GIT_PS1_SHOWUPSTREAM="auto" - export GIT_PS1_STATESEPARATOR="" - export GIT_PS1_SHOWUPSTREAM=y - export GIT_PS1_DESCRIBE_STYLE="branch" - RPROMPT='$(__git_ps1 "%s")' -fi +for gitprompt in "/usr/share/git/git-prompt.sh" "/run/current-system/sw/share/bash-completion/completions/git-prompt.sh"; do + if [ -e "$gitprompt" ]; then + source "$gitprompt" + export GIT_PS1_SHOWCOLORHINTS=y + export GIT_PS1_SHOWDIRTYSTATE=y + export GIT_PS1_SHOWUNTRACKEDFILES=y + export GIT_PS1_SHOWUPSTREAM="auto" + export GIT_PS1_STATESEPARATOR="" + export GIT_PS1_SHOWUPSTREAM=y + export GIT_PS1_DESCRIBE_STYLE="branch" + RPROMPT='$(__git_ps1 "%s")' + break + fi +done +unset gitprompt |