diff --git a/clean_files.txt b/clean_files.txt index 203d1caa42..bfc5596144 100644 --- a/clean_files.txt +++ b/clean_files.txt @@ -41,7 +41,6 @@ themes/atomic themes/axin themes/bakke themes/barbuk -themes/base.theme.bash themes/binaryanomaly themes/bira themes/bobby @@ -53,6 +52,8 @@ themes/clean themes/codeword themes/cooperkid themes/cupcake +themes/demula +themes/dos themes/doubletime themes/doubletime_multiline themes/doubletime_multiline_pyonly @@ -60,12 +61,19 @@ themes/dulcie themes/duru themes/easy themes/elixr +themes/emperor +themes/envy themes/essential -themes/githelpers.theme.bash +themes/font +themes/gallifrey themes/gitline +themes/hawaii50 themes/inretio +themes/iterate +themes/kitsune themes/lambda themes/liquidprompt +themes/luan themes/modern themes/norbu themes/oh-my-posh diff --git a/themes/agnoster/agnoster.theme.bash b/themes/agnoster/agnoster.theme.bash index d5bac5ca69..c274058994 100644 --- a/themes/agnoster/agnoster.theme.bash +++ b/themes/agnoster/agnoster.theme.bash @@ -235,7 +235,8 @@ prompt_histdt() { } git_status_dirty() { - dirty=$(git status -s 2> /dev/null | tail -n 1) + local dirty + dirty=$(git status --porcelain 2> /dev/null | tail -n 1) [[ -n $dirty ]] && echo " ●" } diff --git a/themes/demula/demula.theme.bash b/themes/demula/demula.theme.bash index f20e6097aa..4bf2e1efd7 100644 --- a/themes/demula/demula.theme.bash +++ b/themes/demula/demula.theme.bash @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +# shellcheck shell=bash +# shellcheck disable=SC2034 # Expected behavior for themes. # Theme inspired on: # - Ronacher's dotfiles (mitsuhikos) - http://github.com/mitsuhiko/dotfiles/tree/master/bash/ @@ -10,40 +11,40 @@ # Screenshot: http://goo.gl/VCmX5 # by Jesus de Mula -# For the real Monokai colors you should add these to your .XDefaults or -# terminal configuration: -#! ----------------------------------------------------------- TERMINAL COLORS -#! monokai - http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/ -#*background: #272822 -#*foreground: #E2DA6E -#*color0: black -#! mild red -#*color1: #CD0000 -#! light green -#*color2: #A5E02D -#! orange (yellow) -#*color3: #FB951F -#! "dark" blue -#*color4: #076BCC -#! hot pink -#*color5: #F6266C -#! cyan -#*color6: #64D9ED -#! gray -#*color7: #E5E5E5 +## For the real Monokai colors you should add these to your .XDefaults or +## terminal configuration: +## ! ----------------------------------------------------------- TERMINAL COLORS +## ! monokai - http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/ +## *background: #272822 +## *foreground: #E2DA6E +## *color0: black +## ! mild red +## *color1: #CD0000 +## ! light green +## *color2: #A5E02D +## ! orange (yellow) +## *color3: #FB951F +## ! "dark" blue +## *color4: #076BCC +## ! hot pink +## *color5: #F6266C +## ! cyan +## *color6: #64D9ED +## ! gray +## *color7: #E5E5E5 # ----------------------------------------------------------------- COLOR CONF -D_DEFAULT_COLOR="${normal}" -D_INTERMEDIATE_COLOR="${white}" -D_USER_COLOR="${purple}" -D_SUPERUSER_COLOR="${red}" -D_MACHINE_COLOR="${cyan}" -D_DIR_COLOR="${green}" -D_SCM_COLOR="${yellow}" -D_BRANCH_COLOR="${yellow}" -D_CHANGES_COLOR="${white}" -D_CMDFAIL_COLOR="${red}" -D_VIMSHELL_COLOR="${cyan}" +D_DEFAULT_COLOR="${normal?}" +D_INTERMEDIATE_COLOR="${white?}" +D_USER_COLOR="${purple?}" +D_SUPERUSER_COLOR="${red?}" +D_MACHINE_COLOR="${cyan?}" +D_DIR_COLOR="${green?}" +D_SCM_COLOR="${yellow?}" +D_BRANCH_COLOR="${yellow?}" +D_CHANGES_COLOR="${white?}" +D_CMDFAIL_COLOR="${red?}" +D_VIMSHELL_COLOR="${cyan?}" # ------------------------------------------------------------------ FUNCTIONS case $TERM in @@ -56,7 +57,7 @@ case $TERM in esac is_vim_shell() { - if [ ! -z "$VIMRUNTIME" ]; then + if [ -n "$VIMRUNTIME" ]; then echo "${D_INTERMEDIATE_COLOR}on ${D_VIMSHELL_COLOR}\ vim shell${D_DEFAULT_COLOR} " fi @@ -72,7 +73,7 @@ $code ${D_DEFAULT_COLOR}" # vcprompt for scm instead of bash_it default demula_vcprompt() { - if [ ! -z "$VCPROMPT_EXECUTABLE" ]; then + if [ -n "$VCPROMPT_EXECUTABLE" ]; then local D_VCPROMPT_FORMAT="on ${D_SCM_COLOR}%s${D_INTERMEDIATE_COLOR}:\ ${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${D_DEFAULT_COLOR}" $VCPROMPT_EXECUTABLE -f "$D_VCPROMPT_FORMAT" @@ -88,7 +89,8 @@ safe_battery_charge() { # -------------------------------------------------------------- PROMPT OUTPUT prompt() { - local LAST_COMMAND_FAILED=$(mitsuhikos_lastcommandfailed) + local LAST_COMMAND_FAILED + LAST_COMMAND_FAILED=$(mitsuhikos_lastcommandfailed) local SAVE_CURSOR='\033[s' local RESTORE_CURSOR='\033[u' local MOVE_CURSOR_RIGHTMOST='\033[500C' diff --git a/themes/dos/dos.theme.bash b/themes/dos/dos.theme.bash index 17f0cff646..d7e072c2e9 100644 --- a/themes/dos/dos.theme.bash +++ b/themes/dos/dos.theme.bash @@ -1 +1,3 @@ +# shellcheck shell=bash +# shellcheck disable=SC2034 # Expected behavior for themes. PROMPT="\w>>" diff --git a/themes/emperor/emperor.theme.bash b/themes/emperor/emperor.theme.bash index 2f02eca78a..da145fcd6f 100644 --- a/themes/emperor/emperor.theme.bash +++ b/themes/emperor/emperor.theme.bash @@ -1,29 +1,30 @@ -#!/usr/bin/env bash +# shellcheck shell=bash +# shellcheck disable=SC2034 # Expected behavior for themes. -SCM_THEME_PROMPT_DIRTY=" ${red}✗" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" +SCM_THEME_PROMPT_DIRTY=" ${red?}✗" +SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" SCM_THEME_PROMPT_PREFIX=" |" -SCM_THEME_PROMPT_SUFFIX="${green}|" +SCM_THEME_PROMPT_SUFFIX="${green?}|" -GIT_THEME_PROMPT_DIRTY=" ${red}✗" -GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓" -GIT_THEME_PROMPT_PREFIX=" ${green}|" -GIT_THEME_PROMPT_SUFFIX="${green}|" +GIT_THEME_PROMPT_DIRTY=" ${red?}✗" +GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" +GIT_THEME_PROMPT_PREFIX=" ${green?}|" +GIT_THEME_PROMPT_SUFFIX="${green?}|" RVM_THEME_PROMPT_PREFIX="|" RVM_THEME_PROMPT_SUFFIX="|" function get_hour_color { - hour_color=$red + hour_color=${red?} min=$(date +%M) if [ "$min" -lt "15" ]; then - hour_color=$white + hour_color=${white?} elif [ "$min" -lt "30" ]; then - hour_color=$green + hour_color=${green?} elif [ "$min" -lt "45" ]; then - hour_color=$yellow + hour_color=${yellow?} else - hour_color=$red + hour_color=${red?} fi echo "$hour_color" } @@ -34,7 +35,7 @@ __emperor_clock() { } function prompt_command() { - PS1="\n$(__emperor_clock)${purple}\h ${reset_color}in ${prompt_color}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} " + PS1="\n$(__emperor_clock)${purple?}\h ${reset_color?}in ${prompt_color?}\w\n${bold_cyan?}$(scm_char)${green?}$(scm_prompt_info) ${green?}→${reset_color?} " } THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%H "} diff --git a/themes/envy/envy.theme.bash b/themes/envy/envy.theme.bash index ae28c1f622..acb0136fb9 100644 --- a/themes/envy/envy.theme.bash +++ b/themes/envy/envy.theme.bash @@ -1,19 +1,21 @@ -#!/usr/bin/env bash -SCM_THEME_PROMPT_DIRTY=" ${red}✗" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" +# shellcheck shell=bash +# shellcheck disable=SC2034 # Expected behavior for themes. + +SCM_THEME_PROMPT_DIRTY=" ${red?}✗" +SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" SCM_THEME_PROMPT_PREFIX=" |" -SCM_THEME_PROMPT_SUFFIX="${green}|" +SCM_THEME_PROMPT_SUFFIX="${green?}|" -GIT_THEME_PROMPT_DIRTY=" ${red}✗" -GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓" -GIT_THEME_PROMPT_PREFIX=" ${green}|" -GIT_THEME_PROMPT_SUFFIX="${green}|" +GIT_THEME_PROMPT_DIRTY=" ${red?}✗" +GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" +GIT_THEME_PROMPT_PREFIX=" ${green?}|" +GIT_THEME_PROMPT_SUFFIX="${green?}|" -VIRTUALENV_THEME_PROMPT_PREFIX="${green}ⓔ " +VIRTUALENV_THEME_PROMPT_PREFIX="${green?}ⓔ " VIRTUALENV_THEME_PROMPT_SUFFIX="" function prompt_command() { - PS1="\n$(virtualenv_prompt)${yellow}$(ruby_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} " + PS1="\n$(virtualenv_prompt)${yellow?}$(ruby_version_prompt) ${purple?}\h ${reset_color?}in ${green?}\w\n${bold_cyan?}$(scm_char)${green?}$(scm_prompt_info) ${green?}→${reset_color?} " } safe_append_prompt_command prompt_command diff --git a/themes/font/font.theme.bash b/themes/font/font.theme.bash index 5af5e0e013..bf010b7352 100644 --- a/themes/font/font.theme.bash +++ b/themes/font/font.theme.bash @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +# shellcheck shell=bash +# shellcheck disable=SC2034 # Expected behavior for themes. # # One line prompt showing the following configurable information # for git: @@ -22,20 +23,20 @@ # SCM_NONE_CHAR='' -SCM_THEME_PROMPT_DIRTY=" ${red}✗" +SCM_THEME_PROMPT_DIRTY=" ${red?}✗" SCM_THEME_PROMPT_CLEAN="" -SCM_THEME_PROMPT_PREFIX="${green}|" -SCM_THEME_PROMPT_SUFFIX="${green}|" +SCM_THEME_PROMPT_PREFIX="${green?}|" +SCM_THEME_PROMPT_SUFFIX="${green?}|" SCM_GIT_SHOW_MINIMAL_INFO=true CLOCK_THEME_PROMPT_PREFIX='' CLOCK_THEME_PROMPT_SUFFIX=' ' THEME_SHOW_CLOCK=false -THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$bold_blue"} +THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"${bold_blue?}"} THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%I:%M:%S"} THEME_SHOW_USER_HOST=true -USER_HOST_THEME_PROMPT_PREFIX="${bold_black}" +USER_HOST_THEME_PROMPT_PREFIX="${bold_black?}" USER_HOST_THEME_PROMPT_SUFFIX=" " VIRTUALENV_THEME_PROMPT_PREFIX='(' @@ -45,20 +46,20 @@ function prompt_command() { # This needs to be first to save last command return code local RC="$?" - hostname="${bold_black}\u@\h" - virtualenv="${white}$(virtualenv_prompt)" + hostname="${bold_black?}\u@\h" + virtualenv="${white?}$(virtualenv_prompt)" # Set return status color if [[ ${RC} == 0 ]]; then - ret_status="${bold_green}" + ret_status="${bold_green?}" else - ret_status="${bold_red}" + ret_status="${bold_red?}" fi # Append new history lines to history file history -a - PS1="$(clock_prompt)${virtualenv}$(user_host_prompt)${bold_cyan}\W $(scm_prompt_char_info)${ret_status}→ ${normal}" + PS1="$(clock_prompt)${virtualenv}$(user_host_prompt)${bold_cyan?}\W $(scm_prompt_char_info)${ret_status}→ ${normal?}" } safe_append_prompt_command prompt_command diff --git a/themes/gallifrey/gallifrey.theme.bash b/themes/gallifrey/gallifrey.theme.bash index cbffc78c46..2a529bede3 100644 --- a/themes/gallifrey/gallifrey.theme.bash +++ b/themes/gallifrey/gallifrey.theme.bash @@ -1,12 +1,14 @@ -# scm theming -SCM_THEME_PROMPT_PREFIX="${yellow}(" -SCM_THEME_PROMPT_SUFFIX=")${normal}" +# shellcheck shell=bash +# shellcheck disable=SC2034 # Expected behavior for themes. + +SCM_THEME_PROMPT_PREFIX="${yellow?}(" +SCM_THEME_PROMPT_SUFFIX=")${normal?}" SCM_THEME_PROMPT_DIRTY="*" SCM_THEME_PROMPT_CLEAN="" -SCM_GIT_CHAR="${green}±${normal}" -SCM_SVN_CHAR="${bold_cyan}⑆${normal}" -SCM_HG_CHAR="${bold_red}☿${normal}" +SCM_GIT_CHAR="${green?}±${normal?}" +SCM_SVN_CHAR="${bold_cyan?}⑆${normal?}" +SCM_HG_CHAR="${bold_red?}☿${normal?}" ### TODO: openSUSE has already colors enabled, check if those differs from stock # LS colors, made with http://geoff.greer.fm/lscolors/ @@ -16,10 +18,10 @@ SCM_HG_CHAR="${bold_red}☿${normal}" gallifrey_prompt() { SCM_PROMPT_FORMAT='%s%s' - ps_host="${green}\h${normal}" - ps_user_mark="${bold}\$${normal}" - ps_root_mark="${normal}§" - ps_path="${normal}\w" + ps_host="${green?}\h${normal?}" + ps_user_mark="${bold?}\$${normal?}" + ps_root_mark="${normal?}§" + ps_path="${normal?}\w" # make it work case $(id -u) in diff --git a/themes/hawaii50/hawaii50.theme.bash b/themes/hawaii50/hawaii50.theme.bash index 6cba1553fd..25ad6a6a13 100644 --- a/themes/hawaii50/hawaii50.theme.bash +++ b/themes/hawaii50/hawaii50.theme.bash @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +# shellcheck shell=bash +# shellcheck disable=SC2034 # Expected behavior for themes. # # This theme was obviously inspired a lot by # @@ -42,22 +43,22 @@ VIRTUAL_PROMPT_ENABLED=1 # COLORS ====================================================================== ORANGE='\[\e[0;33m\]' -DEFAULT_COLOR="${white}" +DEFAULT_COLOR="${white?}" -USER_COLOR="${purple}" -SUPERUSER_COLOR="${red}" +USER_COLOR="${purple?}" +SUPERUSER_COLOR="${red?}" MACHINE_COLOR=$ORANGE IP_COLOR=$ORANGE -DIRECTORY_COLOR="${green}" +DIRECTORY_COLOR="${green?}" -VE_COLOR="${cyan}" -RVM_COLOR="${cyan}" +VE_COLOR="${cyan?}" +RVM_COLOR="${cyan?}" -REF_COLOR="${purple}" +REF_COLOR="${purple?}" # SCM prompts -SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" +SCM_THEME_PROMPT_DIRTY=" ${bold_red?}✗${normal?}" +SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓${normal?}" SCM_THEME_PROMPT_PREFIX=' on ' SCM_THEME_PROMPT_SUFFIX='' @@ -85,7 +86,7 @@ IP_SEPARATOR=', ' function get_ip_info { myip=$(curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+') - echo -e "$(ips | sed -e :a -e '$!N;s/\n/${IP_SEPARATOR}/;ta' | sed -e 's/127\.0\.0\.1\${IP_SEPARATOR}//g'), ${myip}" + echo -e "$(ips | sed -e :a -e "\$!N;s/\\n/${IP_SEPARATOR}/;ta" | sed -e "s/127\\.0\\.0\\.1\\${IP_SEPARATOR}//g"), ${myip}" } # Displays ip prompt @@ -97,9 +98,10 @@ function ip_prompt_info() { # Displays virtual info prompt (virtualenv/rvm) function virtual_prompt_info() { - local virtual_env_info=$(virtualenv_prompt) - local rvm_info=$(ruby_version_prompt) - local virtual_prompt="" + local virtual_env_info rvm_info virtual_prompt + virtual_env_info=$(virtualenv_prompt) + rvm_info=$(ruby_version_prompt) + virtual_prompt="" local prefix=${VIRTUAL_THEME_PROMPT_PREFIX} local suffix=${VIRTUAL_THEME_PROMPT_SUFFIX} @@ -119,7 +121,10 @@ function virtual_prompt_info() { # Parse git info function git_prompt_info() { - if [[ -n $(git status -s 2> /dev/null | grep -v ^# | grep -v "working directory clean") ]]; then + local dirty + dirty=$(git status --porcelain 2> /dev/null | tail -n 1) + + if [[ -n $dirty ]]; then state=${GIT_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} else state=${GIT_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} @@ -170,7 +175,7 @@ function limited_pwd() { # Replace $HOME with ~ if possible RELATIVE_PWD=${PWD/#$HOME/\~} - local offset=$((${#RELATIVE_PWD} - $MAX_PWD_LENGTH)) + local offset=$((${#RELATIVE_PWD} - MAX_PWD_LENGTH)) if [ $offset -gt "0" ]; then local truncated_symbol="..." @@ -187,9 +192,9 @@ function prompt() { [ $UID -eq "0" ] && UC=$SUPERUSER_COLOR if [[ $VIRTUAL_PROMPT_ENABLED == 1 ]]; then - PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h$(ip_prompt_info) ${DEFAULT_COLOR}in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_prompt_info)$(scm_prompt_info)${reset_color} \$ " + PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h$(ip_prompt_info) ${DEFAULT_COLOR}in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_prompt_info)$(scm_prompt_info)${reset_color?} \$ " else - PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h$(ip_prompt_info) ${DEFAULT_COLOR}in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(scm_prompt_info)${reset_color} \$ " + PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h$(ip_prompt_info) ${DEFAULT_COLOR}in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(scm_prompt_info)${reset_color?} \$ " fi PS2='> ' PS4='+ ' diff --git a/themes/iterate/iterate.theme.bash b/themes/iterate/iterate.theme.bash index 139d28c05c..009accb1cb 100644 --- a/themes/iterate/iterate.theme.bash +++ b/themes/iterate/iterate.theme.bash @@ -1,19 +1,21 @@ -#!/usr/bin/env bash +# shellcheck shell=bash +# shellcheck disable=SC2034 # Expected behavior for themes. + SCM_GIT_CHAR="± " SCM_HG_CHAR="☿ " SCM_SVN_CHAR="⑆ " SCM_NONE_CHAR="" -SCM_THEME_PROMPT_DIRTY=" ${red}✗" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" +SCM_THEME_PROMPT_DIRTY=" ${red?}✗" +SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" SCM_THEME_PROMPT_PREFIX="|" -SCM_THEME_PROMPT_SUFFIX="${green}| " -SCM_GIT_AHEAD_CHAR="${green}+" -SCM_GIT_BEHIND_CHAR="${red}-" +SCM_THEME_PROMPT_SUFFIX="${green?}| " +SCM_GIT_AHEAD_CHAR="${green?}+" +SCM_GIT_BEHIND_CHAR="${red?}-" -GIT_THEME_PROMPT_DIRTY=" ${bold_red}✗" -GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓" -GIT_THEME_PROMPT_PREFIX="${cyan}|" -GIT_THEME_PROMPT_SUFFIX="${cyan}| " +GIT_THEME_PROMPT_DIRTY=" ${bold_red?}✗" +GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" +GIT_THEME_PROMPT_PREFIX="${cyan?}|" +GIT_THEME_PROMPT_SUFFIX="${cyan?}| " RVM_THEME_PROMPT_PREFIX="|" RVM_THEME_PROMPT_SUFFIX="| " @@ -42,8 +44,9 @@ function git_prompt_info { LAST_PROMPT="" function prompt_command() { - local new_PS1="${bold_cyan}$(scm_char)${yellow}$(ruby_version_prompt)${green}\w $(scm_prompt_info)" - local new_prompt=$(PS1="$new_PS1" "$BASH" --norc -i < /dev/null 2>&1 | sed -n '${s/^\(.*\)exit$/\1/p;}') + local new_PS1 new_prompt + new_PS1="${bold_cyan?}$(scm_char)${yellow?}$(ruby_version_prompt)${green?}\w $(scm_prompt_info)" + new_prompt=$(PS1="$new_PS1" "$BASH" --norc -i < /dev/null 2>&1 | sed -n "\${s/^\(.*\)exit\$/\1/p;}") if [ "$LAST_PROMPT" = "$new_prompt" ]; then new_PS1="" @@ -52,8 +55,8 @@ function prompt_command() { fi local wrap_char="" - [[ $COLUMNS && ${#new_PS1} > $(($COLUMNS / 1)) ]] && wrap_char="\n" - PS1="${new_PS1}${green}${wrap_char}→${reset_color} " + [[ $COLUMNS && ${#new_PS1} -gt COLUMNS ]] && wrap_char="\n" + PS1="${new_PS1}${green?}${wrap_char}→${reset_color?} " } safe_append_prompt_command prompt_command diff --git a/themes/kitsune/kitsune.theme.bash b/themes/kitsune/kitsune.theme.bash index 3f767ddf42..268d6e5012 100644 --- a/themes/kitsune/kitsune.theme.bash +++ b/themes/kitsune/kitsune.theme.bash @@ -1,3 +1,6 @@ +# shellcheck shell=bash +# shellcheck disable=SC2034 # Expected behavior for themes. + # This is combination of works from two different people which I combined for my requirement. # Original PS1 was from reddit user /u/Allevil669 which I found in thread: https://www.reddit.com/r/linux/comments/1z33lj/linux_users_whats_your_favourite_bash_prompt/ # I used that PS1 to the bash-it theme 'morris', and customized it to my liking. All credits to /u/Allevil669 and morris. @@ -16,21 +19,22 @@ case $TERM in TITLEBAR="" ;; esac +# shellcheck disable=SC2181 if [ "$?" == "0" ]; then - SC="${green}^_^" + SC="${green?}^_^" else - SC="${red}T_T" + SC="${red?}T_T" fi BC=$(battery_percentage) function prompt_command() { #PS1="${TITLEBAR}[\u@\h \W $(scm_prompt_info)]\$ " - PS1="\n${cyan}┌─${bold_white}[\u@\h]${cyan}─${bold_yellow}(\w)$(scm_prompt_info)\n${cyan}└─${bold_green}[\A]-${green}($BC%)${bold_cyan}-[${green}${bold_green}\$${bold_cyan}]${green} " + PS1="\n${cyan?}┌─${bold_white?}[\u@\h]${cyan?}─${bold_yellow?}(\w)$(scm_prompt_info)\n${cyan?}└─${bold_green?}[\A]-${green?}($BC%)${bold_cyan?}-[${green?}${bold_green?}\$${bold_cyan?}]${green?} " } # scm theming -SCM_THEME_PROMPT_DIRTY=" ${red}✗" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" -SCM_THEME_PROMPT_PREFIX="${bold_cyan}(" -SCM_THEME_PROMPT_SUFFIX="${bold_cyan})${reset_color}" +SCM_THEME_PROMPT_DIRTY=" ${red?}✗" +SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" +SCM_THEME_PROMPT_PREFIX="${bold_cyan?}(" +SCM_THEME_PROMPT_SUFFIX="${bold_cyan?})${reset_color?}" safe_append_prompt_command prompt_command diff --git a/themes/luan/luan.theme.bash b/themes/luan/luan.theme.bash index d5f0331f44..9e0f167404 100644 --- a/themes/luan/luan.theme.bash +++ b/themes/luan/luan.theme.bash @@ -1,33 +1,34 @@ -#!/usr/bin/env bash +# shellcheck shell=bash +# shellcheck disable=SC2034 # Expected behavior for themes. -SCM_THEME_PROMPT_DIRTY=" ${red}✗" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" -SCM_THEME_PROMPT_PREFIX="(${yellow}" -SCM_THEME_PROMPT_SUFFIX="${normal})" +SCM_THEME_PROMPT_DIRTY=" ${red?}✗" +SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓" +SCM_THEME_PROMPT_PREFIX="(${yellow?}" +SCM_THEME_PROMPT_SUFFIX="${normal?})" -GIT_THEME_PROMPT_DIRTY=" ${red}✗" -GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓" -GIT_THEME_PROMPT_PREFIX="(${yellow}" -GIT_THEME_PROMPT_SUFFIX="${normal})" +GIT_THEME_PROMPT_DIRTY=" ${red?}✗" +GIT_THEME_PROMPT_CLEAN=" ${bold_green?}✓" +GIT_THEME_PROMPT_PREFIX="(${yellow?}" +GIT_THEME_PROMPT_SUFFIX="${normal?})" RVM_THEME_PROMPT_PREFIX="" RVM_THEME_PROMPT_SUFFIX="" function prompt_command() { dtime="$(clock_prompt)" - user_host="${green}\u@${cyan}\h${normal}" - current_dir="${bold_blue}\w${normal}" - rvm_ruby="${bold_red}$(ruby_version_prompt)${normal}" - git_branch="$(scm_prompt_info)${normal}" - prompt="${bold_green}\$${normal} " - arrow="${bold_white}▶${normal} " - prompt="${bold_green}\$${normal} " + user_host="${green?}\u@${cyan?}\h${normal?}" + current_dir="${bold_blue?}\w${normal?}" + rvm_ruby="${bold_red?}$(ruby_version_prompt)${normal?}" + git_branch="$(scm_prompt_info)${normal?}" + prompt="${bold_green?}\$${normal?} " + arrow="${bold_white?}▶${normal?} " + prompt="${bold_green?}\$${normal?} " PS1="${dtime}${user_host}:${current_dir} ${rvm_ruby} ${git_branch} $arrow $prompt" } -THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$yellow"} +THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"${yellow?}"} THEME_CLOCK_FORMAT=${THEME_TIME_FORMAT:-"%I:%M:%S "} safe_append_prompt_command prompt_command