This commit is contained in:
inxi-svn 2009-02-18 05:17:38 +00:00
parent cd5cb1e814
commit b43667f58f

18
inxi
View file

@ -1265,7 +1265,6 @@ get_cmdline()
get_audio_data()
{
local i='' alsa_data='' alsa_driver='' device_count='' usb_proc_file=''
local usb_data='' usb_data_id=''
IFS=$'\n'
# this first step handles the drivers for cases where the second step fails to find one
@ -1387,19 +1386,12 @@ get_audio_data()
# also, find the contents of usbid in lsusb and print everything after the 7th word on the corresponding line
# finally, strip out commas as they will change the driver :)
# lsusb is not contained in some users paths, hardcode it!
usb_data_id=$( cat $usb_proc_file/usbid )
usb_data=$( lsusb -v 2>/dev/null | grep <<< $usb_data_id )
usb_data=$( sed 's/,/ /' <<< $usb_data ) # replace with gawk but use for now
usb_data=$( gawk '{
for( i=7; i < NF; i++ ) {
printf($i " ")
}
printf "\n"
}' <<< $usb_data )
A_AUDIO_DATA=( "${A_AUDIO_DATA[@]}" \
"$( lsusb -v 2>/dev/null |\
grep $( cat $usb_proc_file/usbid ) |\
gawk '{ for( i=7; i<NF; i++) { printf($i " ") } printf "\n" }' |\
sed "s/,/ /"),snd-usb-audio" )
if [[ -n "$usb_data" ]];then
A_AUDIO_DATA=( "${A_AUDIO_DATA[@]}" "$usb_data,snd-usb-audio" )
fi
fi
done