From e0e163d7211ed6c1f886d1364d6336643ff95c5c Mon Sep 17 00:00:00 2001 From: Juni Kim Date: Thu, 21 Apr 2022 23:09:26 -0400 Subject: [PATCH] bash prompt --- config.scm | 2 +- guix/.bashrc | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/config.scm b/config.scm index 3a9cf7a..3a3cac2 100644 --- a/config.scm +++ b/config.scm @@ -27,7 +27,7 @@ "git" "ncurses" "xrandr" "stow" "curl" "nss-certs" "icecat" "neovim" "kitty" "i3-gaps" "i3status" "dmenu" "neofetch" "pfetch" - "nfs-utils" "scrot" + "nfs-utils" "scrot" "xclip" )) %base-packages)) (services diff --git a/guix/.bashrc b/guix/.bashrc index 7ab3e96..1742d17 100644 --- a/guix/.bashrc +++ b/guix/.bashrc @@ -46,10 +46,26 @@ timeout 5s pfetch export TERM=alacritty export VISUAL=nvim -export PS1="\[\e[33;1m\][\u@\h] \W$ \[\e[0m\]" + +NORMAL="\[\e[0m\]" +RED="\[\e[31;1m\]" +GREEN="\[\e[32;1m\]" +YELLOW="\[\e[33;1m\]" +BLUE="\[\e[34;1m\]" +PURPLE="\[\e[35m\]" +NEWLINE="\n" + +parse_git_branch() { + git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' +} resetcursor() { printf '\033]50;CursorShape=1\x7' } -export PS1="$(resetcursor)$PS1" +init_ps1() { + PS1="$RED[$YELLOW\u$GREEN@$BLUE\h $PURPLE\W$GREEN`parse_git_branch` $RED]$YELLOW\$$NORMAL " + export PS1="$(resetcursor)$PS1" +} + +export PROMPT_COMMAND=init_ps1