From 804ec79ce509a9b87b917d51b78859a33050425e Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Mon, 26 Jan 2009 22:35:34 +0000 Subject: [PATCH] last cleanups and syntax fixes --- inxi | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/inxi b/inxi index b93d3b6..8aea415 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.9.7-b1-t1 +#### version: 0.9.7-b1-t2 #### Date: 26 January 2009 ######################################################################## #### SPECIAL THANKS @@ -1789,6 +1789,7 @@ get_graphics_glx_data() if [[ $B_X_RUNNING == 'true' ]];then IFS=$'\n' A_GLX_DATA=( $( glxinfo | gawk -F ': ' ' + # note: function declarations go before BEGIN? It appears so, confirm. function join(arr, sep) { s="" i=flag=0 @@ -1801,7 +1802,9 @@ get_graphics_glx_data() return s } - BEGIN { IGNORECASE=1 } + BEGIN { + IGNORECASE=1 + } /opengl renderer/ { if ($2 ~ /mesa/) { # Allow r300 et al, but not the rest @@ -1839,7 +1842,9 @@ get_graphics_res_data() # 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 screen_resolution=$( xrandr | gawk ' - /\*/ { res[++m] = gensub(/^.* ([0-9]+) ?x ?([0-9]+)[_ ].* ([0-9\.]+)\*.*$/,"\\1x\\2@\\3hz","g",$0) } + /\*/ { + res[++m] = gensub(/^.* ([0-9]+) ?x ?([0-9]+)[_ ].* ([0-9\.]+)\*.*$/,"\\1x\\2@\\3hz","g",$0) + } END { for (n in res) { if (res[n] ~ /^[[:digit:]]+x[[:digit:]]+/) { @@ -1884,7 +1889,9 @@ get_graphics_x_data() if [[ $B_X_RUNNING == 'true' ]];then # X vendor and version detection. x_vendor=$( xdpyinfo | gawk -F': +' ' - BEGIN { IGNORECASE=1 } + BEGIN { + IGNORECASE=1 + } /vendor string/ { gsub(/the|inc|foundation|project|corporation/, "", $2) gsub(/,/, " ", $2) @@ -1899,7 +1906,9 @@ get_graphics_x_data() x_version=$( xdpyinfo | gawk '/version:/ { print $NF }' ) if [[ -z $x_version ]];then x_version=$(xdpyinfo | gawk -F': +' ' - BEGIN { IGNORECASE=1 } + BEGIN { + IGNORECASE=1 + } /vendor release number/ { gsub(/0+$/, "", $2) gsub(/0+/, ".", $2)