From 522b114a7aa63c3aadad8490103d8fbbc435e71b Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Fri, 14 Nov 2008 00:35:54 +0000 Subject: [PATCH] Trying alsa output --- inxi | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/inxi b/inxi index bcc03c4..7bc4886 100755 --- a/inxi +++ b/inxi @@ -990,7 +990,7 @@ set_calculated_variables() ## create array of sound cards installed on system get_audio_data() { - local i='' + local i='' alsa_index=0 IFS=$'\n' A_AUDIO_DATA=( $( echo "$lspci_data" | gawk -F': ' ' @@ -1017,6 +1017,11 @@ get_audio_data() if [[ ${#A_AUDIO_DATA[@]} -eq 0 ]];then A_AUDIO_DATA[0]='Failed to Detect Sound Card!' fi + # now we'll add in the alsa data if the file exists + alsa_index=${#A_AUDIO_DATA[@]} + if [[ -e /proc/asound/version ]];then + A_AUDIO_DATA[$alsa_index]="$( cat /proc/asound/version ),alsa" + fi } ## create A_CPU_CORE_DATA, currently with two values: integer core count; core string text @@ -1925,10 +1930,14 @@ print_audio_data() a_audio_working=( ${A_AUDIO_DATA[i]} ) IFS="$ORIGINAL_IFS" port_data='' - if [[ -n ${a_audio_working[1]} ]];then - port_data=" ${C1}at port${C2} ${a_audio_working[1]}" + if [[ ${a_audio_working[1]} == 'port' ]];then + port_data=" ${C1}at port${C2} ${a_audio_working[2]}" + fi + 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]}" fi - audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$port_data" audio_data=$( create_print_line " " "$audio_data" ) print_screen_output "$audio_data" done