Skip to content

Commit da80656

Browse files
authored
Merge pull request #2315 from fox-forks/hyperupcall-clean-a-l
2 parents ad10983 + 5c1187c commit da80656

File tree

12 files changed

+172
-140
lines changed

12 files changed

+172
-140
lines changed

clean_files.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ themes/atomic
4141
themes/axin
4242
themes/bakke
4343
themes/barbuk
44-
themes/base.theme.bash
4544
themes/binaryanomaly
4645
themes/bira
4746
themes/bobby
@@ -53,19 +52,28 @@ themes/clean
5352
themes/codeword
5453
themes/cooperkid
5554
themes/cupcake
55+
themes/demula
56+
themes/dos
5657
themes/doubletime
5758
themes/doubletime_multiline
5859
themes/doubletime_multiline_pyonly
5960
themes/dulcie
6061
themes/duru
6162
themes/easy
6263
themes/elixr
64+
themes/emperor
65+
themes/envy
6366
themes/essential
64-
themes/githelpers.theme.bash
67+
themes/font
68+
themes/gallifrey
6569
themes/gitline
70+
themes/hawaii50
6671
themes/inretio
72+
themes/iterate
73+
themes/kitsune
6774
themes/lambda
6875
themes/liquidprompt
76+
themes/luan
6977
themes/modern
7078
themes/norbu
7179
themes/oh-my-posh

themes/agnoster/agnoster.theme.bash

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ prompt_histdt() {
235235
}
236236

237237
git_status_dirty() {
238-
dirty=$(git status -s 2> /dev/null | tail -n 1)
238+
local dirty
239+
dirty=$(git status --porcelain 2> /dev/null | tail -n 1)
239240
[[ -n $dirty ]] && echo ""
240241
}
241242

themes/demula/demula.theme.bash

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env bash
1+
# shellcheck shell=bash
2+
# shellcheck disable=SC2034 # Expected behavior for themes.
23

34
# Theme inspired on:
45
# - Ronacher's dotfiles (mitsuhikos) - http://github.com/mitsuhiko/dotfiles/tree/master/bash/
@@ -10,40 +11,40 @@
1011
# Screenshot: http://goo.gl/VCmX5
1112
# by Jesus de Mula <[email protected]>
1213

13-
# For the real Monokai colors you should add these to your .XDefaults or
14-
# terminal configuration:
15-
#! ----------------------------------------------------------- TERMINAL COLORS
16-
#! monokai - http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/
17-
#*background: #272822
18-
#*foreground: #E2DA6E
19-
#*color0: black
20-
#! mild red
21-
#*color1: #CD0000
22-
#! light green
23-
#*color2: #A5E02D
24-
#! orange (yellow)
25-
#*color3: #FB951F
26-
#! "dark" blue
27-
#*color4: #076BCC
28-
#! hot pink
29-
#*color5: #F6266C
30-
#! cyan
31-
#*color6: #64D9ED
32-
#! gray
33-
#*color7: #E5E5E5
14+
## For the real Monokai colors you should add these to your .XDefaults or
15+
## terminal configuration:
16+
## ! ----------------------------------------------------------- TERMINAL COLORS
17+
## ! monokai - http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/
18+
## *background: #272822
19+
## *foreground: #E2DA6E
20+
## *color0: black
21+
## ! mild red
22+
## *color1: #CD0000
23+
## ! light green
24+
## *color2: #A5E02D
25+
## ! orange (yellow)
26+
## *color3: #FB951F
27+
## ! "dark" blue
28+
## *color4: #076BCC
29+
## ! hot pink
30+
## *color5: #F6266C
31+
## ! cyan
32+
## *color6: #64D9ED
33+
## ! gray
34+
## *color7: #E5E5E5
3435

