mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
(Change Version)
Fixed extra data issue on alsa output, now etch on old laptop is also showing sound card by the way. Removing (...date build...) string from alsa output if present, and removing trailing dot.
This commit is contained in:
parent
3ea5671668
commit
143a732b49
16
inxi
16
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 0.5.27
|
#### version: 0.5.28
|
||||||
#### Date: November 13 2008
|
#### Date: November 13 2008
|
||||||
########################################################################
|
########################################################################
|
||||||
#### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif
|
#### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif
|
||||||
|
@ -1018,7 +1018,12 @@ get_audio_data()
|
||||||
if [[ -e /proc/asound/version ]];then
|
if [[ -e /proc/asound/version ]];then
|
||||||
A_AUDIO_DATA[$alsa_index]=$( gawk '{
|
A_AUDIO_DATA[$alsa_index]=$( gawk '{
|
||||||
{ IGNORECASE=1 }
|
{ IGNORECASE=1 }
|
||||||
gsub( "Driver ","",$0 )
|
# some alsa strings have the build date in (...)
|
||||||
|
# also remove trailing .
|
||||||
|
gsub( "Driver | [(].*[)]|\.$","",$0 )
|
||||||
|
gsub(/,/, " ", $0)
|
||||||
|
gsub(/^ +| +$/, "", $0)
|
||||||
|
gsub(/ [ \t]+/, " ", $0)
|
||||||
if ( $0 != "" ){
|
if ( $0 != "" ){
|
||||||
print $0 ",alsa"
|
print $0 ",alsa"
|
||||||
}
|
}
|
||||||
|
@ -1899,7 +1904,6 @@ print_short_data()
|
||||||
|
|
||||||
#### LINE ITEM PRINT FUNCTIONS
|
#### LINE ITEM PRINT FUNCTIONS
|
||||||
|
|
||||||
# print sound card data
|
|
||||||
# print sound card data
|
# print sound card data
|
||||||
print_audio_data()
|
print_audio_data()
|
||||||
{
|
{
|
||||||
|
@ -1913,7 +1917,8 @@ print_audio_data()
|
||||||
IFS="$ORIGINAL_IFS"
|
IFS="$ORIGINAL_IFS"
|
||||||
|
|
||||||
if [[ -n ${A_AUDIO_DATA[@]} ]];then
|
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 '
|
card_one='Card '
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1937,7 +1942,7 @@ print_audio_data()
|
||||||
if [[ ${a_audio_working[1]} != 'alsa' ]];then
|
if [[ ${a_audio_working[1]} != 'alsa' ]];then
|
||||||
audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$port_data"
|
audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$port_data"
|
||||||
else
|
else
|
||||||
audio_data="${C1}Sound Driver: ${C2}${a_audio_working[0]}"
|
audio_data="${C1}Sound System: ${C2}${a_audio_working[0]}"
|
||||||
fi
|
fi
|
||||||
audio_data=$( create_print_line " " "$audio_data" )
|
audio_data=$( create_print_line " " "$audio_data" )
|
||||||
print_screen_output "$audio_data"
|
print_screen_output "$audio_data"
|
||||||
|
@ -1945,7 +1950,6 @@ print_audio_data()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print_cpu_data()
|
print_cpu_data()
|
||||||
{
|
{
|
||||||
local cpu_data='' i='' cpu_clock_speed='' cpu_multi_clock_data=''
|
local cpu_data='' i='' cpu_clock_speed='' cpu_multi_clock_data=''
|
||||||
|
|
Loading…
Reference in a new issue