Update atomic.theme.bash
- Changed the dependence of the battery plug-in. - Now checking if the function of the battery plugin exists, otherwise it will not load.pull/968/head
parent
6e1477a8aa
commit
8e98790c1d
|
|
@ -27,6 +27,8 @@ Face="\342\230\273"
|
||||||
## Parsers ##
|
## Parsers ##
|
||||||
#############
|
#############
|
||||||
|
|
||||||
|
isFunction() { [[ "$(declare -Ff "$1")" ]]; }
|
||||||
|
|
||||||
____atomic_top_left_parse() {
|
____atomic_top_left_parse() {
|
||||||
ifs_old="${IFS}"
|
ifs_old="${IFS}"
|
||||||
IFS="|"
|
IFS="|"
|
||||||
|
|
@ -164,8 +166,8 @@ ___atomic_prompt_clock() {
|
||||||
}
|
}
|
||||||
|
|
||||||
___atomic_prompt_battery() {
|
___atomic_prompt_battery() {
|
||||||
[ ! -e "$BASH_IT"/plugins/enabled/battery.plugin.bash ] ||
|
chk=$(isFunction battery_percentage && echo yes || echo no)
|
||||||
[ "${THEME_SHOW_BATTERY}" != "true" ] && return
|
[ "$chk" != "yes" ] || [ "${THEME_SHOW_BATTERY}" != "true" ] && return
|
||||||
batp=$(battery_percentage)
|
batp=$(battery_percentage)
|
||||||
if [ "$batp" -gt 50 ]; then
|
if [ "$batp" -gt 50 ]; then
|
||||||
color=$bold_green
|
color=$bold_green
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue