Trying to add driver to output

This commit is contained in:
inxi-svn 2008-11-14 02:33:04 +00:00
parent 2a7b3976cd
commit 8284050b51

16
inxi
View file

@ -990,7 +990,7 @@ set_calculated_variables()
## create array of sound cards installed on system, and if found, use asound data as well ## create array of sound cards installed on system, and if found, use asound data as well
get_audio_data() get_audio_data()
{ {
local i='' alsa_index=0 local i='' alsa_index=0 alsa_driver=''
IFS=$'\n' IFS=$'\n'
A_AUDIO_DATA=( $( echo "$lspci_data" | gawk -F': ' ' A_AUDIO_DATA=( $( echo "$lspci_data" | gawk -F': ' '
@ -1020,7 +1020,14 @@ get_audio_data()
# now we'll add in the alsa data if the file exists # now we'll add in the alsa data if the file exists
alsa_index=${#A_AUDIO_DATA[@]} alsa_index=${#A_AUDIO_DATA[@]}
if [[ -e /proc/asound/version ]];then if [[ -e /proc/asound/version ]];then
A_AUDIO_DATA[$alsa_index]=$( gawk '{ if [[ -f /proc/asound/cards ]];then
alsa_driver=$( gawk -F 'with ' '{
gsub(" at.*", "", $2)
print $2
}' /proc/asound/cards )
fi
echo alsa_driver $alsa_driver
A_AUDIO_DATA[$alsa_index]=$( gawk -v alsaDriver="$alsa_driver" '{
{ IGNORECASE=1 } { IGNORECASE=1 }
# some alsa strings have the build date in (...) # some alsa strings have the build date in (...)
# also remove trailing . # also remove trailing .
@ -1028,8 +1035,11 @@ get_audio_data()
gsub(/,/, " ", $0) gsub(/,/, " ", $0)
gsub(/^ +| +$/, "", $0) gsub(/^ +| +$/, "", $0)
gsub(/ [ \t]+/, " ", $0) gsub(/ [ \t]+/, " ", $0)
if ( alsaDriver != "" ){
alsaDriver=","alsaDriver
}
if ( $0 != "" ){ if ( $0 != "" ){
print $0 ",alsa" print $0 ",alsa"alsaDriver
} }
}' /proc/asound/version ) }' /proc/asound/version )
fi fi