trying a few more fine tunings

This commit is contained in:
inxi-svn 2008-11-21 01:39:56 +00:00
parent a295ba44ba
commit cde3d78ac4

9
inxi
View file

@ -1005,7 +1005,7 @@ get_audio_data()
local i='' alsa_data='' alsa_driver='' device_count=''
IFS=$'\n'
# this first step handles the drivers for cases where the second step fails to find one
device_count=$( egrep -ic '(multimedia audio controller|audio device)' <<< "$lspci_data" )
if [[ $device_count -eq 1 && -f /proc/asound/cards ]];then
alsa_driver=$( gawk -F ']: ' '
@ -1021,9 +1021,8 @@ get_audio_data()
# this is to safeguard against line breaks from results > 1, which if inserted into following
# array will create a false array entry. This is a hack, not a permanent solution.
alsa_driver=$( echo $alsa_driver )
# this isn't perfect, but if one card was found in lscpci, we're passing
# this array constructor that card driver name. This should work for most people
# but if you can think of anything better, please post the code patch
# now we'll build the main audio data, card name, driver, and port. If no driver is found,
# and if the first method above is not null, and one card is found, it will use that instead.
A_AUDIO_DATA=( $( echo "$lspci_data" | gawk -F ': ' -v alsaDriver="$alsa_driver" '
BEGIN { IGNORECASE=1 }
#/^[0-9a-f:.]+ (ethernet|network) (controller|bridge)/ || /^[0-9a-f:.]+ [^:]+: .*(ethernet|network).*$/ {
@ -1040,8 +1039,6 @@ get_audio_data()
cards[audioCard]++
while (getline && !/^$/) {
if (/driver in use/) {
gsub(/^ +| +$/, "", audioCard)
drivers[audioCard] = drivers[audioCard] gensub(/(.*): (.*)/,"\\2","g",$0) ""
}
if (/I\/O/) {