aboutsummaryrefslogtreecommitdiff
path: root/bashrc.d/prompt
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-06-11 22:05:17 +0200
committerKarel Kočí <cynerd@email.cz>2022-06-11 22:29:52 +0200
commitf6b661ebf0cbd9ecae64eb1f757dc1b4073b1d73 (patch)
tree9a6d19a0e248f07133b4b0efa57e47dd2f125baa /bashrc.d/prompt
parentfe900d86a3ade098bad9d99d7c53806df32a9077 (diff)
downloadshellrc-f6b661ebf0cbd9ecae64eb1f757dc1b4073b1d73.tar.gz
shellrc-f6b661ebf0cbd9ecae64eb1f757dc1b4073b1d73.tar.bz2
shellrc-f6b661ebf0cbd9ecae64eb1f757dc1b4073b1d73.zip
Allow using in nix develop and use prompt to signal it
Diffstat (limited to 'bashrc.d/prompt')
-rw-r--r--bashrc.d/prompt4
1 files changed, 3 insertions, 1 deletions
diff --git a/bashrc.d/prompt b/bashrc.d/prompt
index dee3e53..6632037 100644
--- a/bashrc.d/prompt
+++ b/bashrc.d/prompt
@@ -1,8 +1,10 @@
# vim: ft=sh
PS1='$(
-if [ `id -u` -eq "0" ]; then
+if [ "$(id -u)" -eq "0" ]; then
echo -n "\[\e[1;31m\]\u@\h:\[\e[1;34m\]\W\[\e[1;31m\]\$\[\e[0m\] "
+elif [ "${_SHELLRC:-}" = "develop" ]; then
+ echo -n "\[\e[1;33m\]\u@\h:\[\e[1;34m\]\W\[\e[1;33m\]\$\[\e[0m\] "
else
echo -n "\[\e[1;32m\]\u@\h:\[\e[1;34m\]\W\[\e[1;32m\]\$\[\e[0m\] "
fi)'