getInfo 2.42.1

This commit is contained in:
kyodev 2017-11-22 06:40:09 +01:00
parent 45c22973ce
commit d391a9e1cd
2 changed files with 76 additions and 67 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=2.42.0
version=2.42.1
date="21/11/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -958,7 +958,7 @@ fi_graph(){ # 21/11/2017
local slots cards cmd_cards ig
local stck_glxinfo stck_glxinfoOpt stck_glxinfoDri glx_dvc cmd_glx_dvc glx_dvc_temp openGl cmd_openGl
local providers resolutions pluriel modules cmt_modules text
local alert_hybrid alert_3D
local alert_hybrid alert_3D alert_Wayland
# cardsManuel="$(lspci -nnk | grep -EiA 3 'vga|display|3d')" # -nn: textual and numeric ID's, k kernel
# cardsManuel="$(lspci -nnv | grep -iEA11 'vga|display|3d)" # v=verbose
# cardsManuel="lspci -nnv -s $( lspci | grep -Ei 'vga|display|3d' | cut -d" " -f1 )" si plusieurs devices possibles??
@ -990,77 +990,84 @@ fi_graph(){ # 21/11/2017
alert_hybrid="Une carte graphique semble désactivée actuellement, lspci n'est pas complet. \n"
alert_hybrid+="Voir DRI_PRIME, vga-switcheroo, Bumbledee...?"
fi
# openGl / glxinfo
if [ $( f__which glxinfo ) ]; then
stck_glxinfo=$( glxinfo )
# test 3D actif
if grep -iq 'direct rendering: No' <<< "$stck_glxinfo" ; then
alert_3D="l'accélération 3D n'est pas active"
fi
# devices
glx_dvc=$( grep -i 'direct rendering:' <<< "$stck_glxinfo" )$'\n'
glx_dvc+=$( grep 'Device: ' <<< "$stck_glxinfo" )
cmd_glx_dvc="glxinfo | grep -E 'rendering|Device: '"
if [ "$fg_nb_gpu" -gt 1 ]; then # plusieurs cartes, optirun et prime
if [ $( f__which optirun ) ]; then
stck_glxinfoOpt=$( optirun glxinfo )
glx_dvc_temp=$( grep 'Device: ' <<< $stck_glxinfoOpt )
cmd_glx_dvc="optirun $cmd_glx_dvc"
else
stck_glxinfoDri=$( DRI_PRIME=1 glxinfo )
glx_dvc_temp=$( grep 'Device: ' <<< $stck_glxinfoDri )
cmd_glx_dvc="DRI_PRIME=1 $cmd_glx_dvc"
fi
[ "$glx_dvc_temp" != "$glx_dvc" ] && glx_dvc+="\n$glx_dvc_temp" # ajout si diff
fi
# $1="[opt|dri]", assigne $openGl pour un ou plusieurs gpu (dri & optirun) & $cmd_openGl
fi_graph_openGl(){
local iogl dri_glxinfo=""
[[ "$1" == "opt" ]] && openGl+="---- \n"
toScrut=(
'OpenGL vendor'
'OpenGL renderer'
'OpenGL version'
'shading language'
'OpenGL extensions'
)
for iogl in "${toScrut[@]}" ; do
if [ "$1" == "dri" ]; then
dri_glxinfo+=$( grep "$iogl" <<< $stck_glxinfoDri )$'\n'
elif [ "$1" == "opt" ]; then
openGl+=$( grep "$iogl" <<< $stck_glxinfoOpt )$'\n'
else
openGl+=$( grep "$iogl" <<< "$stck_glxinfo" )$'\n'
fi
done
# $1="[opt|dri]", assigne $openGl pour un ou plusieurs gpu (dri & optirun) & $cmd_openGl
fi_graph_openGl(){
local iogl dri_glxinfo=""
[[ "$1" == "opt" ]] && openGl+="---- \n"
toScrut=(
'OpenGL vendor'
'OpenGL renderer'
'OpenGL version'
'shading language'
'OpenGL extensions'
)
for iogl in "${toScrut[@]}" ; do
if [ "$1" == "dri" ]; then
dri_glxinfo=${dri_glxinfo::-1}
[ $( f__which uniq ) ] && openGl=$(uniq <<< $dri_glxinfo) || openGl="$dri_glxinfo"
dri_glxinfo+=$( grep "$iogl" <<< $stck_glxinfoDri )$'\n'
elif [ "$1" == "opt" ]; then
openGl+=$( grep "$iogl" <<< $stck_glxinfoOpt )$'\n'
else
openGl+=$( grep "$iogl" <<< "$stck_glxinfo" )$'\n'
fi
openGl=${openGl::-1}
}
# openGL
fi_graph_openGl # openGl pour une carte ou gpu de base
if [ "$fg_nb_gpu" -gt 1 ]; then # plusieurs cartes, optirun et prime
if [ $( f__which optirun ) ]; then
fi_graph_openGl "opt" # ajout à $openGl existant, pas de redondance
cmd_openGl="optirun glxinfo"
else # DRI
fi_graph_openGl "dri" # redondance
cmd_openGl="DRI_PRIME=1 glxinfo"
fi
else
cmd_openGl="glxinfo | grep -E 'OpenGL vendor|OpenGL renderer|OpenGL version|shading language|OpenGL extensions'"
done
if [ "$1" == "dri" ]; then
dri_glxinfo=${dri_glxinfo::-1}
[ $( f__which uniq ) ] && openGl=$(uniq <<< $dri_glxinfo) || openGl="$dri_glxinfo"
fi
openGl=${openGl// string:/:} # suppression chaîne ' string'
openGl=${openGl% } # suppression espace final éventuel
fi
# xrandr: résolutionS & providers & preferred/current
openGl=${openGl::-1}
}
if [[ "$wayland" && "$EUID" -eq 0 ]]; then # évite erreur $DISPLAY en root wayland
openGl="n/a en root sous wayland"
resolutions="n/a en root sous wayland"
providers="n/a en root sous wayland"
current_preferred="n/a en root sous wayland"
alert_Wayland="Un certain nombre de caractéristiques ne peuvent être déterminées avec des utilitaires "
alert_Wayland+="'graphiques' sous root (celui-çi n'a pas lancé le serveur graphique). Lancer le script"
alert_Wayland+="'en utilisateur remédiera à cela."
else
# openGl / glxinfo
if [ $( f__which glxinfo ) ]; then
stck_glxinfo=$( glxinfo )
# test 3D actif
if grep -iq 'direct rendering: No' <<< "$stck_glxinfo" ; then
alert_3D="l'accélération 3D n'est pas active"
fi
# devices
glx_dvc=$( grep -i 'direct rendering:' <<< "$stck_glxinfo" )$'\n'
glx_dvc+=$( grep 'Device: ' <<< "$stck_glxinfo" )
cmd_glx_dvc="glxinfo | grep -E 'rendering|Device: '"
if [ "$fg_nb_gpu" -gt 1 ]; then # plusieurs cartes, optirun et prime
if [ $( f__which optirun ) ]; then
stck_glxinfoOpt=$( optirun glxinfo )
glx_dvc_temp=$( grep 'Device: ' <<< $stck_glxinfoOpt )
cmd_glx_dvc="optirun $cmd_glx_dvc"
else
stck_glxinfoDri=$( DRI_PRIME=1 glxinfo )
glx_dvc_temp=$( grep 'Device: ' <<< $stck_glxinfoDri )
cmd_glx_dvc="DRI_PRIME=1 $cmd_glx_dvc"
fi
[ "$glx_dvc_temp" != "$glx_dvc" ] && glx_dvc+="\n$glx_dvc_temp" # ajout si diff
fi
# openGL
fi_graph_openGl # openGl pour une carte ou gpu de base
if [ "$fg_nb_gpu" -gt 1 ]; then # plusieurs cartes, optirun et prime
if [ $( f__which optirun ) ]; then
fi_graph_openGl "opt" # ajout à $openGl existant, pas de redondance
cmd_openGl="optirun glxinfo"
else # DRI
fi_graph_openGl "dri" # redondance
cmd_openGl="DRI_PRIME=1 glxinfo"
fi
else
cmd_openGl="glxinfo | grep -E "
cmd_openGl+="'OpenGL vendor|OpenGL renderer|OpenGL version|shading language|OpenGL extensions'"
fi
openGl=${openGl// string:/:} # suppression chaîne ' string'
openGl=${openGl% } # suppression espace final éventuel
fi
# xrandr: résolutionS & providers & preferred/current
[ $( f__which xrandr ) ] && resolutions="$( xrandr --query | grep -A11 'Screen [0-9]' )"
[ $( f__which xrandr ) ] && providers="$( xrandr --listproviders )" # DRI: ok, sort 2 fournisseurs
[ $( f__which xrandr ) ] && current_preferred="$( xrandr --verbose | grep -EA2 'current|preferred' )"
@ -1080,6 +1087,8 @@ fi_graph(){ # 21/11/2017
# lspci -nnv
f_display "cards" "cmd" "$cmd_cards"
f_dspl_alert "alert_hybrid" "alert"
# wayland
f_dspl_alert "alert_Wayland" "info"
# openGl
f_display "glx_dvc" "cmd" "$cmd_glx_dvc" "devices OpenGl"
f_dspl_alert "alert_3D" "info"
@ -3418,7 +3427,7 @@ for j in $options; do
-t | --test )
prg_1 "$*"
echo -n "."
fi_systeme
fi_graph
exit ;; # test
-c* | all )
[ "$j" == "-c" ] && exec $0 "menu"

View File

@ -3,7 +3,7 @@
* f__wcv, f_display_grep, f_dspl_md, f__wget_test, fscript_get_version, fscript_update
* ! f__requis, fscript_install, f__scandir
## 2.42.0 21/11/2017
## 2.42.1 21/11/2017
* révision: wayland, wayland/root, évolution wayland si plus de xprop, xrandr, xdpyinfo...
* révision: fi_system, figet_de, fi_graph, figet_screen, fi_system_analyse prise en compte wayland