diff options
author | Thanos Apollo <[email protected]> | 2024-05-23 10:26:26 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-05-23 10:26:26 +0300 |
commit | f50271226ce3faa0bdf13e2882deb30a7efc2338 (patch) | |
tree | 2c7faf1409f62a855b6b69aea2c886f4dc42190f | |
parent | 2b0c0e6d12b645b2b8cb25d27808225b9c0ae32d (diff) |
prompt: Adjust for guix env
-rw-r--r-- | bash-prompt.sh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/bash-prompt.sh b/bash-prompt.sh index 438b8be..210aa2a 100644 --- a/bash-prompt.sh +++ b/bash-prompt.sh @@ -1,7 +1,15 @@ -## Prompt + if ${use_color} ; then - PS1='$(git branch --show-current 2>/dev/null)'; PS1='\n\[\e[38;5;102;2;3m\]\u\[\e[0m\]@\[\e[38;5;153;2;3m\]\h\n\[\e[0;38;5;226m\]\w \[\e[38;5;75;3m\]${PS1_CMD1}\n\[\e[0;38;5;198m\]λ \[\e[0m\]' + if [ -n "$GUIX_ENVIRONMENT" ]; then + PS1='\n\[\e[38;5;102;2;3m\]\u\[\e[0m\]@\[\e[38;5;153;2;3m\]\h \[\e[38;5;75;3m\](env)\n\[\e[0;38;5;226m\]\w \[\e[38;5;75;3m\]${PS1_CMD1}\n\[\e[0;38;5;198m\]λ \[\e[0m\]' + else + PS1='\n\[\e[38;5;102;2;3m\]\u\[\e[0m\]@\[\e[38;5;153;2;3m\]\h\n\[\e[0;38;5;226m\]\w \[\e[38;5;75;3m\]${PS1_CMD1}\n\[\e[0;38;5;198m\]λ \[\e[0m\]' + fi else - PS1+='\u@\h \w \$ ' + if [ -n "$GUIX_ENVIRONMENT" ]; then + PS1+='\u@\h (guix env) \w \$ ' + else + PS1+='\u@\h \w \$ ' + fi fi |