11# shellcheck shell=bash
2- # shellcheck disable=SC2034 # Expected behavior for themes.
2+ # shellcheck disable=SC2034,SC2312 # Expected behavior for themes.
33
44# Theme inspired on:
55# - Ronacher's dotfiles (mitsuhikos) - http://github.com/mitsuhiko/dotfiles/tree/master/bash/
1212
1313# For the real Monokai colors you should add these to your .XDefaults or
1414# terminal configuration:
15- #! ----------------------------------------------------------- TERMINAL COLORS
16- #! monokai - http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/
15+ # ----------------------------------------------------------- TERMINAL COLORS
16+ # monokai - http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/
1717# *background: #272822
1818# *foreground: #E2DA6E
1919# *color0: black
20- #! mild red
20+ # mild red
2121# *color1: #CD0000
22- #! light green
22+ # light green
2323# *color2: #A5E02D
24- #! orange (yellow)
24+ # orange (yellow)
2525# *color3: #FB951F
26- #! "dark" blue
26+ # "dark" blue
2727# *color4: #076BCC
28- #! hot pink
28+ # hot pink
2929# *color5: #F6266C
30- #! cyan
30+ # cyan
3131# *color6: #64D9ED
32- #! gray
32+ # gray
3333# *color7: #E5E5E5
3434
3535# ----------------------------------------------------------------- DEF COLOR
@@ -118,10 +118,10 @@ prompt_git() {
118118 local branchName=' '
119119
120120 # Check if the current directory is in a Git repository.
121- if [ $(
121+ if [ " $(
122122 git rev-parse --is-inside-work-tree & > /dev/null
123123 echo " ${?} "
124- ) == ' 0' ]; then
124+ ) " == ' 0' ]; then
125125
126126 # check if the current directory is in .git before running git checks
127127 if [ " $( git rev-parse --is-inside-git-dir 2> /dev/null) " == ' false' ]; then
@@ -130,22 +130,22 @@ prompt_git() {
130130 git update-index --really-refresh -q & > /dev/null
131131
132132 # Check for uncommitted changes in the index.
133- if ! $( git diff --quiet --ignore-submodules --cached) ; then
133+ if ! git diff --quiet --ignore-submodules --cached; then
134134 s+=' +'
135135 fi
136136
137137 # Check for unstaged changes.
138- if ! $( git diff-files --quiet --ignore-submodules --) ; then
138+ if ! git diff-files --quiet --ignore-submodules --; then
139139 s+=' !'
140140 fi
141141
142142 # Check for untracked files.
143- if [ -n " $( git ls-files --others --exclude-standard) " ]; then
143+ if [[ -n " $( git ls-files --others --exclude-standard) " ] ]; then
144144 s+=' ?'
145145 fi
146146
147147 # Check for stashed files.
148- if $( git rev-parse --verify refs/stash & > /dev/null) ; then
148+ if git rev-parse --verify refs/stash & > /dev/null; then
149149 s+=' $'
150150 fi
151151
@@ -158,7 +158,7 @@ prompt_git() {
158158 || git rev-parse --short HEAD 2> /dev/null \
159159 || echo ' (unknown)' ) "
160160
161- [ -n " ${s} " ] && s=" [${s} ]"
161+ [[ -n " ${s} " ] ] && s=" [${s} ]"
162162
163163 echo -e " ${1}${branchName}${Cya}${s} "
164164 else
@@ -168,13 +168,14 @@ prompt_git() {
168168
169169# -------------------------------------------------------------- PROMPT OUTPUT
170170prompt () {
171- local LAST_COMMAND_FAILED=$( mitsuhikos_lastcommandfailed)
171+ local LAST_COMMAND_FAILED
172+ LAST_COMMAND_FAILED=$( mitsuhikos_lastcommandfailed)
172173 local SAVE_CURSOR=' \033[s'
173174 local RESTORE_CURSOR=' \033[u'
174175 local MOVE_CURSOR_RIGHTMOST=' \033[500C'
175176 local MOVE_CURSOR_5_LEFT=' \033[5D'
176177
177- if [[ " $OSTYPE " == ' linux' * ]]; then
178+ if [[ " ${ OSTYPE} " == ' linux' * ]]; then
178179 PS1=" ${TITLEBAR}
179180${SAVE_CURSOR}${MOVE_CURSOR_RIGHTMOST}${MOVE_CURSOR_5_LEFT} \
180181$( battery_charge) ${RESTORE_CURSOR} \
0 commit comments