sxmo_audiocurrentdevice: use existing env vars for audio devices
Signed-off-by: Anjandev Momi <anjan@momi.ca>
This commit is contained in:
parent
fd0eb1dc88
commit
6abfc76bb7
1 changed files with 7 additions and 3 deletions
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue