New version, tarball. This corrects an issue I noticed a while ago, glxinfo and xpdyinfo

used to not work as root in X, but they do now. So I've removed the root tests for graphics
output, and now only rely on the returned data to determine the output when in X. Out of X
behavior remains the same.

Note that at some point I'll have to see if wayland systems have usable reporting tools to get
screen resolution, opengl info, and so on, but that will have to come one step at a time.
This commit is contained in:
Harald Hope 2017-06-08 17:49:34 -07:00
parent 12ac640c09
commit 64c2c7169d
2 changed files with 42 additions and 14 deletions

38
inxi
View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### Version: 2.3.13 #### Version: 2.3.14
#### Date: 2017-06-08 #### Date: 2017-06-08
#### Patch Number: 00 #### Patch Number: 00
######################################################################## ########################################################################
@ -6393,9 +6393,10 @@ get_graphics_glx_data()
{ {
eval $LOGFS eval $LOGFS
local a_temp='' local a_temp=''
if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then # if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then
if [[ $B_SHOW_DISPLAY_DATA == 'true' ]];then
IFS=$'\n' IFS=$'\n'
A_GLX_DATA=( $( glxinfo | gawk -F ': ' ' A_GLX_DATA=( $( glxinfo 2>/dev/null | gawk -F ': ' '
# the real question here though is why this function is even here, seems # the real question here though is why this function is even here, seems
# just to be a complicated way to pack/print a variable, but maybe the # just to be a complicated way to pack/print a variable, but maybe the
# original idea was to handle > 1 cases of detections I guess # original idea was to handle > 1 cases of detections I guess
@ -6455,6 +6456,9 @@ get_graphics_glx_data()
/direct rendering/ { /direct rendering/ {
$2 && c[$2] $2 && c[$2]
} }
/GLX Visuals/ {
exit
}
END { END {
dr = join( c, ", " ) dr = join( c, ", " )
oglr = join( a, ", " ) oglr = join( a, ", " )
@ -6479,10 +6483,11 @@ get_graphics_res_data()
eval $LOGFS eval $LOGFS
local screen_resolution='' xdpy_data='' screens_count=0 tty_session='' local screen_resolution='' xdpy_data='' screens_count=0 tty_session=''
if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then # if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then
if [[ $B_SHOW_DISPLAY_DATA == 'true' ]];then
# Added the two ?'s , because the resolution is now reported without spaces around the 'x', as in # Added the two ?'s , because the resolution is now reported without spaces around the 'x', as in
# 1400x1050 instead of 1400 x 1050. Change as of X.org version 1.3.0 # 1400x1050 instead of 1400 x 1050. Change as of X.org version 1.3.0
xdpy_data="$( xdpyinfo )" xdpy_data="$( xdpyinfo 2>/dev/null )"
xdpy_count=$( grep -c 'dimensions' <<< "$xdpy_data" ) xdpy_count=$( grep -c 'dimensions' <<< "$xdpy_data" )
# we get a bit more info from xrandr than xdpyinfo, but xrandr fails to handle # we get a bit more info from xrandr than xdpyinfo, but xrandr fails to handle
# multiple screens from different video cards # multiple screens from different video cards
@ -6565,15 +6570,15 @@ get_graphics_display_server_data()
server='wayland' server='wayland'
fi fi
fi fi
# if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then
if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then if [[ $B_SHOW_DISPLAY_DATA == 'true' ]];then
# X vendor and version detection. # X vendor and version detection.
# new method added since radeon and X.org and the disappearance of <X server name> version : ...etc # 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 # Later on, the normal textual version string returned, e.g. like: X.Org version: 6.8.2
# A failover mechanism is in place. (if $version is empty, the release number is parsed instead) # A failover mechanism is in place. (if $version is empty, the release number is parsed instead)
# xdpy_info="$( xdpyinfo )" # xdpy_info="$( xdpyinfo )"
IFS="," IFS=","
a_display_vendor_working=( $( xdpyinfo | gawk -F': +' ' a_display_vendor_working=( $( xdpyinfo 2>/dev/null | gawk -F': +' '
BEGIN { BEGIN {
IGNORECASE=1 IGNORECASE=1
vendorString="" vendorString=""
@ -12786,7 +12791,7 @@ print_graphics_data()
local spacer='' driver='' driver_string='' driver_plural='' direct_render_string='' local spacer='' driver='' driver_string='' driver_plural='' direct_render_string=''
local separator_loaded='' separator_unloaded='' separator_failed='' local separator_loaded='' separator_unloaded='' separator_failed=''
local loaded='' unloaded='' failed='' display_server_string='' local loaded='' unloaded='' failed='' display_server_string=''
local line_starter='Graphics:' part_1_data='' part_2_data='' local line_starter='Graphics:' part_1_data='' part_2_data='' b_advanced='true'
local screen_resolution="$( get_graphics_res_data )" local screen_resolution="$( get_graphics_res_data )"
# set A_DISPLAY_SERVER_DATA # set A_DISPLAY_SERVER_DATA
@ -12884,16 +12889,20 @@ print_graphics_data()
display_server_string="${C1}Display Server${SEP3}${C2} $display_server_string $compositor_string" display_server_string="${C1}Display Server${SEP3}${C2} $display_server_string $compositor_string"
driver_string="${C1}driver$driver_plural$SEP3${C2}$driver " driver_string="${C1}driver$driver_plural$SEP3${C2}$driver "
if [[ $B_ROOT == 'true' ]];then if [[ $glx_renderer == '' && $B_ROOT == 'true' ]];then
root_x_string='for root ' root_x_string='for root '
if [[ $B_IRC == 'false' || $B_CONSOLE_IRC == 'true' ]];then b_advanced='false'
res_tty='tty size' # if [[ $B_IRC == 'false' || $B_CONSOLE_IRC == 'true' ]];then
fi # res_tty='tty size'
# fi
fi fi
if [[ $B_RUNNING_IN_DISPLAY != 'true' ]];then if [[ $B_RUNNING_IN_DISPLAY != 'true' ]];then
root_x_string="${root_x_string}out of X" root_x_string="${root_x_string}out of X"
res_tty='tty size' res_tty='tty size'
fi fi
if [[ $B_RUNNING_IN_DISPLAY != 'true' || -n ${screen_resolution/*@*/} ]];then
res_tty='tty size'
fi
if [[ -n $root_x_string ]];then if [[ -n $root_x_string ]];then
root_x_string="${C1}Advanced Data$SEP3${C2} N/A $root_x_string" root_x_string="${C1}Advanced Data$SEP3${C2} N/A $root_x_string"
@ -12992,7 +13001,8 @@ print_graphics_data()
## note: if glx render or display_version have no content, then mesa is true ## note: if glx render or display_version have no content, then mesa is true
# if [[ $B_SHOW_DISPLAY_DATA == 'true' ]] && [[ $b_is_mesa != 'true' ]];then # if [[ $B_SHOW_DISPLAY_DATA == 'true' ]] && [[ $b_is_mesa != 'true' ]];then
if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then # if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then
if [[ $B_SHOW_DISPLAY_DATA == 'true' && $b_advanced == 'true' ]];then
if [[ -z $glx_renderer ]];then if [[ -z $glx_renderer ]];then
glx_renderer='N/A' glx_renderer='N/A'
fi fi

View file

@ -1,3 +1,21 @@
=====================================================================================
Version: 2.3.14
Patch Version: 00
Script Date: 2017-06-08
-----------------------------------
Changes:
-----------------------------------
New version, tarball. This corrects an issue I noticed a while ago, glxinfo and xpdyinfo
used to not work as root in X, but they do now. So I've removed the root tests for graphics
output, and now only rely on the returned data to determine the output when in X. Out of X
behavior remains the same.
Note that at some point I'll have to see if wayland systems have usable reporting tools to get
screen resolution, opengl info, and so on, but that will have to come one step at a time.
-----------------------------------
-- Harald Hope - Thu, 08 Jun 2017 17:46:30 -0700
===================================================================================== =====================================================================================
Version: 2.3.13 Version: 2.3.13
Patch Version: 00 Patch Version: 00