getInfo 2.6.3

This commit is contained in:
kyodev 2017-10-15 00:42:44 +02:00
parent dc84aa20d9
commit a653d576b4
2 changed files with 6 additions and 12 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=2.6.2
version=2.6.3
date="14/10/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -950,7 +950,7 @@ fi_usb(){ # 25/09/2017
figet_batt(){ # 14/10/2017
local batt_detail batt_nb batt_alim batt_unit batt_capa_design batt_capa_full batt_capa_now batt_conso
local batt_volt_min batt_volt_now batt_status batt_cycle batt_sn alert_batt_alarm
local batt_sante batt_restant tempo batRep ibat uevent pluriel
local batt_sante batt_restant tempo batRep ibat uevent
if [ ! -d /sys/class/power_supply ]; then # anciennes interfaces ou inconnu
[ -d /proc/acpi/battery ] && batt_detail="ancienne interface ACPI non gérée (obolète)"
[ -f /proc/apm ] && batt_detail="anciennes batteries APM non gérées (obolète)"
@ -1021,14 +1021,13 @@ figet_batt(){ # 14/10/2017
[ "$batt_sante" ] && batt_detail+="$batt_sante% (indicateur)"$' \n'
[ "$batt_restant" ] && batt_detail+="$batt_restant"$' \n'
# alertes batterie
[ "$batt_nb" -gt 1 ] && pluriel="s" || unset pluriel
[ "$alert_batt_alarm" ] && batt_detail+="**batterie en alarme** $alert_batt_alarm "
if [ "$batt_capa_design" == "$batt_capa_full" ] && [ "$batt_volt_min" == "$batt_volt_now" ]; then
batt_detail+="les pleines charges et les voltages sont incohérents, ou batterie$pluriels "
batt_detail+="mal gérée$pluriel ou batterie$pluriels HS "
batt_detail+="les pleines charges et les voltages sont incohérents, batterie "
batt_detail+="mal gérée ou batterie HS "
fi
if [ "$(awk '{printf "%d", $1}' <<< $batt_sante)" -lt 50 ] && [[ "$batt_status" == "Full" || "$batt_status" == "Unknown" ]]; then
batt_detail+="batterie$pluriel mal chargée$pluriel: mauvais état"$' \n'
batt_detail+="batterie mal chargée: mauvais état"$' \n'
else
batt_detail+=$' \n'
fi

View File

@ -9,14 +9,9 @@
* réseau réviser
* bug temp cpu (neofetch)
POWER_SUPPLY_STATUS=Unknown
<tosh> pleine charge effective: 4 000mAh, pleine charge théorique: 4 000mAh => 100.0% (indicateur)
<tosh>
<tosh> les pleines charges et les voltages sont incohérents, ou batterie mal gérée ou batterie HS
<tosh> pas de complètement chargé??
---
## 2.6.2 14/10/2017
## 2.6.3 14/10/2017
* révision: figet_batt: +batt_volt_now, réécriture avec gawk majoritaire, alertes batterie
* révision: f__scandir