Sfoglia il codice sorgente

add battery-status, runs very very slow

pull/1/head
10sr 12 anni fa
parent
commit
6ee19f82f8
1 ha cambiato i file con 11 aggiunte e 0 eliminazioni
  1. +11
    -0
      bashrc

+ 11
- 0
bashrc Vedi File

@@ -376,3 +376,14 @@ winln(){
fi
}

battery-status(){
local dir=/sys/class/power_supply/BAT0
st=$(cat $dir/status)
full=$(cat $dir/charge_full)
now=$(cat $dir/charge_now)
# . $dir/uevent
# rate=$(expr $POWER_SUPPLY_CHARGE_NOW \* 100 / $POWER_SUPPLY_CHARGE_FULL)
rate=$(expr $now \* 100 / $full)
echo ${st}:${rate}\%
}


Caricamento…
Annulla
Salva