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

battery plugin: Support Linux on Librem5 phone

This commit is contained in:
Gerald Turner 2022-06-18 22:17:25 +02:00 committed by Roman Perepelitsa
parent 0bef490cda
commit 0c197ed4a5

View file

@ -1349,7 +1349,7 @@ _p9k_prompt_battery_init() {
return
fi
if [[ $_p9k_os != (Linux|Android) ||
-z /sys/class/power_supply/(CMB*|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]"='${:-}'
fi
}
@ -1407,7 +1407,7 @@ _p9k_prompt_battery_set_args() {
Linux|Android)
# See https://sourceforge.net/projects/acpiclient.
local -a bats=( /sys/class/power_supply/(CMB*|BAT*|battery)/(FN) )
local -a bats=( /sys/class/power_supply/(CMB*|BAT*|*battery)/(FN) )
(( $#bats )) || return
local -i energy_now energy_full power_now