3536
# ----------------------------------------------------------------- COLOR CONF
36-
D_DEFAULT_COLOR="${normal}"
37-
D_INTERMEDIATE_COLOR="${white}"
38-
D_USER_COLOR="${purple}"
39-
D_SUPERUSER_COLOR="${red}"
40-
D_MACHINE_COLOR="${cyan}"
41-
D_DIR_COLOR="${green}"
42-
D_SCM_COLOR="${yellow}"
43-
D_BRANCH_COLOR="${yellow}"
44-
D_CHANGES_COLOR="${white}"
45-
D_CMDFAIL_COLOR="${red}"
46-
D_VIMSHELL_COLOR="${cyan}"
37+
D_DEFAULT_COLOR="${normal?}"
38+
D_INTERMEDIATE_COLOR="${white?}"
39+
D_USER_COLOR="${purple?}"
40+
D_SUPERUSER_COLOR="${red?}"
41+
D_MACHINE_COLOR="${cyan?}"
42+
D_DIR_COLOR="${green?}"
43+
D_SCM_COLOR="${yellow?}"
44+
D_BRANCH_COLOR="${yellow?}"
45+
D_CHANGES_COLOR="${white?}"
46+
D_CMDFAIL_COLOR="${red?}"
47+
D_VIMSHELL_COLOR="${cyan?}"
4748

4849
# ------------------------------------------------------------------ FUNCTIONS
4950
case $TERM in
@@ -56,7 +57,7 @@ case $TERM in
5657
esac
5758

5859
is_vim_shell() {
59-
if [ ! -z "$VIMRUNTIME" ]; then
60+
if [ -n "$VIMRUNTIME" ]; then
6061
echo "${D_INTERMEDIATE_COLOR}on ${D_VIMSHELL_COLOR}\
6162
vim shell${D_DEFAULT_COLOR} "
6263
fi
@@ -72,7 +73,7 @@ $code ${D_DEFAULT_COLOR}"
7273

7374
# vcprompt for scm instead of bash_it default
7475
demula_vcprompt() {
75-
if [ ! -z "$VCPROMPT_EXECUTABLE" ]; then
76+
if [ -n "$VCPROMPT_EXECUTABLE" ]; then
7677
local D_VCPROMPT_FORMAT="on ${D_SCM_COLOR}%s${D_INTERMEDIATE_COLOR}:\
7778
${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${D_DEFAULT_COLOR}"
7879
$VCPROMPT_EXECUTABLE -f "$D_VCPROMPT_FORMAT"
@@ -88,7 +89,8 @@ safe_battery_charge() {
8889

8990
# -------------------------------------------------------------- PROMPT OUTPUT
9091
prompt() {
91-
local LAST_COMMAND_FAILED=$(mitsuhikos_lastcommandfailed)
92+
local LAST_COMMAND_FAILED
93+
LAST_COMMAND_FAILED=$(mitsuhikos_lastcommandfailed)
9294
local SAVE_CURSOR='\033[s'
9395
local RESTORE_CURSOR='\033[u'
9496
local MOVE_CURSOR_RIGHTMOST='\033[500C'

themes/dos/dos.theme.bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# shellcheck shell=bash
2+
# shellcheck disable=SC2034 # Expected behavior for themes.
13
PROMPT="\w>>"

themes/emperor/emperor.theme.bash

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1-
#!/usr/bin/env bash
1+
# shellcheck shell=bash
2+
# shellcheck disable=SC2034 # Expected behavior for themes.
23

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

8-
GIT_THEME_PROMPT_DIRTY=" ${red}"
9-
GIT_THEME_PROMPT_CLEAN=" ${bold_green}"
10-
GIT_THEME_PROMPT_PREFIX=" ${green}|"
11-
GIT_THEME_PROMPT_SUFFIX="${green}|"
9+
GIT_THEME_PROMPT_DIRTY=" ${red?}"
10+
GIT_THEME_PROMPT_CLEAN=" ${bold_green?}"
11+
GIT_THEME_PROMPT_PREFIX=" ${green?}|"
12+
GIT_THEME_PROMPT_SUFFIX="${green?}|"
1213

1314
RVM_THEME_PROMPT_PREFIX="|"
1415
RVM_THEME_PROMPT_SUFFIX="|"
1516

1617
function get_hour_color {
17-
hour_color=$red
18+
hour_color=${red?}
1819
min=$(date +%M)
1920
if [ "$min" -lt "15" ]; then
20-
hour_color=$white
21+
hour_color=${white?}
2122
elif [ "$min" -lt "30" ]; then
22-
hour_color=$green
23+
hour_color=${green?}
2324
elif [ "$min" -lt "45" ]; then
24-
hour_color=$yellow
25+
hour_color=${yellow?}
2526
else
26-
hour_color=$red
27+
hour_color=${red?}
2728
fi
2829
echo "$hour_color"
2930
}
@@ -34,7 +35,7 @@ __emperor_clock() {
3435
}
3536

3637
function prompt_command() {
37-
PS1="\n$(__emperor_clock)${purple}\h ${reset_color}in ${prompt_color}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}${reset_color} "
38+
PS1="\n$(__emperor_clock)${purple?}\h ${reset_color?}in ${prompt_color?}\w\n${bold_cyan?}$(scm_char)${green?}$(scm_prompt_info) ${green?}${reset_color?} "
3839
}
3940

4041
THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%H "}

themes/envy/envy.theme.bash

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
#!/usr/bin/env bash
2-
SCM_THEME_PROMPT_DIRTY=" ${red}"
3-
SCM_THEME_PROMPT_CLEAN=" ${bold_green}"
1+
# shellcheck shell=bash
2+
# shellcheck disable=SC2034 # Expected behavior for themes.
3+
4+
SCM_THEME_PROMPT_DIRTY=" ${red?}"
5+
SCM_THEME_PROMPT_CLEAN=" ${bold_green?}"
46
SCM_THEME_PROMPT_PREFIX=" |"
5-
SCM_THEME_PROMPT_SUFFIX="${green}|"
7+
SCM_THEME_PROMPT_SUFFIX="${green?}|"
68

7-
GIT_THEME_PROMPT_DIRTY=" ${red}"
8-
GIT_THEME_PROMPT_CLEAN=" ${bold_green}"
9-
GIT_THEME_PROMPT_PREFIX=" ${green}|"
10-
GIT_THEME_PROMPT_SUFFIX="${green}|"
9+
GIT_THEME_PROMPT_DIRTY=" ${red?}"
10+
GIT_THEME_PROMPT_CLEAN=" ${bold_green?}"
11+
GIT_THEME_PROMPT_PREFIX=" ${green?}|"
12+
GIT_THEME_PROMPT_SUFFIX="${green?}|"
1113

12-
VIRTUALENV_THEME_PROMPT_PREFIX="${green}"
14+
VIRTUALENV_THEME_PROMPT_PREFIX="${green?}"
1315
VIRTUALENV_THEME_PROMPT_SUFFIX=""
1416

1517
function prompt_command() {
16-
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} "
18+
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?} "
1719
}
1820

1921
safe_append_prompt_command prompt_command

themes/font/font.theme.bash

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env bash
1+
# shellcheck shell=bash
2+
# shellcheck disable=SC2034 # Expected behavior for themes.
23
#
34
# One line prompt showing the following configurable information
45
# for git:
@@ -22,20 +23,20 @@
2223
#
2324

2425
SCM_NONE_CHAR=''
25-
SCM_THEME_PROMPT_DIRTY=" ${red}"
26+
SCM_THEME_PROMPT_DIRTY=" ${red?}"
2627
SCM_THEME_PROMPT_CLEAN=""
27-
SCM_THEME_PROMPT_PREFIX="${green}|"
28-
SCM_THEME_PROMPT_SUFFIX="${green}|"
28+
SCM_THEME_PROMPT_PREFIX="${green?}|"
29+
SCM_THEME_PROMPT_SUFFIX="${green?}|"
2930
SCM_GIT_SHOW_MINIMAL_INFO=true
3031

3132
CLOCK_THEME_PROMPT_PREFIX=''
3233
CLOCK_THEME_PROMPT_SUFFIX=' '
3334
THEME_SHOW_CLOCK=false
34-
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$bold_blue"}
35+
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"${bold_blue?}"}
3536
THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%I:%M:%S"}
3637

3738
THEME_SHOW_USER_HOST=true
38-
USER_HOST_THEME_PROMPT_PREFIX="${bold_black}"
39+
USER_HOST_THEME_PROMPT_PREFIX="${bold_black?}"
3940
USER_HOST_THEME_PROMPT_SUFFIX=" "
4041

4142
VIRTUALENV_THEME_PROMPT_PREFIX='('
@@ -45,20 +46,20 @@ function prompt_command() {
4546
# This needs to be first to save last command return code
4647
local RC="$?"
4748

48-
hostname="${bold_black}\u@\h"
49-
virtualenv="${white}$(virtualenv_prompt)"
49+
hostname="${bold_black?}\u@\h"
50+
virtualenv="${white?}$(virtualenv_prompt)"
5051

5152
# Set return status color
5253
if [[ ${RC} == 0 ]]; then
53-
ret_status="${bold_green}"
54+
ret_status="${bold_green?}"
5455
else
55-
ret_status="${bold_red}"
56+
ret_status="${bold_red?}"
5657
fi
5758

5859
# Append new history lines to history file
5960
history -a
6061

61-
PS1="$(clock_prompt)${virtualenv}$(user_host_prompt)${bold_cyan}\W $(scm_prompt_char_info)${ret_status}${normal}"
62+
PS1="$(clock_prompt)${virtualenv}$(user_host_prompt)${bold_cyan?}\W $(scm_prompt_char_info)${ret_status}${normal?}"
6263
}
6364

6465
safe_append_prompt_command prompt_command

themes/gallifrey/gallifrey.theme.bash

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
# scm theming
2-
SCM_THEME_PROMPT_PREFIX="${yellow}("
3-
SCM_THEME_PROMPT_SUFFIX=")${normal}"
1+
# shellcheck shell=bash
2+
# shellcheck disable=SC2034 # Expected behavior for themes.
3+
4+
SCM_THEME_PROMPT_PREFIX="${yellow?}("
5+
SCM_THEME_PROMPT_SUFFIX=")${normal?}"
46

57
SCM_THEME_PROMPT_DIRTY="*"
68
SCM_THEME_PROMPT_CLEAN=""
7-
SCM_GIT_CHAR="${green}±${normal}"
8-
SCM_SVN_CHAR="${bold_cyan}${normal}"
9-
SCM_HG_CHAR="${bold_red}${normal}"
9+
SCM_GIT_CHAR="${green?}±${normal?}"
10+
SCM_SVN_CHAR="${bold_cyan?}${normal?}"
11+
SCM_HG_CHAR="${bold_red?}${normal?}"
1012

1113
### TODO: openSUSE has already colors enabled, check if those differs from stock
1214
# LS colors, made with http://geoff.greer.fm/lscolors/
@@ -16,10 +18,10 @@ SCM_HG_CHAR="${bold_red}☿${normal}"
1618
gallifrey_prompt() {
1719
SCM_PROMPT_FORMAT='%s%s'
1820

19-
ps_host="${green}\h${normal}"
20-
ps_user_mark="${bold}\$${normal}"
21-
ps_root_mark="${normal}§"
22-
ps_path="${normal}\w"
21+
ps_host="${green?}\h${normal?}"
22+
ps_user_mark="${bold?}\$${normal?}"
23+
ps_root_mark="${normal?}§"
24+
ps_path="${normal?}\w"
2325

2426
# make it work
2527
case $(id -u) in

0 commit comments

Comments
 (0)