aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-09-11 10:23:53 -0300
committerEuAndreh <eu@euandre.org>2023-09-11 10:23:53 -0300
commit216f421c0134627d9e788ca5143892023782a225 (patch)
tree383696b49f671c39223b56f0dc0bfbd39784ef0f
parentetc/guix/home.scm: Add "libevent" package (diff)
downloaddotfiles-216f421c0134627d9e788ca5143892023782a225.tar.gz
dotfiles-216f421c0134627d9e788ca5143892023782a225.tar.xz
etc/sh/rc: Add direnv_status() to $PS1
-rw-r--r--etc/sh/rc8
1 files changed, 7 insertions, 1 deletions
diff --git a/etc/sh/rc b/etc/sh/rc
index 758988a..af6e946 100644
--- a/etc/sh/rc
+++ b/etc/sh/rc
@@ -282,13 +282,19 @@ in_ssh_session() {
fi
}
+direnv_status() {
+ if [ -n "${DIRENV_FILE:-}" ]; then
+ color -c lightblue '.'
+ fi
+}
+
vcs_status() {
timeout 0.5 vcs ps1 || if [ $? = 124 ]; then
color -c red '❌'
fi
}
-PS1='`error_marker`'$(timestamp)' '$(path)' `shell_status``vcs_status``guix_env``in_nix_shell`
+PS1='`error_marker`'$(timestamp)' '$(path)'`direnv_status` `shell_status``vcs_status``guix_env``in_nix_shell`
'$(in_ssh_session)'$ '