From 799b95543b10fd14b62ac4b1f6f8e451ece3526c Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Mon, 25 Apr 2011 20:00:53 +0000 Subject: [PATCH] spring cleaning. Added as -x option for graphics card, busID output, that's useful. Moved the output error messaging to the print gfx function where it should be. I'll do that whereever the error messages were put in the get data functions, it' better to return null and let the print function decide what message to give users, that way we can always test for null values on anything we get from get data functions. I'll fix these as I spot them. --- inxi | 60 +++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/inxi b/inxi index 85daee9..a2f4c77 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.4.81 +#### version: 1.4.82 #### Date: April 25 2011 ######################################################################## #### SPECIAL THANKS @@ -2384,23 +2384,21 @@ get_graphics_card_data() A_GFX_CARD_DATA=( $( echo "$Lspci_Data" | gawk -F': ' ' BEGIN { IGNORECASE=1 + nic="" } /vga compatible controller/ { gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF) gsub(/,/, " ", $NF) gsub(/^ +| +$/, "", $NF) gsub(/ [ \t]+/, " ", $NF) - print $NF + nic=gensub(/^([0-9a-f:\.]+) (.+)$/,"\\1","",$1) + print $NF "," nic }' ) ) IFS="$ORIGINAL_IFS" # for (( i=0; i < ${#A_GFX_CARD_DATA[@]}; i++ )) # do # A_GFX_CARD_DATA[i]=$( sanitize_characters BAN_LIST_NORMAL "${A_GFX_CARD_DATA[i]}" ) # done - # handle cases where card detection fails, like in PS3, where lspci gives no output, or headless boxes.. - if [[ ${#A_GFX_CARD_DATA[@]} -eq 0 ]];then - A_GFX_CARD_DATA[0]='Failed to Detect Video Card!' - fi # GFXMEM is UNUSED at the moment, because it shows AGP aperture size, which is not necessarily equal to GFX memory.. # GFXMEM="size=[$(echo "$Lspci_Data" | gawk '/VGA/{while (!/^$/) {getline;if (/size=[0-9][0-9]*M/) {size2=gensub(/.*\[size=([0-9]+)M\].*/,"\\1","g",$0);if (size