Add audio out menu
Signed-off-by: Miles Alan <m@milesalan.com>
This commit is contained in:
parent
6777dbdebd
commit
e7b9c8dc02
3 changed files with 35 additions and 4 deletions
|
@ -52,6 +52,7 @@ programchoicesinit() {
|
||||||
Bar Toggle ^ 1 ^ key Alt+b
|
Bar Toggle ^ 1 ^ key Alt+b
|
||||||
Rotate ^ 1 ^ rotate
|
Rotate ^ 1 ^ rotate
|
||||||
Wifi ^ 0 ^ st -e "nmtui"
|
Wifi ^ 0 ^ st -e "nmtui"
|
||||||
|
Audio Out ^ 0 ^ sxmo_audiooutmenu.sh
|
||||||
Upgrade Pkgs ^ 0 ^ st -e sxmo_upgrade.sh
|
Upgrade Pkgs ^ 0 ^ st -e sxmo_upgrade.sh
|
||||||
")" && WINNAME=Config && return
|
")" && WINNAME=Config && return
|
||||||
|
|
||||||
|
|
30
scripts/core/sxmo_audiooutmenu.sh
Executable file
30
scripts/core/sxmo_audiooutmenu.sh
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
pidof svkbd-sxmo || svkbd-sxmo &
|
||||||
|
|
||||||
|
OUTINPUT="$(
|
||||||
|
echo "speaker
|
||||||
|
headphones
|
||||||
|
earpiece
|
||||||
|
none
|
||||||
|
Close Menu" | dmenu -p "Audio Out" -c -fn "Terminus-30" -l 20
|
||||||
|
)"
|
||||||
|
|
||||||
|
pkill svkbd-sxmo
|
||||||
|
[[ "Close Menu" == "$OUTINPUT" ]] && exit 0
|
||||||
|
|
||||||
|
SPEAKER="Line Out"
|
||||||
|
HEADPHONE="Headphone"
|
||||||
|
EARPIECE="Earpiece"
|
||||||
|
|
||||||
|
amixer set "$SPEAKER" mute > /dev/null
|
||||||
|
amixer set "$HEADPHONE" mute > /dev/null
|
||||||
|
amixer set "$EARPIECE" mute > /dev/null
|
||||||
|
|
||||||
|
if [[ "$OUTINPUT" = "speaker" ]]; then
|
||||||
|
amixer set "$SPEAKER" unmute > /dev/null
|
||||||
|
elif [[ "$OUTINPUT" = "headphones" ]]; then
|
||||||
|
amixer set "$HEADPHONE" unmute > /dev/null
|
||||||
|
elif [[ "$OUTINPUT" = "earpiece" ]]; then
|
||||||
|
amixer set "$EARPIECE" unmute > /dev/null
|
||||||
|
fi
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
device() {
|
device() {
|
||||||
amixer sget Earpiece | grep -E '[[]on[]]' > /dev/null && echo Earpiece && return
|
amixer sget Earpiece | grep -E '[[]on[]]' > /dev/null && echo Earpiece && return
|
||||||
amixer sget Headphone > /dev/null && echo Headphone || echo Speaker
|
amixer sget Headphone > /dev/null && echo Headphone || echo "Line Out"
|
||||||
}
|
}
|
||||||
|
|
||||||
notify() {
|
notify() {
|
||||||
|
@ -16,15 +16,15 @@ notify() {
|
||||||
}
|
}
|
||||||
|
|
||||||
up() {
|
up() {
|
||||||
amixer set $(device) 1+
|
amixer set "$(device)" 1+
|
||||||
notify
|
notify
|
||||||
}
|
}
|
||||||
down() {
|
down() {
|
||||||
amixer set $(device) 1-
|
amixer set "$(device)" 1-
|
||||||
notify
|
notify
|
||||||
}
|
}
|
||||||
setvol() {
|
setvol() {
|
||||||
amixer set $(device) $1
|
amixer set "$(device)" $1
|
||||||
}
|
}
|
||||||
|
|
||||||
$@
|
$@
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue