summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorivan-boikov <ik.boikov.public@protonmail.com>2024-08-20 01:56:04 +0200
committerivan-boikov <ik.boikov.public@protonmail.com>2024-08-20 01:56:04 +0200
commit9dbcc537adee02f8e8cfd42021b59a5c3c9e0e1b (patch)
treefa3d3186f35ce2fffb2f94ac00378fb2aa4776ca /shell
parent40370656d49498889b1def4cb7474670b5c2fee0 (diff)
Fancy and minimal git bash prompt
Diffstat (limited to 'shell')
-rw-r--r--shell/.config/shell/profile7
1 files changed, 5 insertions, 2 deletions
diff --git a/shell/.config/shell/profile b/shell/.config/shell/profile
index 2f2c77e..8157210 100644
--- a/shell/.config/shell/profile
+++ b/shell/.config/shell/profile
@@ -174,8 +174,11 @@ fi
source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/pass-completion"
-# system-wide pipewire
-# export PULSE_SERVER=tcp:127.0.0.1:4713
+# Git branch in prompt.
+parse_git_branch() {
+ git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ [\1]/'
+}
+export PS1="\[\e[01;32m\]\u@\h \[\e[01;34m\]\w\e[01;31m\]\[\$(parse_git_branch)\[\e[00m\] \[\e[01;32m\]\$\[\e[00m\] "
# start graphical server on user's current tty if not already running.
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"