From 3991b6efa1039c8ea40378cfd2f11a6a111aed53 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Fri, 14 Nov 2008 01:39:46 +0000 Subject: [PATCH] Trying to remove some extra alsa (....) data, and fix the card numbering --- inxi | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/inxi b/inxi index a776273..126e1f9 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.5.27-b-1-t-1 +#### version: 0.5.27-b-1-t-2 #### Date: November 13 2008 ######################################################################## #### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif @@ -1022,7 +1022,11 @@ get_audio_data() if [[ -e /proc/asound/version ]];then A_AUDIO_DATA[$alsa_index]=$( gawk '{ { IGNORECASE=1 } - gsub( "Driver ","",$0 ) + # some alsa strings have the build date in (...) + gsub( "Driver | [(].*[)]","",$0 ) + gsub(/,/, " ", $0) + gsub(/^ +| +$/, "", $0) + gsub(/ [ \t]+/, " ", $0) if ( $0 != "" ){ print $0 ",alsa" } @@ -1919,7 +1923,8 @@ print_audio_data() IFS="$ORIGINAL_IFS" if [[ -n ${A_AUDIO_DATA[@]} ]];then - if [[ ${#A_AUDIO_DATA[@]} -le 1 ]];then + # slightly complicated because 2nd array item could be the alsa data + if [[ ${#A_AUDIO_DATA[@]} -le 1 ]] || [[ ${#A_AUDIO_DATA[@]} -eq 2 && -n $( grep ',alsa' <<< ${A_AUDIO_DATA[@]} ) ]];then card_one='Card ' fi @@ -1943,7 +1948,7 @@ print_audio_data() if [[ ${a_audio_working[1]} != 'alsa' ]];then audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$port_data" else - audio_data="${C1}Sound Driver: ${C2}${a_audio_working[0]}" + audio_data="${C1}Sound System: ${C2}${a_audio_working[0]}" fi audio_data=$( create_print_line " " "$audio_data" ) print_screen_output "$audio_data"