Skip to content

Commit 8c16714

Browse files
seefoodclaude
andcommitted
Clean up 5 additional theme files and expand linting coverage
• Fix color variable references using ${var?} pattern for robust error handling • Resolve SC2181 exit code checking and SC2236 style issues in modern-time theme • Remove problematic shebang lines from theme files per bash-it standards • Add themes/modern-time, themes/morris, themes/n0qorg, themes/newin, themes/nwinkler to clean_files.txt • All themes pass shellcheck, shfmt, and bash-it requirements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent dd53b0a commit 8c16714

File tree

6 files changed

+44
-31
lines changed

6 files changed

+44
-31
lines changed

clean_files.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ themes/metal
8181
themes/minimal
8282
themes/modern
8383
themes/modern-t
84+
themes/modern-time
85+
themes/morris
86+
themes/n0qorg
87+
themes/newin
8488
themes/norbu
89+
themes/nwinkler
8590
themes/oh-my-posh
8691
themes/p4helpers.theme.bash
8792
themes/pete

themes/modern-time/modern-time.theme.bash

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
# shellcheck shell=bash
2+
# shellcheck disable=SC2034
13
# Modified version of the original modern theme in bash-it
24
# Removes the battery charge and adds the current time
35

46
SCM_THEME_PROMPT_PREFIX=""
57
SCM_THEME_PROMPT_SUFFIX=""
68

7-
SCM_THEME_PROMPT_DIRTY=" ${bold_red}${normal}"
8-
SCM_THEME_PROMPT_CLEAN=" ${bold_green}${normal}"
9-
SCM_GIT_CHAR="${bold_green}±${normal}"
10-
SCM_SVN_CHAR="${bold_cyan}${normal}"
11-
SCM_HG_CHAR="${bold_red}${normal}"
9+
SCM_THEME_PROMPT_DIRTY=" ${bold_red?}${normal?}"
10+
SCM_THEME_PROMPT_CLEAN=" ${bold_green?}${normal?}"
11+
SCM_GIT_CHAR="${bold_green?}±${normal?}"
12+
SCM_SVN_CHAR="${bold_cyan?}${normal?}"
13+
SCM_HG_CHAR="${bold_red?}${normal?}"
1214

1315
case $TERM in
1416
xterm*)
@@ -22,8 +24,8 @@ esac
2224
PS3=">> "
2325

2426
is_vim_shell() {
25-
if [ ! -z "$VIMRUNTIME" ]; then
26-
echo "[${cyan}vim shell${normal}]"
27+
if [ -n "$VIMRUNTIME" ]; then
28+
echo "[${cyan?}vim shell${normal?}]"
2729
fi
2830
}
2931

