1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-22 04:10:07 +00:00

add CMB* to battery directory patterns; see #858

This commit is contained in:
Roman Perepelitsa 2020-07-02 10:39:35 +02:00
parent be66f21f53
commit e0ed693e6d

View file

@ -1270,7 +1270,7 @@ _p9k_prompt_battery_init() {
return return
fi fi
if [[ $_p9k_os != (Linux|Android) || if [[ $_p9k_os != (Linux|Android) ||
-z /sys/class/power_supply/(BAT*|battery)/(energy_full|charge_full|charge_counter)(#qN) ]]; then -z /sys/class/power_supply/(CMB*|BAT*|battery)/(energy_full|charge_full|charge_counter)(#qN) ]]; then
typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${:-}' typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${:-}'
fi fi
} }
@ -1328,7 +1328,7 @@ _p9k_prompt_battery_set_args() {
Linux|Android) Linux|Android)
# See https://sourceforge.net/projects/acpiclient. # See https://sourceforge.net/projects/acpiclient.
local -a bats=( /sys/class/power_supply/(BAT*|battery)/(FN) ) local -a bats=( /sys/class/power_supply/(CMB*|BAT*|battery)/(FN) )
(( $#bats )) || return (( $#bats )) || return
local -i energy_now energy_full power_now local -i energy_now energy_full power_now