getInfo 2.21.5

This commit is contained in:
kyodev 2017-10-31 12:12:03 +01:00
parent a5bbce1177
commit c8626d71d3
2 changed files with 18 additions and 15 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=2.21.4
version=2.21.5
date="31/10/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -257,7 +257,8 @@ f__user(){ # 09/10/2017
return 0
}
# $1='-l' comptage ligne dans variable $2; $1='-w' comptage mots dans variable $2, affiche quantité
# $1='-l' comptage ligne dans variable $2, affiche quantité
# $1='-w' comptage mots dans variable $2, affiche quantité
# f__wcv -l $var ; f__wcv -w $var "mot"
f__wcv(){ # 30/10/2017
[[ "$1" =~ -l|-w ]] || display="erreur f__wcv \$1 ($1) incorrect \n"
@ -546,9 +547,9 @@ fi_graph(){ # 30/10/2017
# slots pci video
slots="$(lspci | grep -Ei 'vga|display|3d' | cut -d" " -f1)"
# si mult-cartes
[ "$fg_nb_cpu" ] || figet_gpu
[ "$fg_nb_gpu" ] || figet_gpu
# lspci
if [ "$fg_nb_cpu" -gt 1 ]; then
if [ "$fg_nb_gpu" -gt 1 ]; then
if [ $(f__cmd_exist optirun) ]; then
for ig in $slots; do
cards+="$(optirun lspci -nnv -s $ig)"$'\n'
@ -577,7 +578,7 @@ fi_graph(){ # 30/10/2017
if [ $(f__cmd_exist glxinfo) ]; then
# devices
glx_dev="$(glxinfo | grep 'Device: ' | xargs)"
if [ "$fg_nb_cpu" -gt 1 ]; then
if [ "$fg_nb_gpu" -gt 1 ]; then
glx_temp="$(DRI_PRIME=1 glxinfo | grep 'Device: ' | xargs)"
[ $(f__cmd_exist optirun) ] && glx_temp="$(optirun glxinfo | grep 'Device: ' | xargs)"
[ "$glx_dev" != "$glx_temp" ] && glx_dev="$glx_dev"$'\n'"$glx_temp"
@ -1031,11 +1032,10 @@ fi_system_analyse(){ # 25/10/2017
unset text
}
fi_systeme(){ # 30/10/2017
local mbr description uname bootImage initDaemon xorg shells lastboot uptime charge pluriel text
fi_systeme(){ # 31/10/2017
local mbr uname bootImage initDaemon xorg shells lastboot uptime charge pluriel text
local alim_total alimentation
[ -d /sys/firmware/efi ] && mbr="EFI" || mbr="Legacy (mbr)"
[ -x "/usr/bin/lsb_release" ] && description="$(lsb_release -ds)" #dépend de apt install lsb-release, sur debian, en standard, juste : lsb-base
uname="$(uname -rmo)"
bootImage="$(gawk '/BOOT_IMAGE/ {print $1}' /proc/cmdline)"
bootImage="$(gawk '{print $1}{i=2; while (i <= NF-1) { print " ",$i; i++}}' /proc/cmdline)"
@ -1084,8 +1084,9 @@ fi_systeme(){ # 30/10/2017
text+="* boot **$mbr** \n"
text+="* distribution **$fg_distrib** \n\n"
text+='``` \n'
text+="processeur: $fg_cpu_arch \n"
text+="nombre de gpu: $fg_nb_gpu ($(f__wcv -l fg_nb_gpu)) \n"
text+="architecture: $architecture \n"
[ "$description" ] && text+="description: $description \n"
text+="uname: $uname \n"
text+="$bootImage \n"
text+="démon d'initialisation: $initDaemon \n"
@ -1235,8 +1236,8 @@ figet_batt(){ #v2 30/10/2017
fg_batt=${batt_detail::-1} # suppression dernier $'\n'
}
# assigne $fg_cpu (3 lignes description cpu), fg_nb_threads
figet_cpu(){ #v2 30/10/2017
# 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
cpuinfo="$(cat /proc/cpuinfo)"
# speed
@ -1278,6 +1279,7 @@ figet_cpu(){ #v2 30/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"
}
figet_de(){ # thanks neofetch, assigne $fg_de #30/10/2017
@ -1460,15 +1462,15 @@ figet_dmi(){ # 30/10/2017
# done
}
# assigne $fg_gpu, fg_nb_cpu
figet_gpu(){ # 30/10/2017
# assigne $fg_gpu, fg_nb_gpu
figet_gpu(){ # 31/10/2017
local lspci="$(lspci -mm)"
[ "$?" -gt 0 ] && return 0
# debug: lspci="$(< tests/lspci)"
fg_gpu="$(gawk -F' "|" "|" -' ' /"Display|"3D|"VGA/ {
sub(/ Corporation/,"",$3); sub(/Advanced Micro Devices, Inc. /,"",$3); sub(/ /," ",$3);
print $3": "$4}' <<< $lspci)"
fg_nb_cpu=$(echo "$fg_gpu" | wc -l)
fg_nb_gpu=$(echo "$fg_gpu" | wc -l)
}
# infos température et fan via acpi, assigne $fg_hw

View File

@ -21,8 +21,9 @@ https://wiki.gentoo.org/wiki/Comparison_of_init_systems
## 2.21.4 31/10/2017
## 2.21.5 31/10/2017
* nouveau: architecture processeur
* fix: alpine linux, FIN!
* renommage de tous les variables publiques des fonctions partageables