From 93b9d17c6b2c8f63b1d05205c6ec696d998f904c Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 4 Oct 2020 14:41:10 +0530 Subject: migrate to home-manager --- bash/.bash_prompt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'bash/.bash_prompt') diff --git a/bash/.bash_prompt b/bash/.bash_prompt index ca47d1d..eaeecb6 100755 --- a/bash/.bash_prompt +++ b/bash/.bash_prompt @@ -15,10 +15,10 @@ git_branch() { if [[ $git_status =~ $on_branch ]]; then local branch=${BASH_REMATCH[1]} - echo -ne "\001${cyn}\002 $branch\001${rst}\002" + echo -ne "\001${cyn}\002$branch\001${rst}\002" elif [[ $git_status =~ $on_commit ]]; then local commit=${BASH_REMATCH[1]} - echo -ne "\001${prp}\002 $commit\001${rst}\002" + echo -ne "\001${prp}\002$commit\001${rst}\002" fi } @@ -29,7 +29,7 @@ prompt_pwd() { echo "/" else path="$(echo $PWD | sed -e "s-$HOME/--g")" - echo -ne " \001${gry}\002$path/\001${rst}\002" + echo -ne "\001${gry}\002$path/\001${rst}\002" fi } @@ -37,7 +37,7 @@ rootornot() { if [[ "$(id -u)" -eq 0 ]]; then echo -ne "\001${red}\002#\001${rst}\002" else - echo -ne "$" + echo -ne "λ" fi } @@ -47,7 +47,19 @@ host() { fi } +in_nix() { + if [ "$IN_NIX_SHELL" == "impure" ]; then + echo -ne "\001${red}\002(nix)\001${rst}\002" + elif [ "$IN_NIX_SHELL" == "pure" ]; then + echo -ne "\001${grn}\002(nix)\001${rst}\002" + else + echo -ne "" + fi + +} + +# export PS1='\n$(prompt_pwd) $(git_branch)\n$(rootornot) ' export PS1='\n$(pista)' export PS2=" > " -- cgit v1.2.3