diff --git a/scripts/core/sxmo_audiocurrentdevice.sh b/scripts/core/sxmo_audiocurrentdevice.sh index 37a20aa..ddef734 100755 --- a/scripts/core/sxmo_audiocurrentdevice.sh +++ b/scripts/core/sxmo_audiocurrentdevice.sh @@ -1,8 +1,12 @@ #!/usr/bin/env sh +${SPEAKER:-"Line Out"} +${HEADPHONE:-"Headphone"} +${EARPIECE:-"Earpiece"} + audiodevice() { - amixer sget "Earpiece" | grep -qE '\[on\]' && echo Earpiece && return - amixer sget "Headphone" | grep -qE '\[on\]' && echo Headphone && return - amixer sget "Line Out" | grep -qE '\[on\]' && echo Line Out && return + amixer sget "$EARPIECE" | grep -qE '\[on\]' && echo "$EARPIECE" && return + amixer sget "$HEADPHONE" | grep -qE '\[on\]' && echo "$HEADPHONE" && return + amixer sget "$SPEAKER" | grep -qE '\[on\]' && echo "$SPEAKER" && return echo "None" }