mirror of https://framagit.org/kyodev/kyopages.git
getInfo 2.21.8
This commit is contained in:
parent
cee9384e97
commit
67c7e249a5
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=2.21.7
|
||||
version=2.21.8
|
||||
date="31/10/2017"
|
||||
projet="simpledeb"
|
||||
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
|
||||
|
@ -394,7 +394,7 @@ fi_batt(){ # 25/10/2017
|
|||
unset text
|
||||
}
|
||||
|
||||
fi_cpu(){ # 25/10/2017
|
||||
fi_cpu(){ # 01/11/2017
|
||||
#manuellement: lscpu (util-linux)
|
||||
local cpu_flags text pluriel
|
||||
cpu_flags="$(sed -n 's/^flags.*: \(.*\)$/\1/p;' /proc/cpuinfo | sed -n '1p')"
|
||||
|
@ -403,6 +403,7 @@ fi_cpu(){ # 25/10/2017
|
|||
[ ${fg_cpu:0:1} -gt 1 ] && pluriel="s" || unset pluriel
|
||||
text="## processeur$pluriel \n\n"
|
||||
f_display "fg_cpu" "sans"
|
||||
f_display "fg_codename" "var" "codename processeur"
|
||||
f_display "cpu_flags" "var" "flags cpu:"
|
||||
printf "$text\n" >> "$fileOutput"
|
||||
unset text
|
||||
|
@ -1141,7 +1142,7 @@ fi_vrms(){ # 30/09/2017
|
|||
}
|
||||
|
||||
# informations batterie(s), assigne $fg_nb_batt $fg_batt
|
||||
figet_batt(){ #v2 31/10/2017
|
||||
figet_batt(){ #v2 01/11/2017
|
||||
local batt_detail batt_nb 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
|
||||
|
@ -1213,11 +1214,16 @@ figet_batt(){ #v2 31/10/2017
|
|||
if [[ "$batt_conso" != "0" && "$batt_conso" != "0.00" ]]; then # conso éventuelle
|
||||
if [ "$batt_unit" == "mAh" ]; then
|
||||
batt_restant+="(consommation en cours: $(printf "%'d" $batt_conso)$(sed 's/h//' <<< $batt_unit), "
|
||||
[ "$?" -ne 0 ] && debugBatt="todo"
|
||||
batt_restant+="charge actuelle: $(printf "%'d" $batt_capa_now)$batt_unit)"
|
||||
[ "$?" -ne 0 ] && debugBatt="todo"
|
||||
else
|
||||
batt_restant+="(consommation en cours: $(printf "%s" $batt_conso)$(sed 's/h//' <<< $batt_unit), "
|
||||
[ "$?" -ne 0 ] && debugBatt="todo"
|
||||
batt_restant+="charge actuelle: $(printf "%s" $batt_capa_now)$batt_unit)"
|
||||
[ "$?" -ne 0 ] && debugBatt="todo"
|
||||
fi
|
||||
[ "debugBatt" ] && debugBatt="batt_conso:$batt_conso - batt_capa_now:$batt_capa_now"
|
||||
fi
|
||||
[ "$batt_sante" ] && batt_detail+="$batt_sante% (indicateur)"$'\n' #ln 2fin
|
||||
[ "$batt_restant" ] && batt_detail+="$batt_restant"$'\n' #ln 3fin
|
||||
|
@ -1235,9 +1241,9 @@ figet_batt(){ #v2 31/10/2017
|
|||
[ "$batt_detail" ] && fg_batt=${batt_detail::-1} # suppression dernier $'\n'
|
||||
}
|
||||
|
||||
# assigne $fg_cpu (3 lignes description cpu), fg_nb_threads, $fg_cpu_arch
|
||||
figet_cpu(){ #v2 31/10/2017
|
||||
local cpuinfo speedNom speedMax speedMin speedCpu cpu1 cpu2 cpu3
|
||||
# assigne $fg_cpu (3 lignes description cpu), fg_nb_threads, $fg_cpu_arch, $fg_codename
|
||||
figet_cpu(){ #v2 01/11/2017
|
||||
local cpuinfo speedNom speedMax speedMin speedCpu cpu1 cpu2 cpu3 var_temp model
|
||||
cpuinfo="$(cat /proc/cpuinfo)"
|
||||
# speed
|
||||
speedNom=$(gawk -F ':' '/cpu MHz/ {printf "%.2f", $2/1000;exit}' <<< "$cpuinfo")
|
||||
|
@ -1279,6 +1285,36 @@ figet_cpu(){ #v2 31/10/2017
|
|||
fg_cpu=$(echo -e "$cpu1\n$cpu2\n$cpu3")
|
||||
fg_nb_threads=$(grep -c '^processor' <<< $cpuinfo)
|
||||
[ $(grep -cm1 'flags.* lm ' /proc/cpuinfo) -ge 1 ] && fg_cpu_arch="64bits" || fg_cpu_arch="32bits"
|
||||
# intel
|
||||
if [[ "$(grep -m1 '^vendor_id' /proc/cpuinfo)" =~ Intel ]]; then
|
||||
var_temp=$(grep -m1 '^model' /proc/cpuinfo)
|
||||
var_temp=${var_temp#*: } # extraction valeur
|
||||
model=$(printf "%x" $var_temp)
|
||||
model="0x"${model^^} # en majuscules
|
||||
#model arch codename
|
||||
[ "$model" == "0x3A" ] && fg_codename="Intel IvyBridge 22nm"
|
||||
[ "$model" == "0x2A" ] && fg_codename="Intel SandyBridge 32nm"
|
||||
[ "$model" == "0x2D" ] && fg_codename="Intel SandyBridge 32nm"
|
||||
[ "$model" == "0x25" ] && fg_codename="Intel Westmere 32nm"
|
||||
[ "$model" == "0x2C" ] && fg_codename="Intel Westmere 32nm"
|
||||
[ "$model" == "0x2F" ] && fg_codename="Intel Westmere 32nm"
|
||||
[ "$model" == "0x1E" ] && fg_codename="Intel Nehalem 45nm"
|
||||
[ "$model" == "0x1A" ] && fg_codename="Intel Nehalem 45nm"
|
||||
[ "$model" == "0x2E" ] && fg_codename="Intel Nehalem 45nm"
|
||||
[ "$model" == "0x17" ] && fg_codename="Intel Penryn 45nm"
|
||||
[ "$model" == "0x1D" ] && fg_codename="Intel Penryn 45nm"
|
||||
[ "$model" == "0x0F" ] && fg_codename="Intel Merom 65nm"
|
||||
[ "$model" == "0x16" ] && fg_codename="Intel Merom 65nm"
|
||||
[ "$model" == "0x06" ] && fg_codename="Intel Presler 65nm"
|
||||
[ "$model" == "0x03" ] && fg_codename="Intel Prescott 90nm"
|
||||
[ "$model" == "0x04" ] && fg_codename="Intel Prescott 90nm"
|
||||
[ "$model" == "0x0D" ] && fg_codename="Intel Dothan 90nm"
|
||||
[ "$model" == "0x36" ] && fg_codename="Intel Atom 32nm"
|
||||
[ "$model" == "0x26" ] && fg_codename="Intel Atom 45nm"
|
||||
[ "$model" == "0x1C" ] && fg_codename="Intel Atom 45nm"
|
||||
[ "$fg_codename" ] || fg_codename="codename inconnue, base à compléter"
|
||||
fg_codename+=" ($model/$var_temp)"
|
||||
fi
|
||||
}
|
||||
|
||||
figet_de(){ # thanks neofetch, assigne $fg_de #30/10/2017
|
||||
|
@ -1385,7 +1421,7 @@ figet_disk(){ #v2 31/10/2017
|
|||
}
|
||||
|
||||
# assigne $fg_distrib
|
||||
figet_distrib(){ # 29/10/2017
|
||||
figet_distrib(){ # 01/11/2017
|
||||
local prefix version
|
||||
# priorité /etc/os-release, version officielle systemd
|
||||
[ -e "/etc/os-release" ] && source "/etc/os-release" || source "/usr/lib/os-release"
|
||||
|
@ -1413,7 +1449,7 @@ figet_distrib(){ # 29/10/2017
|
|||
elif [ -z "$fg_distrib" ] && [ "$prefix" ]; then # si fg_distrib vide et si prefix
|
||||
fg_distrib="$prefix $(xargs <<< $version)"
|
||||
else
|
||||
fg_distrib="$fg_distrib$ $(xargs <<< $version)" # utilisation fg_distrib "normal"
|
||||
fg_distrib="$fg_distrib $(xargs <<< $version)" # utilisation fg_distrib "normal", sans préfixe (compris dans fg_distrib)
|
||||
fi
|
||||
[ "$fg_distrib" ] || fg_distrib="${OS^} (indéterminé)"
|
||||
}
|
||||
|
@ -2095,6 +2131,7 @@ prg_2(){ # traitements principaux
|
|||
}
|
||||
prg_3(){ # fin de traitements
|
||||
echo -e "--- \n" >> "$fileOutput"
|
||||
[ "$debugBatt" ] && echo -e "$debugBatt \n" >> "$fileOutput"
|
||||
echo -e "$ligneRapport \n" >> "$fileOutput"
|
||||
f__dialog_oui_non "non" "\n exporter sur le pastebin par défaut?" && fipaste
|
||||
f__info "le rapport est disponible en local, fichier:$YELLOW $fileOutput" \
|
||||
|
@ -2218,7 +2255,7 @@ for j in $options; do
|
|||
case $j in
|
||||
-t | --test )
|
||||
prg_1 "$*"
|
||||
fi_systeme
|
||||
fi_batt
|
||||
prg_3
|
||||
exit ;; # test seulement
|
||||
-c* | all )
|
||||
|
|
|
@ -3,6 +3,11 @@
|
|||
* f__wcv
|
||||
|
||||
|
||||
## 2.21.8 01/11/2017
|
||||
|
||||
nouveau: codename proc intel, gadget
|
||||
fix: figet_distrib, affichage distrib
|
||||
|
||||
## 2.21.7 31/10/2017
|
||||
|
||||
* nouveau: architecture processeur
|
||||
|
@ -19,7 +24,6 @@
|
|||
* fix: affichage/contournement alpine linux
|
||||
* fix: fi_vrms
|
||||
|
||||
|
||||
## 2.20.3 29/10/2017
|
||||
|
||||
* nouveau: figet_distrib
|
||||
|
@ -28,7 +32,6 @@
|
|||
* fix: ? bug aléatoire wwn
|
||||
* fix: figet_gpu, fix rapide en attendant réécriture
|
||||
|
||||
|
||||
## 2.19.6 28/10/2017
|
||||
|
||||
* nouveaux: avertissement erreur display :0 en root fedora beta ou buster
|
||||
|
@ -38,7 +41,6 @@
|
|||
* fix: figet_dmi, markdown
|
||||
* figet_batt: s/n sur dell i5
|
||||
|
||||
|
||||
## 2.19.1 27/10/2017
|
||||
|
||||
* nouveau: option update spécial, script en place
|
||||
|
@ -52,7 +54,6 @@
|
|||
* fix: fi_reseau, détection slot pci, bug sur un pc sour arch
|
||||
* fix: figet_batt formatage 0 en décimale si unité batterie en W
|
||||
|
||||
|
||||
## 2.18.6 26/10/2017
|
||||
|
||||
* nouveau: figet_screen (nb écrans & résolutions)
|
||||
|
@ -64,7 +65,6 @@
|
|||
* fix: suppression s/n batterie si champs rempli d'espace vide
|
||||
* fix: figet_screen, fix nombre d'écrans
|
||||
|
||||
|
||||
## 2.17.4 25/10/2017
|
||||
|
||||
* nouveau: nombre d'écrans
|
||||
|
@ -75,7 +75,6 @@
|
|||
* fix: f_display, affichage sur --debug-*
|
||||
* fix: correction newlines
|
||||
|
||||
|
||||
## 2.15.0 24/10/2017
|
||||
|
||||
* nouveau: début support Bumblebee
|
||||
|
@ -85,7 +84,6 @@
|
|||
* fix: affichage d'explications état paquet dans fi_sources
|
||||
* fix: affichage modules non reconnus fi_reseau
|
||||
|
||||
|
||||
## 2.14.2 23/10/2017
|
||||
|
||||
* nouveau: nb alims total/branchée
|
||||
|
@ -93,7 +91,6 @@
|
|||
* fix: fi_systeme, fi_graph: bug affichage gpu si 2 cartes graphiques
|
||||
* fix: figet_batt, return meilleur si pas de batterie
|
||||
|
||||
|
||||
## 2.14.0 22/10/2017
|
||||
|
||||
* nouveau: détection connexion ssh
|
||||
|
@ -109,7 +106,6 @@
|
|||
* fix: fi_hw, by-pass si pas d'info acpi
|
||||
* fix: fi_reseau, fi_graph, avertissement modules vide
|
||||
|
||||
|
||||
## 2.13.1 22/10/2017
|
||||
|
||||
* f__cmd_exist: nouveau émule et remplace which debian
|
||||
|
@ -117,7 +113,6 @@
|
|||
* révision affichage avec f_display, fin pour tous les fi_
|
||||
* pluriel sur titrages markdown
|
||||
|
||||
|
||||
## 2.12.1 21/10/2017
|
||||
|
||||
* nouveau: ré-écriture figet_cpu (sans température)
|
||||
|
@ -125,13 +120,11 @@
|
|||
* révision: fi_cpu
|
||||
* révision affichage avec f_display
|
||||
|
||||
|
||||
## 2.11.1 20/10/2017
|
||||
|
||||
* révision: figet_hw v2, name, label et filtrage 0°C
|
||||
* révision: figet_hw_test, figet_test_batt, figet_test_dmi
|
||||
|
||||
|
||||
## 2.10.3 19/10/2017
|
||||
|
||||
* nouveau: fi_journal, journaux kernel et non-kernel via journalctl, dmesg en fallback, x premières lignes
|
||||
|
@ -146,13 +139,11 @@
|
|||
* fix: fi_dmesg, niveau emergency & alerte oublié
|
||||
* fix: partitions en liste
|
||||
|
||||
|
||||
## 2.9.1 18/10/2017
|
||||
|
||||
* révision: réécriture figet_disk, renommage variables publiques
|
||||
* fix: dmesg, variable locale
|
||||
|
||||
|
||||
## 2.8.8 17/10/2017
|
||||
|
||||
* nouveau: figet_hw_test, acpi -V si disponible, tests (temporaires) sur
|
||||
|
@ -167,7 +158,6 @@
|
|||
* révision: figet_cpu, suppression affichage température core en attendant mieux
|
||||
* fix: sr0 compté en disque hotplug (et non fixe)
|
||||
|
||||
|
||||
## 2.7.0 16/10/2017
|
||||
|
||||
* f__error f__info f__requis f__wget_test: mineur
|
||||
|
@ -176,12 +166,10 @@
|
|||
* fix: figet_batt, n° de série
|
||||
* fix: figet_ip, erreur possible entre lo/certain ifn
|
||||
|
||||
|
||||
## 2.6.4 15/10/2017
|
||||
|
||||
* révison & fix: f__scandir
|
||||
|
||||
|
||||
## 2.6.3 14/10/2017
|
||||
|
||||
* révision: figet_batt: +batt_volt_now, réécriture avec gawk majoritaire, alertes batterie
|
||||
|
|
Loading…
Reference in New Issue