diff options
author | Camil Staps | 2021-06-28 13:00:31 +0200 |
---|---|---|
committer | Camil Staps | 2021-06-28 13:00:31 +0200 |
commit | 019acfc350777ea54355b3b499b63690cc411bf3 (patch) | |
tree | 802b680e8c24b7b55cecbce8b461dc54aa0f614a /system/.bashrc | |
parent | Add settings to .gitconfig.local (diff) |
Switch to powerline-go for nix-shell support
Diffstat (limited to 'system/.bashrc')
-rw-r--r-- | system/.bashrc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/system/.bashrc b/system/.bashrc index 98d3078..9d74f8f 100644 --- a/system/.bashrc +++ b/system/.bashrc @@ -118,10 +118,22 @@ fi GPG_TTY=$(tty) export GPG_TTY -powerline-daemon -q -POWERLINE_BASH_CONTINUATION=1 -POWERLINE_BASH_SELECT=1 -. /usr/local/lib/python3.7/dist-packages/powerline/bindings/bash/powerline.sh +function _update_ps1() { + PS1="$( +$HOME/bin/powerline-go \ + -max-width 40 \ + -modules host,user,cwd,git,nix-shell,jobs,exit \ + -priority host,user,git,cwd,nix-shell,jobs,exit \ + -error $? \ + -git-disable-stats untracked \ + -hostname-only-if-ssh \ + -jobs $(jobs -p | wc -l) + )" +} + +if [ "$TERM" != "linux" ] && [ -f "$HOME/bin/powerline-go" ]; then + PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" +fi PATH="/home/camil/perl5/bin${PATH+:}${PATH}"; export PATH; PERL5LIB="/home/camil/perl5/lib/perl5${PERL5LIB+:}${PERL5LIB}"; export PERL5LIB; |