From 687d42cffb17624b69781cf00b6ab19aa7654511 Mon Sep 17 00:00:00 2001 From: Miles Alan Date: Tue, 26 May 2020 18:45:12 -0500 Subject: [PATCH] Delete duplicate dead code --- scripts/core/sxmo_statusbar.sh | 6 ------ scripts/core/sxmo_vol.sh | 14 ++++---------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/scripts/core/sxmo_statusbar.sh b/scripts/core/sxmo_statusbar.sh index a95fda0..41b6723 100755 --- a/scripts/core/sxmo_statusbar.sh +++ b/scripts/core/sxmo_statusbar.sh @@ -1,12 +1,6 @@ #!/usr/bin/env sh pgrep -f sxmo_statusbar.sh | grep -v $$ | xargs kill -9 -audiodevice() { - amixer sget Earpiece | grep -E '\[on\]' > /dev/null && echo Earpiece && return - amixer sget Headphone | grep -E '\[on\]' > /dev/null && echo Headphone && return - echo "Line Out" -} - sleep 1 UPDATEFILE=/tmp/sxmo_bar touch $UPDATEFILE diff --git a/scripts/core/sxmo_vol.sh b/scripts/core/sxmo_vol.sh index 7b1e581..5b37fef 100755 --- a/scripts/core/sxmo_vol.sh +++ b/scripts/core/sxmo_vol.sh @@ -1,13 +1,7 @@ #!/usr/bin/env sh -device() { - amixer sget Earpiece | grep -E '\[on\]' > /dev/null && echo Earpiece && return - amixer sget Headphone | grep -E '\[on\]' > /dev/null && echo Headphone && return - echo "Line Out" -} - notify() { sxmo_notify.sh 200 "Volume $( - amixer get "$(device)" | + amixer get "$(sxmo_audiocurrentdevice.sh)" | grep -oE '([0-9]+)%' | tr -d ' %' | awk '{ s += $1; c++ } END { print s/c }' | @@ -17,15 +11,15 @@ notify() { } up() { - amixer set "$(device)" 1+ + amixer set "$(sxmo_audiocurrentdevice.sh)" 1+ notify } down() { - amixer set "$(device)" 1- + amixer set "$(sxmo_audiocurrentdevice.sh)" 1- notify } setvol() { - amixer set "$(device)" $1 + amixer set "$(sxmo_audiocurrentdevice.sh)" $1 } $@