File tree 5 files changed +8
-30
lines changed
5 files changed +8
-30
lines changed File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -565,21 +565,15 @@ function prompt_char() {
565
565
}
566
566
567
567
function battery_char() {
568
- # The battery_char function depends on the presence of the battery_percentage function.
569
- if [[ " ${THEME_BATTERY_PERCENTAGE_CHECK} " == true ]] && _command_exists battery_percentage; then
570
- echo -e " ${bold_red?} $( battery_percentage) %"
568
+ local battery_percentage
569
+ battery_percentage=" $( battery_percentage) "
570
+ if [[ " ${THEME_BATTERY_PERCENTAGE_CHECK} " == true ]]; then
571
+ echo -e " ${bold_red?}${battery_percentage} %"
571
572
else
572
573
false
573
574
fi
574
575
}
575
576
576
- if ! _command_exists battery_charge; then
577
- # if user has installed battery plugin, skip this...
578
- function battery_charge() {
579
- : # no op
580
- }
581
- fi
582
-
583
577
function aws_profile() {
584
578
if [[ -n " ${AWS_DEFAULT_PROFILE:- } " ]]; then
585
579
echo -e " ${AWS_DEFAULT_PROFILE} "
Original file line number Diff line number Diff line change @@ -82,14 +82,6 @@ ${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${D_DEFAULT_COLOR}"
82
82
fi
83
83
}
84
84
85
- # checks if the plugin is installed before calling battery_charge
86
- safe_battery_charge () {
87
- if _command_exists battery_charge ;
88
- then
89
- battery_charge
90
- fi
91
- }
92
-
93
85
# -------------------------------------------------------------- PROMPT OUTPUT
94
86
prompt () {
95
87
local LAST_COMMAND_FAILED=$( mitsuhikos_lastcommandfailed)
@@ -101,7 +93,7 @@ prompt() {
101
93
if [[ " $OSTYPE " = ' linux' * ]]
102
94
then
103
95
PS1=" ${TITLEBAR}${SAVE_CURSOR}${MOVE_CURSOR_RIGHTMOST}${MOVE_CURSOR_5_LEFT}
104
- $( safe_battery_charge ) ${RESTORE_CURSOR} \
96
+ $( battery_charge ) ${RESTORE_CURSOR} \
105
97
${D_USER_COLOR} \u ${D_INTERMEDIATE_COLOR} \
106
98
at ${D_MACHINE_COLOR} \h ${D_INTERMEDIATE_COLOR} \
107
99
in ${D_DIR_COLOR} \w ${D_INTERMEDIATE_COLOR} \
@@ -117,7 +109,7 @@ in ${D_DIR_COLOR}\w ${D_INTERMEDIATE_COLOR}\
117
109
${LAST_COMMAND_FAILED} \
118
110
$( demula_vcprompt) \
119
111
$( is_vim_shell) \
120
- $( safe_battery_charge )
112
+ $( battery_charge )
121
113
${D_INTERMEDIATE_COLOR} $ ${D_DEFAULT_COLOR} "
122
114
fi
123
115
Original file line number Diff line number Diff line change @@ -115,14 +115,6 @@ ${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${D_DEFAULT_COLOR}"
115
115
fi
116
116
}
117
117
118
- # checks if the plugin is installed before calling battery_charge
119
- safe_battery_charge () {
120
- if _command_exists battery_charge ;
121
- then
122
- battery_charge
123
- fi
124
- }
125
-
126
118
prompt_git () {
127
119
local s=' ' ;
128
120
local branchName=' ' ;
@@ -185,7 +177,7 @@ prompt() {
185
177
then
186
178
PS1=" ${TITLEBAR}
187
179
${SAVE_CURSOR}${MOVE_CURSOR_RIGHTMOST}${MOVE_CURSOR_5_LEFT} \
188
- $( safe_battery_charge ) ${RESTORE_CURSOR} \
180
+ $( battery_charge ) ${RESTORE_CURSOR} \
189
181
${D_USER_COLOR} \u ${D_INTERMEDIATE_COLOR} \
190
182
at ${D_MACHINE_COLOR} \h ${D_INTERMEDIATE_COLOR} \
191
183
in ${D_DIR_COLOR} \w ${D_INTERMEDIATE_COLOR} \
@@ -203,7 +195,7 @@ $(prompt_git "$D_INTERMEDIATE_COLOR on $D_GIT_COLOR")\
203
195
${LAST_COMMAND_FAILED} \
204
196
$( demula_vcprompt) \
205
197
$( is_vim_shell) \
206
- $( safe_battery_charge )
198
+ $( battery_charge )
207
199
${D_INTERMEDIATE_COLOR} $ ${D_DEFAULT_COLOR} "
208
200
fi
209
201
You can’t perform that action at this time.
0 commit comments