Update to show different letter depending on audio out device

master
Miles Alan 5 years ago
parent 3c1fbd9e8d
commit a4562f2dd4
  1. 4
      scripts/core/sxmo_appmenu.sh
  2. 9
      scripts/core/sxmo_statusbar.sh

@ -15,6 +15,7 @@ programchoicesinit() {
Texts ^ 0 ^ sxmo_modemtext.sh Texts ^ 0 ^ sxmo_modemtext.sh
Camera ^ 0 ^ sxmo_camera.sh Camera ^ 0 ^ sxmo_camera.sh
Wifi ^ 0 ^ st -e "nmtui" Wifi ^ 0 ^ st -e "nmtui"
Audio ^ 0 ^ sxmo_appmenu.sh audioout
Config ^ 0 ^ sxmo_appmenu.sh config Config ^ 0 ^ sxmo_appmenu.sh config
Logout ^ 0 ^ pkill -9 dwm Logout ^ 0 ^ pkill -9 dwm
")" && WINNAME=Sys ")" && WINNAME=Sys
@ -51,7 +52,6 @@ programchoicesinit() {
Flash $(cat /sys/class/leds/white:flash/brightness | grep -E '^0$' > /dev/null && echo -n "Off → On" || echo -n "On → Off") ^ 1 ^ sxmo_flashtoggle.sh Flash $(cat /sys/class/leds/white:flash/brightness | grep -E '^0$' > /dev/null && echo -n "Off → On" || echo -n "On → Off") ^ 1 ^ sxmo_flashtoggle.sh
Bar Toggle ^ 1 ^ key Alt+b Bar Toggle ^ 1 ^ key Alt+b
Rotate ^ 1 ^ sxmo_rotate.sh Rotate ^ 1 ^ sxmo_rotate.sh
Audio Out ^ 0 ^ sxmo_appmenu.sh audioout
Upgrade Pkgs ^ 0 ^ st -e sxmo_upgrade.sh Upgrade Pkgs ^ 0 ^ st -e sxmo_upgrade.sh
")" && WINNAME=Config && return ")" && WINNAME=Config && return
@ -61,7 +61,7 @@ programchoicesinit() {
Speaker $([[ "$CURRENTDEV" == "Line Out" ]] && echo "✓") ^ 1 ^ sxmo_audioout.sh Speaker Speaker $([[ "$CURRENTDEV" == "Line Out" ]] && echo "✓") ^ 1 ^ sxmo_audioout.sh Speaker
Earpiece $([[ "$CURRENTDEV" == "Earpiece" ]] && echo "✓") ^ 1 ^ sxmo_audioout.sh Earpiece Earpiece $([[ "$CURRENTDEV" == "Earpiece" ]] && echo "✓") ^ 1 ^ sxmo_audioout.sh Earpiece
None $([[ "$CURRENTDEV" == "None" ]] && echo "✓") ^ 1 ^ sxmo_audioout.sh None None $([[ "$CURRENTDEV" == "None" ]] && echo "✓") ^ 1 ^ sxmo_audioout.sh None
")" ")" && WINNAME="Audio" && return
# MPV # MPV
echo $WMCLASS | grep -i "mpv" && CHOICES="$(echo " echo $WMCLASS | grep -i "mpv" && CHOICES="$(echo "

@ -25,18 +25,19 @@ do
) )
# Volume # Volume
VOL=$( AUDIODEV="$(sxmo_audiocurrentdevice.sh)"
echo "$(amixer sget "$(audiodevice)")" | [[ $AUDIODEV == "None" ]] && VOL="" || VOL=$(echo "$AUDIODEV" | cut -c1 | tr L S)"$(
amixer sget "$AUDIODEV" |
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 }' |
xargs printf %.0f xargs printf %.0f
) )"
# Time # Time
TIME=$(date +%R) TIME=$(date +%R)
BAR=" ${MODEMMON}V${VOL} ${BATSTATUS}${PCT}% ${TIME}" BAR=" ${MODEMMON}${VOL} ${BATSTATUS}${PCT}% ${TIME}"
xsetroot -name "$BAR" xsetroot -name "$BAR"
inotifywait -e MODIFY $UPDATEFILE & sleep 30 & wait -n inotifywait -e MODIFY $UPDATEFILE & sleep 30 & wait -n

Loading…
Cancel
Save