diff options
| author | ivan-boikov <ik.boikov.public@protonmail.com> | 2024-08-20 01:56:04 +0200 |
|---|---|---|
| committer | ivan-boikov <ik.boikov.public@protonmail.com> | 2024-08-20 01:56:04 +0200 |
| commit | 9dbcc537adee02f8e8cfd42021b59a5c3c9e0e1b (patch) | |
| tree | fa3d3186f35ce2fffb2f94ac00378fb2aa4776ca /shell | |
| parent | 40370656d49498889b1def4cb7474670b5c2fee0 (diff) | |
Fancy and minimal git bash prompt
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/.config/shell/profile | 7 |
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" |
