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
Camera ^ 0 ^ sxmo_camera.sh
Wifi ^ 0 ^ st -e "nmtui"
Audio ^ 0 ^ sxmo_appmenu.sh audioout
Config ^ 0 ^ sxmo_appmenu.sh config
Logout ^ 0 ^ pkill -9 dwm
")" && 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
Bar Toggle ^ 1 ^ key Alt+b
Rotate ^ 1 ^ sxmo_rotate.sh
Audio Out ^ 0 ^ sxmo_appmenu.sh audioout
Upgrade Pkgs ^ 0 ^ st -e sxmo_upgrade.sh
")" && WINNAME=Config && return
@ -61,7 +61,7 @@ programchoicesinit() {
Speaker $([[ "$CURRENTDEV" == "Line Out" ]] && echo "✓") ^ 1 ^ sxmo_audioout.sh Speaker
Earpiece $([[ "$CURRENTDEV" == "Earpiece" ]] && echo "✓") ^ 1 ^ sxmo_audioout.sh Earpiece
None $([[ "$CURRENTDEV" == "None" ]] && echo "✓") ^ 1 ^ sxmo_audioout.sh None
")"
")" && WINNAME="Audio" && return
# MPV
echo $WMCLASS | grep -i "mpv" && CHOICES="$(echo "

@ -25,18 +25,19 @@ do
)
# Volume
VOL=$(
echo "$(amixer sget "$(audiodevice)")" |
AUDIODEV="$(sxmo_audiocurrentdevice.sh)"
[[ $AUDIODEV == "None" ]] && VOL="" || VOL=$(echo "$AUDIODEV" | cut -c1 | tr L S)"$(
amixer sget "$AUDIODEV" |
grep -oE '([0-9]+)%' |
tr -d ' %' |
awk '{ s += $1; c++ } END { print s/c }' |
xargs printf %.0f
)
)"
# Time
TIME=$(date +%R)
BAR=" ${MODEMMON}V${VOL} ${BATSTATUS}${PCT}% ${TIME}"
BAR=" ${MODEMMON}${VOL} ${BATSTATUS}${PCT}% ${TIME}"
xsetroot -name "$BAR"
inotifywait -e MODIFY $UPDATEFILE & sleep 30 & wait -n

Loading…
Cancel
Save