getInfo 2.17.4

This commit is contained in:
kyodev 2017-10-26 01:55:35 +02:00
parent f0fb1c6e80
commit dd1f035f95
2 changed files with 31 additions and 17 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=2.17.3
version=2.17.4
date="25/10/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -374,10 +374,10 @@ echo -e "$STD\n plus d'infos: $GREEN$urlNotice\n$STD"
fi_batt(){ # 25/10/2017
local pluriel
[ "$fget_batt_nb" ] || figet_batt # appel figet_battery si pas déjà fait par fi_systeme
[[ "$fget_batt_nb" == "-1" || "$fget_batt_nb" -gt 0 ]] || return 0 # pas de batterie
[ "$fget_nb_batt" ] || figet_batt # appel figet_battery si pas déjà fait par fi_systeme
[[ "$fget_nb_batt" == "-1" || "$fget_nb_batt" -gt 0 ]] || return 0 # pas de batterie
###
[ "$fget_batt_nb" -gt 1 ] && pluriel="s" || unset pluriel
[ "$fget_nb_batt" -gt 1 ] && pluriel="s" || unset pluriel
text="## batterie$pluriel \n\n"
f_display "fget_batt" "sans"
printf "$text\n" >> "$fileOutput"
@ -557,7 +557,7 @@ fi_graph(){ # 25/10/2017
alert_Multicarte+="malgré un lancement avec \`optirun\` ou \`DRI_PRIME=1 lspci\`"
fi
# openGl
[ $(f__cmd_exist glxinfo) ] && openGl=$( glxinfo | grep 'OpenGL version' | sed 's/string//' )
[ $(f__cmd_exist glxinfo) ] && openGl=$( glxinfo | grep 'OpenGL version' | sed 's/ string//' )
# résolutions
[ $(f__cmd_exist xrandr) ] && resolutions=$( xrandr --query | grep '^ *[0-9]' | head -n 10 )
# modules
@ -569,15 +569,16 @@ fi_graph(){ # 25/10/2017
text="## graphisme \n\n"
# cartes graphiques
text+="$(sed -E 's/(.*)/> \* \*\*\1\*\*/' <<< $fget_gpu) \n"
# résolution(s) active(s)
text+="\n\n**résolution: $fget_resolution** \n\n"
# nb écran & résolution(s) active(s)
text+="\n\nnombre d'écrans: **$fget_nb_screen** \n"
text+="résolution: **$fget_resolution** \n\n"
# lspci
f_display "graphCards" "cmd" "lspci -nnv | grep -iEA 13 'vga|display|3d"
# f_display "graphCards" "cmd" "lspci -nnv -s \$( lspci | grep -Ei 'vga|display|3d' | cut -d\" \" -f1 )"
[ "$alert_Multicarte" ] && text+="$alert_Multicarte \n\n"
# openGl
[ "$openGl" ] && f_display "openGl" "cmd" "glxinfo | grep 'OpenGL version"
# résolutions possibles, pas d'affichage si vode (ssh) ou xrandr pas accessible
# résolutions possibles, pas d'affichage si mode (ssh) ou xrandr pas accessible
if [ "$resolutions" ]; then
f_display "resolutions" "cmd" "xrandr --query | grep '^ *[0-9]' | head -n 10" "(10 premières résolutions possibles)"
fi
@ -1051,6 +1052,7 @@ fi_systeme(){ # 25/10/2017
text+="$bootImage \n"
text+="démon d'initialisation: $initDaemon \n"
text+="serveur d'affichage: $xorg \n"
text+="nombre d'écrans: $fget_nb_screen \n"
text+="résolution: $fget_resolution \n"
text+="desktop (DE): $fget_de \n"
text+="window manager: $fget_wm \n"
@ -1059,8 +1061,8 @@ fi_systeme(){ # 25/10/2017
text+="$fget_disk_part_fix_tot \n"
[ "$alimentation" ] && text+="$alimentation \n"
if [ "$fget_batt" ]; then
[ "$fget_batt_nb" -gt "1" ] && pluriel="s" || unset pluriel
text+="$fget_batt_nb batterie$pluriel présente$pluriel: \n"
[ "$fget_nb_batt" -gt "1" ] && pluriel="s" || unset pluriel
text+="$fget_nb_batt batterie$pluriel présente$pluriel: \n"
text+="$(sed -En 's/^BAT(.*)$/ BAT\1/p' <<< $fget_batt) \n"
fi
text+="dernier boot: $lastboot, uptime: $uptime \n"
@ -1082,7 +1084,7 @@ fi_usb(){ # 25/10/2017
unset text
}
# informations batterie(s), assigne $fget_batt_nb $fget_batt
# informations batterie(s), assigne $fget_nb_batt $fget_batt
figet_batt(){ #v2 25/10/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
@ -1173,7 +1175,7 @@ figet_batt(){ #v2 25/10/2017
batt_detail+="batterie très mal chargée (moins de 50%): mauvais état?"$'\n' #[ln 5]
fi
done
fget_batt_nb="$batt_nb"
fget_nb_batt="$batt_nb"
fget_batt=${batt_detail::-1} # suppression dernier $'\n'
}
@ -1655,7 +1657,8 @@ figet_mod_net(){ # thanks wireless-info, assigne $fget_mod_net # 01/10/2017
fget_mod_net="$(lsmod | grep -E "(^|[[:punct:] ])($MODMATCHES|$LSMODMATCHES)[^[:punct:] ]*([[:punct:] ]|$)")"
}
figet_resolution(){ # thanks neofetch, assigne $fget_resolution # 22/10/2017
# assigne $fget_resolution, $fget_nb_screen
figet_resolution(){ # 25/10/2017 thanks neofetch
if [ "$ENV_SSH" ]; then
fget_resolution="n/a (ssh)"
return 0
@ -1671,7 +1674,16 @@ figet_resolution(){ # thanks neofetch, assigne $fget_resolution # 22/10/2017
resolution="${resolution%,*}"
fget_resolution="$resolution"
### nombre d'écrans
# xrandr --nograb --current
local xrandr
if [ $( f__cmd_exist xrandr ) ]; then
xrandr=$( xrandr --query )
# fget_nb_screen=$( gawk -F ':' ' /Screen [0-9]+:/ { print $1}
# ' <<< "$xrandr" )
fget_nb_screen=$(( $( grep -c 'Screen [0-9]+:' <<< "$xrandr" ) + 1 ))
else
fget_nb_screen="-99"
fi
# echo "$fget_nb_screen"
}
figet_shell(){ # thanks neofetch, assigne $fget_shell # 04/10/2017
@ -2128,7 +2140,7 @@ for j in $options; do
case $j in
-t | --test )
prg_1 "$*"
fi_batt
fi_graph
prg_3
exit ;; # test seulement
-c* | all )

View File

@ -10,20 +10,22 @@
* revoir modules réseau
* réviser alert_
* revoir affichage cmd si présente sinon, juste signalement plus discret
*
* nombre d'écrans
---
* f__requis f__wget_test fscript_get_version fscript_update fscript_cronAnacron
* f__cmd_exist f__sudo f__requis
## 2.17.3 25/10/2017
## 2.17.4 25/10/2017
* nouveau: nombre d'écrans
* révision: batterie, unité en W au lieu de mW, mA inchangé
* fix: fi_locale compatible fedora (arch ok)
* fix, révision: modification complète des séquences peuplement rapport et modules fi_* autonomes
* fix: bug affichage disque sata
* fix: f_display, affichage sur --debug-*
* fix: correction newlines
## 2.15.0 24/10/2017