X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=data%2Fscripts%2Finxi;h=30f9eddaf89cd47e9592c5d2d4df252e2a463705;hp=045563bf57f1abb1bb43b6a59865d15274975d7b;hb=baf2ec741b854de2f14adf96c5875c7f4a330f1b;hpb=af569a42f6635f6abfcedeb45b730ee64d53e0b8 diff --git a/data/scripts/inxi b/data/scripts/inxi index 045563bf..30f9edda 100755 --- a/data/scripts/inxi +++ b/data/scripts/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.0.7-b1-t1 +#### version: 1.0.8 #### Date: 13 March 2009 ######################################################################## #### SPECIAL THANKS @@ -295,7 +295,7 @@ DISTROS_LSB_GOOD="mandrake-release mandriva-release mandrakelinux-release" # $'\1' gets weird results : # user@host $ ARR=($'\x01'"one two" three four); echo ${ARR[0]} | hd -v # 00000000 01 01 6f 6e 65 20 74 77 6f 0a |..one two.| -A_NORMAL_BANS=( corporation communications gmbh technologies technology group $'\2'"\" ltd. $'\2'"\" inc. $'\2'\ co. "(tm)" "(r)" $'\2'"\(rev ..\)" ) +A_NORMAL_BANS=( corporation communications gmbh technologies technology group $'\2'"\" ltd. $'\2'"\" inc. $'\2'\ co. "(tm)" "(r)" "®" $'\2'"\(rev ..\)" ) A_CPU_BANS=( @ cpu deca 'dual core' dual-core 'tri core' tri-core 'quad core' quad-core ennea genuine hepta hexa multi octa penta 'processor' processor single triple $'\2'"[0-9.]+ *[MmGg][Hh][Zz]" ) # after processing, the ban arrays will be put into these: BAN_LIST_NORMAL='' @@ -992,8 +992,8 @@ show_options() print_screen_output " 3 - Also show hard disk names as detected." print_screen_output " 4 - Also show partition size/filled data for (if present):/, /home, /var/, /boot" print_screen_output " 5 - For multicore systems, also show per core clock speeds; shows audio card." - print_screen_output "-x Show extra data: bogomips on cpu; driver version (if available) for network/audio." - print_screen_output " Only works with verbose or line output." + print_screen_output "-x Show extra data: bogomips on cpu; driver version (if available) for network/audio;" + print_screen_output " direct rendering status for Graphics. Only works with verbose or line output." print_screen_output "" print_screen_output "Additional Options:" print_screen_output "-h - this help menu." @@ -1890,9 +1890,18 @@ get_graphics_glx_data() { if [[ $B_X_RUNNING == 'true' ]];then IFS=$'\n' + # A_GLX_DATA=( $( glxinfo | gawk -F ': ' ' + # A_GLX_DATA=( $( cat ../../modules/data/glxinfo-atom-1r | gawk -F ': ' ' + # A_GLX_DATA=( $( cat ../../modules/data/glxinfo-intel-sput | gawk -F ': ' ' + # there are arch bugs that make glxinfo generate bad output errors + # A_GLX_DATA=( $( glxinfo | gawk -F ': ' ' + # A_GLX_DATA=( $( cat ../../modules/data/glxinfo-bad-rendering | gawk -F ': ' ' A_GLX_DATA=( $( glxinfo | gawk -F ': ' ' # note: function declarations go before BEGIN? It appears so, confirm. - function join(arr, sep) { + # 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 + function join( arr, sep ) { s="" i=flag=0 for ( i in arr ) { @@ -1909,24 +1918,28 @@ get_graphics_glx_data() } /opengl renderer/ { if ( $2 ~ /mesa/ ) { - # Allow r300 et al, but not the rest - if ( $2 ~ / r[3-9][0-9][0-9] / ) { + # Allow all mesas +# if ( $2 ~ / r[3-9][0-9][0-9] / ) { + gsub(/'"$BAN_LIST_NORMAL"'/, "", $2) a[$2] - f++ - } + # this counter failed in one case, a bug, and is not needed now +# f++ +# } next } $2 && a[$2] } - /opengl version/ && ( f || $2 !~ /mesa/ ) { + # dropping all conditions from this test to just show full mesa information + # there is a user case where not f and mesa apply, atom mobo + # /opengl version/ && ( f || $2 !~ /mesa/ ) { + /opengl version/ { $2 && b[$2] } /direct rendering/ { $2 && c[$2] } - END { - printf("%s\n%s\n%s\n", join(a,", "), join(b,", "), join(c,", ")) + printf( "%s\n%s\n%s\n", join( a, ", " ), join( b, ", " ), join( c, ", " ) ) }' ) ) IFS="$ORIGINAL_IFS" @@ -3060,7 +3073,11 @@ print_gfx_data() get_graphics_glx_data local glx_renderer="${A_GLX_DATA[0]}" local glx_version="${A_GLX_DATA[1]}" - local glx_direct_render="${A_GLX_DATA[2]}" + # this can contain a long No case debugging message, so it's being sliced off + # note: using grep -ioE '(No|Yes)' <<< ${A_GLX_DATA[2]} did not work in Arch, no idea why + local glx_direct_render=$( gawk '{ + print $1 + }' <<< "${A_GLX_DATA[2]}" ) if [[ ${#A_GFX_CARD_DATA[@]} -gt 1 ]];then i=1 @@ -3080,15 +3097,16 @@ print_gfx_data() fi print_screen_output "$gfx_data" - if [[ -z $glx_renderer || -z $glx_version ]];then - b_is_mesa='true' - fi +# if [[ -z $glx_renderer || -z $glx_version ]];then +# b_is_mesa='true' +# fi ## note: if glx render or version have no content, then mesa is true - if [[ $B_X_RUNNING == 'true' ]] && [[ $b_is_mesa != 'true' ]];then + # if [[ $B_X_RUNNING == 'true' ]] && [[ $b_is_mesa != 'true' ]];then + if [[ $B_X_RUNNING == 'true' ]];then gfx_data=$( create_print_line " " "${C1}GLX Renderer${C2} ${glx_renderer} ${C1}GLX Version${C2} ${glx_version}${CN}" ) - if [[ $B_HANDLE_CORRUPT_DATA == 'true' ]];then - gfx_data="${gfx_data} ${C1}Direct rendering${C2} ${glx_direct_render}${CN}" + if [[ $B_HANDLE_CORRUPT_DATA == 'true' || $B_EXTRA_DATA == 'true' ]];then + gfx_data="$gfx_data ${C1}Direct Rendering${C2} ${glx_direct_render}${CN}" fi print_screen_output "$gfx_data" fi