diff --git a/overlay/etc/skel/.conkyrc b/overlay/etc/skel/.conkyrc index 1173e7d..54f6fdb 100644 --- a/overlay/etc/skel/.conkyrc +++ b/overlay/etc/skel/.conkyrc @@ -34,7 +34,7 @@ ${font DejaVu Sans:bold:size=10}${color #8d5133}${alignc}INTERFACES ${font DejaVu Sans Mono:size=11}${color yellow}Radio: ${execpi 10 et-system-info active-radio} CAT : ${execpi 10 et-system-info et-cat} GPS : ${execpi 10 et-system-info et-gps} -Audio: ${execpi 10 et-system-info et-audio} +Audio: ${execpi 10 et-system-info et-audio} ${execpi 10 et-system-info et-audio-card} ${font DejaVu Sans:bold:size=9}${color #805f4f}${alignc}${execp /opt/emcomm-tools/bin/et-system-info release} ]]; diff --git a/overlay/opt/emcomm-tools/bin/et-system-info b/overlay/opt/emcomm-tools/bin/et-system-info index a4be451..19d0157 100755 --- a/overlay/opt/emcomm-tools/bin/et-system-info +++ b/overlay/opt/emcomm-tools/bin/et-system-info @@ -7,12 +7,13 @@ function usage() { echo "Usage: $(basename $0) " - echo " active-radio - Display model of active radio" - echo " et-audio - State of audio interface" - echo " et-cat - State of CAT control interface" - echo " et-gps - State of GPS interface" - echo " ip - System IP address" - echo " release - EmComm Tools release" + echo " active-radio - Display model of active radio" + echo " et-audio - Show state of audio interface" + echo " et-audio-card - Display audio card and device: ," + echo " et-cat - Show state of CAT control interface" + echo " et-gps - Show state of GPS interface" + echo " ip - System IP address" + echo " release - EmComm Tools release" } if [ $# -ne 1 ]; then @@ -44,6 +45,25 @@ case $1 in echo "Not connected" fi + ;; + et-audio-card) + + # 1. Check if the symlink was created by the udev rules + if [ -e /dev/et-audio ]; then + + # 2. Check that this device was properly tagged with the ET_AUDIO env variable with a udev rule + APLAY_OUT=$(arecord -l | grep ET_AUDIO) + if [ $? -eq 0 ]; then + AUDIO_CARD=$(echo $APLAY_OUT | cut -d":" -f1 | awk '{print $2}') + AUDIO_DEVICE=$(echo $APLAY_OUT | cut -d"," -f2 | cut -d":" -f1 | awk '{print $2}') + echo $AUDIO_CARD,$AUDIO_DEVICE + else + exit 1 + fi + else + exit 1 + fi + ;; et-cat)