mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
tried a bit more optimization for -G, but it turns out it's glxinfo itself that is slow, so the only way to really get -G sped up is to redo
the way inxi gets the glxinfo data.
This commit is contained in:
parent
06cc997157
commit
8baf141a34
58
inxi
58
inxi
|
@ -3,7 +3,7 @@
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.7.5
|
#### version: 1.7.5
|
||||||
#### Date: June 20 2011
|
#### Date: June 20 2011
|
||||||
#### Patch Number: 00
|
#### Patch Number: 01
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -483,7 +483,7 @@ DISTROS_LSB_GOOD="mandrake-release mandriva-release mandrakelinux-release"
|
||||||
|
|
||||||
### Bans Data
|
### Bans Data
|
||||||
# Note that \<ltd\> bans only words, not parts of strings; in \<corp\> you can't use punctuation characters like . or ,
|
# Note that \<ltd\> bans only words, not parts of strings; in \<corp\> you can't use punctuation characters like . or ,
|
||||||
# we're saving about 10% of the exec time by hand building the ban lists here, using hard quotes.
|
# we're saving about 10+% of the total script exec time by hand building the ban lists here, using hard quotes.
|
||||||
BAN_LIST_NORMAL='computing|computer|corporation|communications|electronics|electrical|electric|gmbh|group|industrial|international|revision|software|technologies|technology|\<ltd\>|ltd\.|\<inc\>|inc\.|intl\.|\<co\>|co\.|corp\.|\(tm\)|\(r\)|®|\(rev ..\)'
|
BAN_LIST_NORMAL='computing|computer|corporation|communications|electronics|electrical|electric|gmbh|group|industrial|international|revision|software|technologies|technology|\<ltd\>|ltd\.|\<inc\>|inc\.|intl\.|\<co\>|co\.|corp\.|\(tm\)|\(r\)|®|\(rev ..\)'
|
||||||
BAN_LIST_CPU='@|cpu deca|dual core|dual-core|tri core|tri-core|quad core|quad-core|ennea|genuine|hepta|hexa|multi|octa|penta|processor|single|triple|[0-9\.]+ *[MmGg][Hh][Zz]'
|
BAN_LIST_CPU='@|cpu deca|dual core|dual-core|tri core|tri-core|quad core|quad-core|ennea|genuine|hepta|hexa|multi|octa|penta|processor|single|triple|[0-9\.]+ *[MmGg][Hh][Zz]'
|
||||||
|
|
||||||
|
@ -3697,45 +3697,50 @@ get_graphics_res_data()
|
||||||
get_graphics_x_data()
|
get_graphics_x_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local x_vendor='' x_version='' temp_array='' xdpy_info=''
|
local x_vendor='' x_version='' temp_array='' xdpy_info='' a_x_working=''
|
||||||
|
B_SHOW_X_DATA=true
|
||||||
if [[ $B_SHOW_X_DATA == 'true' && $B_ROOT != 'true' ]];then
|
if [[ $B_SHOW_X_DATA == 'true' && $B_ROOT != 'true' ]];then
|
||||||
# X vendor and version detection.
|
# X vendor and version detection.
|
||||||
xdpy_info="$( xdpyinfo )"
|
# new method added since radeon and X.org and the disappearance of <X server name> version : ...etc
|
||||||
x_vendor=$( gawk -F': +' '
|
# Later on, the normal textual version string returned, e.g. like: X.Org version: 6.8.2
|
||||||
|
# A failover mechanism is in place. (if $x_version is empty, the release number is parsed instead)
|
||||||
|
# xdpy_info="$( xdpyinfo )"
|
||||||
|
IFS=","
|
||||||
|
a_x_working=( $( xdpyinfo | gawk -F': +' '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
|
vendorString=""
|
||||||
|
version=""
|
||||||
|
vendorRelease=""
|
||||||
}
|
}
|
||||||
/vendor string/ {
|
/vendor string/ {
|
||||||
gsub(/the|inc|foundation|project|corporation/, "", $2)
|
gsub(/the|inc|foundation|project|corporation/, "", $2)
|
||||||
gsub(/,/, " ", $2)
|
gsub(/,/, " ", $2)
|
||||||
gsub(/^ +| +$/, "", $2)
|
gsub(/^ +| +$/, "", $2)
|
||||||
gsub(/ [ \t]+/, " ", $2)
|
gsub(/ [ \t]+/, " ", $2)
|
||||||
print $2
|
vendorString = $2
|
||||||
}' <<< "$xdpy_info" )
|
}
|
||||||
|
|
||||||
# new method added since radeon and X.org and the disappearance of <X server name> version : ...etc
|
|
||||||
# Later on, the normal textual version string returned, e.g. like: X.Org version: 6.8.2
|
|
||||||
# A failover mechanism is in place. (if $x_version is empty, the release number is parsed instead)
|
|
||||||
x_version=$( gawk '
|
|
||||||
/version:/ {
|
/version:/ {
|
||||||
print $NF
|
version = $NF
|
||||||
}' <<< "$xdpy_info" )
|
}
|
||||||
|
/vendor release number/ {
|
||||||
|
gsub(/0+$/, "", $2)
|
||||||
|
gsub(/0+/, ".", $2)
|
||||||
|
vendorRelease = $2
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
print vendorString "," version "," vendorRelease
|
||||||
|
}' ) )
|
||||||
|
x_vendor=${a_x_working[0]}
|
||||||
|
x_version=${a_x_working[1]}
|
||||||
|
|
||||||
# this gives better output than the failure last case, which would only show:
|
# this gives better output than the failure last case, which would only show:
|
||||||
# for example: X.org: 1.9 instead of: X.org: 1.9.0
|
# for example: X.org: 1.9 instead of: X.org: 1.9.0
|
||||||
if [[ -z $x_version ]];then
|
if [[ -z $x_version ]];then
|
||||||
x_version=$( get_graphics_x_version )
|
x_version=$( get_graphics_x_version )
|
||||||
fi
|
fi
|
||||||
if [[ -z $x_version ]];then
|
if [[ -z $x_version ]];then
|
||||||
x_version=$( gawk -F': +' '
|
x_version=${a_x_working[2]}
|
||||||
BEGIN {
|
|
||||||
IGNORECASE=1
|
|
||||||
}
|
|
||||||
/vendor release number/ {
|
|
||||||
gsub(/0+$/, "", $2)
|
|
||||||
gsub(/0+/, ".", $2)
|
|
||||||
print $2
|
|
||||||
}' <<< "$xdpy_info" )
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# some distros, like fedora, report themselves as the xorg vendor, so quick check
|
# some distros, like fedora, report themselves as the xorg vendor, so quick check
|
||||||
|
@ -3743,7 +3748,7 @@ get_graphics_x_data()
|
||||||
if [[ -z $( grep -E '(X|xorg|x\.org)' <<< $x_vendor ) ]];then
|
if [[ -z $( grep -E '(X|xorg|x\.org)' <<< $x_vendor ) ]];then
|
||||||
x_vendor="$x_vendor X.org"
|
x_vendor="$x_vendor X.org"
|
||||||
fi
|
fi
|
||||||
|
IFS="$ORIGINAL_IFS"
|
||||||
A_X_DATA[0]="$x_vendor"
|
A_X_DATA[0]="$x_vendor"
|
||||||
A_X_DATA[1]="$x_version"
|
A_X_DATA[1]="$x_version"
|
||||||
else
|
else
|
||||||
|
@ -3758,6 +3763,7 @@ get_graphics_x_data()
|
||||||
log_function_data "A_X_DATA: $temp_array"
|
log_function_data "A_X_DATA: $temp_array"
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
|
|
||||||
# if other tests fail, try this one, this works for root, out of X also
|
# if other tests fail, try this one, this works for root, out of X also
|
||||||
get_graphics_x_version()
|
get_graphics_x_version()
|
||||||
{
|
{
|
||||||
|
@ -7233,7 +7239,7 @@ print_sensors_data()
|
||||||
if [[ -n ${a_sensors_working[2]} ]];then
|
if [[ -n ${a_sensors_working[2]} ]];then
|
||||||
psu_temp="${C1}psu:${C2} ${a_sensors_working[2]} "
|
psu_temp="${C1}psu:${C2} ${a_sensors_working[2]} "
|
||||||
fi
|
fi
|
||||||
gpu_temp=$( get_gpu_temp_data )
|
gpu_temp=$( time get_gpu_temp_data )
|
||||||
# dump the unneeded screen data for single gpu systems
|
# dump the unneeded screen data for single gpu systems
|
||||||
if [[ $( wc -w <<< $gpu_temp ) -eq 1 && $B_EXTRA_DATA != 'true' ]];then
|
if [[ $( wc -w <<< $gpu_temp ) -eq 1 && $B_EXTRA_DATA != 'true' ]];then
|
||||||
gpu_temp=$( cut -d ':' -f 2 <<< $gpu_temp )
|
gpu_temp=$( cut -d ':' -f 2 <<< $gpu_temp )
|
||||||
|
|
Loading…
Reference in a new issue