Skip to content

Commit

Permalink
Merge pull request #2037 from gaelicWizard/theme/brunton
Browse files Browse the repository at this point in the history
theme/brunton: `shellcheck`
  • Loading branch information
NoahGorny authored Jan 25, 2022
2 parents 878bbe5 + 27ebc58 commit 44a1b55
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions themes/brunton/brunton.theme.bash
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
# shellcheck shell=bash
# shellcheck disable=SC2034 # Expected behavior for themes.
# shellcheck disable=SC2154 #TODO: fix these all.

SCM_THEME_PROMPT_PREFIX=""
SCM_THEME_PROMPT_SUFFIX=""

SCM_THEME_PROMPT_DIRTY=" ${bold_red}${normal}"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}${normal}"
SCM_GIT_CHAR="${bold_green}±${normal}"
SCM_SVN_CHAR="${bold_cyan}${normal}"
SCM_HG_CHAR="${bold_red}${normal}"
SCM_THEME_PROMPT_DIRTY=" ${bold_red?}${normal?}"
SCM_THEME_PROMPT_CLEAN=" ${bold_green?}${normal?}"
SCM_GIT_CHAR="${bold_green?}±${normal?}"
SCM_SVN_CHAR="${bold_cyan?}${normal?}"
SCM_HG_CHAR="${bold_red?}${normal?}"

is_vim_shell() {
if [ -n "$VIMRUNTIME" ]; then
echo "[${cyan}vim shell${normal}]"
function is_vim_shell() {
if [[ -n "${VIMRUNTIME:-}" ]]; then
echo "[${cyan?}vim shell${normal?}]"
fi
}

prompt() {
SCM_PROMPT_FORMAT=' %s (%s)'
PS1="${white}${background_blue} \u${normal}${background_blue}@${red}${background_blue}\h $(clock_prompt) ${reset_color}${normal} $(battery_charge)\n${bold_black}${background_white} \w ${normal}$(scm_prompt)$(is_vim_shell)\n${white}>${normal} "
function prompt() {
local SCM_PROMPT_FORMAT=' %s (%s)' clock_prompt battery_charge scm_prompt is_vim_shell
clock_prompt="$(clock_prompt)"
battery_charge="$(battery_charge)"
scm_prompt="$(scm_prompt)"
is_vim_shell="$(is_vim_shell)"
PS1="${white?}${background_blue?} \u${normal?}${background_blue?}@${red?}${background_blue?}\h ${clock_prompt} ${reset_color?}${normal?} ${battery_charge}\n${bold_black?}${background_white?} \w ${normal?}${scm_prompt}${is_vim_shell}\n${white?}>${normal?} "
}

THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$blue$background_white"}
THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-" %H:%M:%S"}
: "${THEME_CLOCK_COLOR:=${blue?}${background_white?}}"
: "${THEME_CLOCK_FORMAT:=" %H:%M:%S"}"

safe_append_prompt_command prompt

0 comments on commit 44a1b55

Please sign in to comment.