zsh: prompt: check for battery and improve detection of pcs with acpi
This commit is contained in:
parent
9ca1bba42b
commit
7f6ad5cbbb
1 changed files with 1 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ zshrc_prompt_precmd() {
|
||||||
|
|
||||||
# battery percentage, if acpi is available
|
# battery percentage, if acpi is available
|
||||||
local battery_pct=
|
local battery_pct=
|
||||||
if type acpi &> /dev/null ; then
|
if [[ -d /sys/class/power_supply/BAT*(#qN) ]] && type acpi &> /dev/null; then
|
||||||
battery_pct="$(acpi -b | cut -d, -f2 | sed -e 's/[^0-9]//g')"
|
battery_pct="$(acpi -b | cut -d, -f2 | sed -e 's/[^0-9]//g')"
|
||||||
|
|
||||||
# colorize battery percentage or display status
|
# colorize battery percentage or display status
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue