From 019acfc350777ea54355b3b499b63690cc411bf3 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 28 Jun 2021 13:00:31 +0200 Subject: Switch to powerline-go for nix-shell support --- system/.bashrc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'system/.bashrc') 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; -- cgit v1.2.3