Address feedback
Signed-off-by: Miles Alan <m@milesalan.com>
This commit is contained in:
parent
e7b9c8dc02
commit
52c49b7deb
3 changed files with 20 additions and 19 deletions
|
@ -2,10 +2,9 @@
|
||||||
pidof svkbd-sxmo || svkbd-sxmo &
|
pidof svkbd-sxmo || svkbd-sxmo &
|
||||||
|
|
||||||
OUTINPUT="$(
|
OUTINPUT="$(
|
||||||
echo "speaker
|
echo "Speaker
|
||||||
headphones
|
Headphones
|
||||||
earpiece
|
Earpiece
|
||||||
none
|
|
||||||
Close Menu" | dmenu -p "Audio Out" -c -fn "Terminus-30" -l 20
|
Close Menu" | dmenu -p "Audio Out" -c -fn "Terminus-30" -l 20
|
||||||
)"
|
)"
|
||||||
|
|
||||||
|
@ -16,15 +15,15 @@ SPEAKER="Line Out"
|
||||||
HEADPHONE="Headphone"
|
HEADPHONE="Headphone"
|
||||||
EARPIECE="Earpiece"
|
EARPIECE="Earpiece"
|
||||||
|
|
||||||
amixer set "$SPEAKER" mute > /dev/null
|
amixer set "$SPEAKER" mute
|
||||||
amixer set "$HEADPHONE" mute > /dev/null
|
amixer set "$HEADPHONE" mute
|
||||||
amixer set "$EARPIECE" mute > /dev/null
|
amixer set "$EARPIECE" mute
|
||||||
|
|
||||||
if [[ "$OUTINPUT" = "speaker" ]]; then
|
if [[ "$OUTINPUT" = "Speaker" ]]; then
|
||||||
amixer set "$SPEAKER" unmute > /dev/null
|
amixer set "$SPEAKER" unmute
|
||||||
elif [[ "$OUTINPUT" = "headphones" ]]; then
|
elif [[ "$OUTINPUT" = "Headphones" ]]; then
|
||||||
amixer set "$HEADPHONE" unmute > /dev/null
|
amixer set "$HEADPHONE" unmute
|
||||||
elif [[ "$OUTINPUT" = "earpiece" ]]; then
|
elif [[ "$OUTINPUT" = "Earpiece" ]]; then
|
||||||
amixer set "$EARPIECE" unmute > /dev/null
|
amixer set "$EARPIECE" unmute
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
pgrep -f sxmo_statusbar.sh | grep -v $$ | xargs kill -9
|
pgrep -f sxmo_statusbar.sh | grep -v $$ | xargs kill -9
|
||||||
|
|
||||||
audiodevice() {
|
audiodevice() {
|
||||||
amixer sget Earpiece | grep -E [[]on[]] && echo Earpiece > /dev/null && return
|
amixer sget Earpiece | grep -E '\[on\]' > /dev/null && echo Earpiece && return
|
||||||
amixer sget Headphone > /dev/null && echo Headphone || echo Speaker
|
amixer sget Headphone | grep -E '\[on\]' > /dev/null && echo Headphone && return
|
||||||
|
echo "Line Out"
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
|
@ -25,7 +26,7 @@ do
|
||||||
|
|
||||||
# Volume
|
# Volume
|
||||||
VOL=$(
|
VOL=$(
|
||||||
echo "$(amixer sget $(audiodevice))" |
|
echo "$(amixer sget "$(audiodevice)")" |
|
||||||
grep -oE '([0-9]+)%' |
|
grep -oE '([0-9]+)%' |
|
||||||
tr -d ' %' |
|
tr -d ' %' |
|
||||||
awk '{ s += $1; c++ } END { print s/c }' |
|
awk '{ s += $1; c++ } END { print s/c }' |
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#!/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 "Line Out"
|
amixer sget Headphone | grep -E '\[on\]' > /dev/null && echo Headphone && return
|
||||||
|
echo "Line Out"
|
||||||
}
|
}
|
||||||
|
|
||||||
notify() {
|
notify() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue