diff options
author | Akshay <[email protected]> | 2020-10-04 10:11:10 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2020-10-04 10:11:10 +0100 |
commit | 93b9d17c6b2c8f63b1d05205c6ec696d998f904c (patch) | |
tree | 9bbf987a94754646c6ffc4360af86acd3cafbbf3 /bash/.bash_prompt | |
parent | 2ea85d463a7be88b18571277c25056037e07e830 (diff) |
migrate to home-manager
Diffstat (limited to 'bash/.bash_prompt')
-rwxr-xr-x | bash/.bash_prompt | 20 |
1 files changed, 16 insertions, 4 deletions
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() { | |||
15 | 15 | ||
16 | if [[ $git_status =~ $on_branch ]]; then | 16 | if [[ $git_status =~ $on_branch ]]; then |
17 | local branch=${BASH_REMATCH[1]} | 17 | local branch=${BASH_REMATCH[1]} |
18 | echo -ne "\001${cyn}\002 $branch\001${rst}\002" | 18 | echo -ne "\001${cyn}\002$branch\001${rst}\002" |
19 | elif [[ $git_status =~ $on_commit ]]; then | 19 | elif [[ $git_status =~ $on_commit ]]; then |
20 | local commit=${BASH_REMATCH[1]} | 20 | local commit=${BASH_REMATCH[1]} |
21 | echo -ne "\001${prp}\002 $commit\001${rst}\002" | 21 | echo -ne "\001${prp}\002$commit\001${rst}\002" |
22 | fi | 22 | fi |
23 | } | 23 | } |
24 | 24 | ||
@@ -29,7 +29,7 @@ prompt_pwd() { | |||
29 | echo "/" | 29 | echo "/" |
30 | else | 30 | else |
31 | path="$(echo $PWD | sed -e "s-$HOME/--g")" | 31 | path="$(echo $PWD | sed -e "s-$HOME/--g")" |
32 | echo -ne " \001${gry}\002$path/\001${rst}\002" | 32 | echo -ne "\001${gry}\002$path/\001${rst}\002" |
33 | fi | 33 | fi |
34 | } | 34 | } |
35 | 35 | ||
@@ -37,7 +37,7 @@ rootornot() { | |||
37 | if [[ "$(id -u)" -eq 0 ]]; then | 37 | if [[ "$(id -u)" -eq 0 ]]; then |
38 | echo -ne "\001${red}\002#\001${rst}\002" | 38 | echo -ne "\001${red}\002#\001${rst}\002" |
39 | else | 39 | else |
40 | echo -ne "$" | 40 | echo -ne "λ" |
41 | fi | 41 | fi |
42 | } | 42 | } |
43 | 43 | ||
@@ -47,7 +47,19 @@ host() { | |||
47 | fi | 47 | fi |
48 | } | 48 | } |
49 | 49 | ||
50 | in_nix() { | ||
51 | if [ "$IN_NIX_SHELL" == "impure" ]; then | ||
52 | echo -ne "\001${red}\002(nix)\001${rst}\002" | ||
53 | elif [ "$IN_NIX_SHELL" == "pure" ]; then | ||
54 | echo -ne "\001${grn}\002(nix)\001${rst}\002" | ||
55 | else | ||
56 | echo -ne "" | ||
57 | fi | ||
58 | |||
59 | } | ||
60 | |||
50 | 61 | ||
62 | # export PS1='\n$(prompt_pwd) $(git_branch)\n$(rootornot) ' | ||
51 | export PS1='\n$(pista)' | 63 | export PS1='\n$(pista)' |
52 | 64 | ||
53 | export PS2=" > " | 65 | export PS2=" > " |