mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
Trying to add driver to output
This commit is contained in:
parent
2a7b3976cd
commit
8284050b51
18
inxi
18
inxi
|
@ -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': ' '
|
||||||
|
@ -1017,10 +1017,17 @@ get_audio_data()
|
||||||
if [[ ${#A_AUDIO_DATA[@]} -eq 0 ]];then
|
if [[ ${#A_AUDIO_DATA[@]} -eq 0 ]];then
|
||||||
A_AUDIO_DATA[0]='Failed to Detect Sound Card!'
|
A_AUDIO_DATA[0]='Failed to Detect Sound Card!'
|
||||||
fi
|
fi
|
||||||
# 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
|
||||||
|
|
Loading…
Reference in a new issue