From 70d659acdfc4c35b1db35e5a31fcef177d336e08 Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Sat, 24 Jun 2017 18:16:29 -0700 Subject: [PATCH] New version, tarball. Bug fix for GLX/OpenGL output. There was an unhandled case with core profile data being null, which in turn triggered a bash oddity, where if the IFS is \n for an array, and if the value of one element is '', then bash ignores that and does not simply set an empty array key as you'd expect. The correction was to change the IFS to ^, which worked fine for empty array values. However, since this bug will impact anyone with empty opengl core profile data, I recommend updating inxi. Also, added support for two smaller wm, Sawfish and Afterstep. This is a good source for lists of wm: http://www.xwinman.org/ http://www.xwinman.org/others.php However, that does not show how to ID it, so i have to do it on a case by case, but I'll add an issue for showing how to get your wm of choice if it's missing to inxi. --- inxi | 33 +++++++++++++++++++++------------ inxi.changelog | 26 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/inxi b/inxi index f790faa..a4711a2 100755 --- a/inxi +++ b/inxi @@ -1,8 +1,8 @@ #!/usr/bin/env bash ######################################################################## #### Script Name: inxi -#### Version: 2.3.21 -#### Date: 2017-06-13 +#### Version: 2.3.22 +#### Date: 2017-06-24 #### Patch Number: 00 ######################################################################## #### SPECIAL THANKS @@ -5282,6 +5282,7 @@ get_desktop_environment() fi # a few manual hacks for things that don't id with xprop, these are just good guesses # note that gawk is going to exit after first occurrence of search string, so no need for extra + # http://www.xwinman.org/ for more possible wm if [[ -z $desktop_environment ]];then if [[ -n $( grep -is 'fvwm-crystal' <<< "$Ps_aux_Data" ) ]];then version=$( get_program_version 'fvwm' '^fvwm' '2' ) @@ -5316,6 +5317,12 @@ get_desktop_environment() elif [[ -n $( grep -Eis '([[:space:]]|/)jwm' <<< "$Ps_aux_Data" ) ]];then version=$( get_program_version 'jwm' '^jwm' '2' ) desktop_environment='JWM' + elif [[ -n $( grep -is 'sawfish' <<< "$Ps_aux_Data" ) ]];then + version=$( get_program_version 'sawfish' '^sawfish' '3' ) + desktop_environment='Sawfish' + elif [[ -n $( grep -is 'afterstep' <<< "$Ps_aux_Data" ) ]];then + version=$( get_program_version 'afterstep' '^afterstep' '3' ) + desktop_environment='AfterStep' fi fi fi @@ -6417,12 +6424,10 @@ get_graphics_glx_data() local a_temp='' # if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then if [[ $B_SHOW_DISPLAY_DATA == 'true' ]];then - IFS=$'\n' + IFS='^' # NOTE: glxinfo -B is not always available, unforunately A_GLX_DATA=( $( eval glxinfo $DISPLAY_OPT 2>/dev/null | gawk -F ': ' ' - # 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 - # original idea was to handle > 1 cases of detections I guess + # handle > 1 cases of detections function join( arr, sep ) { s="" i=flag=0 @@ -6438,6 +6443,11 @@ get_graphics_glx_data() BEGIN { IGNORECASE=1 compatVersion="" + # create empty arrays + split("", a) + split("", b) + split("", c) + split("", d) } /opengl renderer/ { gsub(/'"$BAN_LIST_NORMAL"'/, "", $2) @@ -6467,7 +6477,6 @@ get_graphics_glx_data() # note: this is going to be off if ever multi opengl versions appear, never seen one compatVersion=gensub(/^([^ \t]+)[ \t].*/,"\\1","g",$2) } - /opengl core profile version/ { gsub(/'"$BAN_LIST_NORMAL"'/, "", $2) # fglrx started appearing with this extra string, does not appear to communicate anything of value @@ -6488,8 +6497,10 @@ get_graphics_glx_data() oglr = join( a, ", " ) oglv = join( b, ", " ) oglcpv = join( d, ", " ) - # output processing done in print functions - printf( "%s\n%s\n%s\n%s\n%s\n", oglr, oglv, dr, oglcpv, compatVersion ) + # output processing done in print functions, important! do not use \n IFS + # because Bash treats an empty value surrounded by \n\n as nothing, not an empty array key! + # this came up re oglcpv being empty and compatVersion being used instead + printf( "%s^%s^%s^%s^%s", oglr, oglv, dr, oglcpv, compatVersion ) }' ) ) IFS="$ORIGINAL_IFS" @@ -13048,7 +13059,7 @@ print_graphics_data() if [[ -z $glx_renderer ]];then glx_renderer='N/A' fi - if [[ -z $glx_version ]];then + if [[ -z $glx_version ]];then glx_version='N/A' else # non free drivers once filtered and cleaned show the same for core and compat @@ -13059,8 +13070,6 @@ print_graphics_data() glx_version="$glx_version (compat-v$SEP3 $glx_compat_version_nu)" fi fi - elif [[ -z $glx_core_version ]];then - glx_version='N/A' fi fi diff --git a/inxi.changelog b/inxi.changelog index 1a3f813..37db754 100644 --- a/inxi.changelog +++ b/inxi.changelog @@ -1,3 +1,29 @@ +===================================================================================== +Version: 2.3.22 +Patch Version: 00 +Script Date: 2017-06-24 +----------------------------------- +Changes: +----------------------------------- +New version, tarball. Bug fix for GLX/OpenGL output. There was an unhandled case with +core profile data being null, which in turn triggered a bash oddity, where if the IFS is +\n for an array, and if the value of one element is '', then bash ignores that and does +not simply set an empty array key as you'd expect. The correction was to change the IFS +to ^, which worked fine for empty array values. + +However, since this bug will impact anyone with empty opengl core profile data, I recommend +updating inxi. + +Also, added support for two smaller wm, Sawfish and Afterstep. + +This is a good source for lists of wm: http://www.xwinman.org/ http://www.xwinman.org/others.php + +However, that does not show how to ID it, so i have to do it on a case by case, but I'll +add an issue for showing how to get your wm of choice if it's missing to inxi. + +----------------------------------- +-- Harald Hope - Sat, 24 Jun 2017 18:00:21 -0700 + ===================================================================================== Version: 2.3.21 Patch Version: 00