@@ -33,14 +35,15 @@ modern_current_time_prompt() {
3335

3436
prompt() {
3537
SCM_PROMPT_FORMAT='[%s][%s]'
36-
if [ $? -ne 0 ]; then
38+
local last_status=$?
39+
if [ $last_status -ne 0 ]; then
3740
# Yes, the indenting on these is weird, but it has to be like
3841
# this otherwise it won't display properly.
3942

40-
PS1="${TITLEBAR}${bold_red}┌─${reset_color}$(scm_prompt)$(modern_current_time_prompt)[${cyan}\W${normal}]$(is_vim_shell)
41-
${bold_red}└─▪${normal} "
43+
PS1="${TITLEBAR}${bold_red?}┌─${reset_color?}$(scm_prompt)$(modern_current_time_prompt)[${cyan?}\W${normal?}]$(is_vim_shell)
44+
${bold_red?}└─▪${normal?} "
4245
else
43-
PS1="${TITLEBAR}┌─$(scm_prompt)$(modern_current_time_prompt)[${cyan}\W${normal}]$(is_vim_shell)
46+
PS1="${TITLEBAR}┌─$(scm_prompt)$(modern_current_time_prompt)[${cyan?}\W${normal?}]$(is_vim_shell)
4447
└─▪ "
4548
fi
4649
}

themes/morris/morris.theme.bash

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# shellcheck shell=bash
2+
# shellcheck disable=SC2034
13
# prompt theming
24

35
# added TITLEBAR for updating the tab and window titles with the pwd
@@ -18,9 +20,9 @@ function prompt_command() {
1820
}
1921

2022
# scm theming
21-
SCM_THEME_PROMPT_DIRTY=" ${red}"
22-
SCM_THEME_PROMPT_CLEAN=" ${bold_green}"
23-
SCM_THEME_PROMPT_PREFIX="${green}("
24-
SCM_THEME_PROMPT_SUFFIX="${green})${reset_color}"
23+
SCM_THEME_PROMPT_DIRTY=" ${red?}"
24+
SCM_THEME_PROMPT_CLEAN=" ${bold_green?}"
25+
SCM_THEME_PROMPT_PREFIX="${green?}("
26+
SCM_THEME_PROMPT_SUFFIX="${green?})${reset_color?}"
2527

2628
safe_append_prompt_command prompt_command

themes/n0qorg/n0qorg.theme.bash

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
#!/usr/bin/env bash
1+
# shellcheck shell=bash
2+
# shellcheck disable=SC2034
23
# n0qorg theme by Florian Baumann <[email protected]>
34

45
## look-a-like
56
# host directory (branch*)»
67
# for example:
78
# ananas ~/Code/bash-it/themes (master*)»
89
function prompt_command() {
9-
PS1="${bold_blue}[$(hostname)]${normal} \w${normal} ${bold_white}[$(git_prompt_info)]${normal}» "
10+
PS1="${bold_blue?}[$(hostname)]${normal?} \w${normal?} ${bold_white?}[$(git_prompt_info)]${normal?}» "
1011
}
1112

1213
safe_append_prompt_command prompt_command
1314

1415
## git-theme
1516
# feel free to change git chars.
16-
GIT_THEME_PROMPT_DIRTY="${bold_blue}*${bold_white}"
17+
GIT_THEME_PROMPT_DIRTY="${bold_blue?}*${bold_white?}"
1718
GIT_THEME_PROMPT_CLEAN=""
18-
GIT_THEME_PROMPT_PREFIX="${bold_blue}(${bold_white}"
19-
GIT_THEME_PROMPT_SUFFIX="${bold_blue})"
19+
GIT_THEME_PROMPT_PREFIX="${bold_blue?}(${bold_white?}"
20+
GIT_THEME_PROMPT_SUFFIX="${bold_blue?})"
2021

2122
## alternate chars
2223
#

themes/newin/newin.theme.bash

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
#!/usr/bin/env bash
1+
# shellcheck shell=bash
2+
# shellcheck disable=SC2034
23

3-
SCM_THEME_PROMPT_DIRTY=" ${red}"
4-
SCM_THEME_PROMPT_CLEAN=" ${green}"
5-
SCM_THEME_PROMPT_PREFIX=" ${purple}|${green} "
6-
SCM_THEME_PROMPT_SUFFIX="${purple} |"
4+
SCM_THEME_PROMPT_DIRTY=" ${red?}"
5+
SCM_THEME_PROMPT_CLEAN=" ${green?}"
6+
SCM_THEME_PROMPT_PREFIX=" ${purple?}|${green?} "
7+
SCM_THEME_PROMPT_SUFFIX="${purple?} |"
78

89
prompt() {
910
exit_code=$?
10-
PS1="$(if [[ ${exit_code} = 0 ]]; then echo "${green}${exit_code}"; else echo "${red}${exit_code}"; fi) ${yellow}\t ${cyan}\w$(scm_prompt_info)${reset_color}\n${orange}$ ${reset_color}"
11+
PS1="$(if [[ ${exit_code} = 0 ]]; then echo "${green?}${exit_code}"; else echo "${red?}${exit_code}"; fi) ${yellow?}\t ${cyan?}\w$(scm_prompt_info)${reset_color?}\n${orange?}$ ${reset_color?}"
1112
}
1213

1314
safe_append_prompt_command prompt

themes/nwinkler/nwinkler.theme.bash

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# shellcheck shell=bash
2+
# shellcheck disable=SC2034
23

34
# Two line prompt showing the following information:
45
# (time) SCM [username@hostname] pwd (SCM branch SCM status)
@@ -15,8 +16,8 @@
1516
# The exit code functionality currently doesn't work if you are using the 'fasd' plugin,
1617
# since 'fasd' is messing with the $PROMPT_COMMAND
1718

18-
PROMPT_END_CLEAN="${green}${reset_color}"
19-
PROMPT_END_DIRTY="${red}${reset_color}"
19+
PROMPT_END_CLEAN="${green?}${reset_color?}"
20+
PROMPT_END_DIRTY="${red?}${reset_color?}"
2021

2122
function prompt_end() {
2223
echo -e "$PROMPT_END"
@@ -31,15 +32,15 @@ prompt_setter() {
3132
fi
3233
# Save history
3334
_save-and-reload-history 1
34-
PS1="($(clock_prompt)) $(scm_char) [${blue}\u${reset_color}@${green}\H${reset_color}] ${yellow}\w${reset_color}$(scm_prompt_info) ${reset_color}\n$(prompt_end) "
35+
PS1="($(clock_prompt)) $(scm_char) [${blue?}\u${reset_color?}@${green?}\H${reset_color?}] ${yellow?}\w${reset_color?}$(scm_prompt_info) ${reset_color?}\n$(prompt_end) "
3536
PS2='> '
3637
PS4='+ '
3738
}
3839

3940
safe_append_prompt_command prompt_setter
4041

41-
SCM_THEME_PROMPT_DIRTY=" ${bold_red}${normal}"
42-
SCM_THEME_PROMPT_CLEAN=" ${bold_green}${normal}"
42+
SCM_THEME_PROMPT_DIRTY=" ${bold_red?}${normal?}"
43+
SCM_THEME_PROMPT_CLEAN=" ${bold_green?}${normal?}"
4344
SCM_THEME_PROMPT_PREFIX=" ("
4445
SCM_THEME_PROMPT_SUFFIX=")"
4546
RVM_THEME_PROMPT_PREFIX=" ("

0 commit comments

Comments
 (0)