mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
Trying to remove some extra alsa (....) data, and fix the card numbering
This commit is contained in:
parent
662de26450
commit
3991b6efa1
13
inxi
13
inxi
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 0.5.27-b-1-t-1
|
||||
#### version: 0.5.27-b-1-t-2
|
||||
#### Date: November 13 2008
|
||||
########################################################################
|
||||
#### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif
|
||||
|
@ -1022,7 +1022,11 @@ get_audio_data()
|
|||
if [[ -e /proc/asound/version ]];then
|
||||
A_AUDIO_DATA[$alsa_index]=$( gawk '{
|
||||
{ IGNORECASE=1 }
|
||||
gsub( "Driver ","",$0 )
|
||||
# some alsa strings have the build date in (...)
|
||||
gsub( "Driver | [(].*[)]","",$0 )
|
||||
gsub(/,/, " ", $0)
|
||||
gsub(/^ +| +$/, "", $0)
|
||||
gsub(/ [ \t]+/, " ", $0)
|
||||
if ( $0 != "" ){
|
||||
print $0 ",alsa"
|
||||
}
|
||||
|
@ -1919,7 +1923,8 @@ print_audio_data()
|
|||
IFS="$ORIGINAL_IFS"
|
||||
|
||||
if [[ -n ${A_AUDIO_DATA[@]} ]];then
|
||||
if [[ ${#A_AUDIO_DATA[@]} -le 1 ]];then
|
||||
# slightly complicated because 2nd array item could be the alsa data
|
||||
if [[ ${#A_AUDIO_DATA[@]} -le 1 ]] || [[ ${#A_AUDIO_DATA[@]} -eq 2 && -n $( grep ',alsa' <<< ${A_AUDIO_DATA[@]} ) ]];then
|
||||
card_one='Card '
|
||||
fi
|
||||
|
||||
|
@ -1943,7 +1948,7 @@ print_audio_data()
|
|||
if [[ ${a_audio_working[1]} != 'alsa' ]];then
|
||||
audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$port_data"
|
||||
else
|
||||
audio_data="${C1}Sound Driver: ${C2}${a_audio_working[0]}"
|
||||
audio_data="${C1}Sound System: ${C2}${a_audio_working[0]}"
|
||||
fi
|
||||
audio_data=$( create_print_line " " "$audio_data" )
|
||||
print_screen_output "$audio_data"
|
||||
|
|
Loading…
Reference in a new issue