Skip to content

Instantly share code, notes, and snippets.

@julianduque
Created March 31, 2019 13:10
Show Gist options
  • Save julianduque/a6910a9b79ac94a6b4b5a769ccceccee to your computer and use it in GitHub Desktop.
Save julianduque/a6910a9b79ac94a6b4b5a769ccceccee to your computer and use it in GitHub Desktop.
Baal Bash-It theme by Julián Duque
#!/usr/bin/env bash
#
SCM_NONE_CHAR=''
SCM_THEME_PROMPT_DIRTY="⚡"
SCM_THEME_PROMPT_CLEAN=""
SCM_THEME_PROMPT_PREFIX="${cyan}[${green}"
SCM_THEME_PROMPT_SUFFIX="${cyan}] "
SCM_GIT_SHOW_MINIMAL_INFO=true
THEME_SHOW_USER_HOST=true
USER_HOST_THEME_PROMPT_PREFIX="${bold_black}::${blue} "
USER_HOST_THEME_PROMPT_SUFFIX=" ${bold_black}:: ${normal}"
function prompt_command() {
# This needs to be first to save last command return code
local RC="$?"
hostname="${bold_blue}\u@\h"
node="${green}⬢ ${white}$(node -v)${normal} "
rust="⚙️ ${white}$(rustc -V | awk '{print $2}')${normal} "
sep="${bold_black}:: ${normal}"
# Set return status color
if [[ ${RC} == 0 ]]; then
ret_status="${bold_green}"
else
ret_status="${bold_red}"
fi
# Append new history lines to history file
history -a
PS1="$(user_host_prompt)$(scm_prompt_char_info)${sep}${node}${sep}${rust}\n ${bold_cyan}\W ${ret_status}→ ${normal}"
}
safe_append_prompt_command prompt_command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment