From 14746d68f1785a073ec2ca59caf7f0016a03ae26 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Fri, 14 Nov 2008 03:24:31 +0000 Subject: [PATCH] Trying a bit more alsa tests, but I think it can't be done to compare lspci and /proc/asound/cards, because strings aren't the same in all cases, and sometimes don't even have a single word in common. Oh well... --- inxi | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/inxi b/inxi index f96cd25..845d7e5 100755 --- a/inxi +++ b/inxi @@ -1933,13 +1933,11 @@ print_audio_data() card_one='Card ' fi - if [[ -n ${a_audio_working[2]} ]];then - port_data=" ${C1}at port${C2} ${a_audio_working[2]}" - fi - if [[ ${a_audio_working[1]} != 'alsa' ]];then - if [[ -n ${a_audio_working[1]} ]];then - alsa_driver=" ${C1}driver:${C2}${a_audio_working[1]}" - fi +# if [[ -n ${a_audio_working[2]} ]];then +# port_data=" ${C1}at port${C2} ${a_audio_working[2]}" +# fi + if [[ -n ${a_audio_working[1]} && ${a_audio_working[1]} != 'alsa' ]];then + alsa_driver=" ${C1}driver${C2} ${a_audio_working[1]}" fi audio_data="${C1}$card_one${C2}${a_audio_working[0]}$alsa_driver$port_data" audio_data=$( create_print_line "Audio:" "$audio_data" ) @@ -1950,16 +1948,16 @@ print_audio_data() IFS="," a_audio_working=( ${A_AUDIO_DATA[i]} ) IFS="$ORIGINAL_IFS" - port_data='' +# port_data='' alsa_driver='' - if [[ ${a_audio_working[1]} == 'port' ]];then - port_data=" ${C1}at port${C2} ${a_audio_working[2]}" - fi +# if [[ ${a_audio_working[2]} == 'port' ]];then +# port_data=" ${C1}at port${C2} ${a_audio_working[2]}" +# fi # we're testing for the presence of the 2nd array item here + if [[ -n ${a_audio_working[1]} && ${a_audio_working[1]} != 'alsa' ]];then + alsa_driver="${C1}driver${C2} ${a_audio_working[1]}" + fi if [[ ${a_audio_working[1]} != 'alsa' ]];then - if [[ -n ${a_audio_working[1]} ]];then - alsa_driver="${C2}driver:${a_audio_working[1]}" - fi audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$alsa_driver$port_data" else audio_data="${C1}Sound: ${C2}${a_audio_working[0]}"