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