From 34bff56c3b587e2cb75f9b24c4df2d79f357c612 Mon Sep 17 00:00:00 2001 From: 0x7FFFFFFF <563748846@qq.com> Date: Thu, 2 Mar 2023 23:09:46 -0700 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E9=9F=B3=E9=87=8F?= =?UTF-8?q?=E5=9C=A8=E4=B8=AD=E6=96=87=E7=8E=AF=E5=A2=83=E4=B8=8B=E4=B8=80?= =?UTF-8?q?=E7=9B=B4=E6=98=BE=E7=A4=BA=E9=9D=99=E9=9F=B3=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DEF/statusbar/packages/vol.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/DEF/statusbar/packages/vol.sh b/DEF/statusbar/packages/vol.sh index 5752c574..cf2b2114 100644 --- a/DEF/statusbar/packages/vol.sh +++ b/DEF/statusbar/packages/vol.sh @@ -26,9 +26,13 @@ signal=$(echo "^s$this^" | sed 's/_//') update() { sink=$(pactl info | grep 'Default Sink' | awk '{print $3}') - [ "$sink" = "" ] && $(pactl info | grep '默认音频入口' | awk '{print $2}') - volunmuted=$(pactl list sinks | grep $sink -A 6 | sed -n '7p' | grep 'Mute: no') - vol_text=$(pactl list sinks | grep $sink -A 7 | sed -n '8p' | awk '{printf int($5)}') + if [ "$sink" = "" ]; then sink=$(pactl info | grep '默认音频入口' | awk -F':' '{print $2}');fi + volunmuted=$(pactl list sinks | grep $sink -A 6 | sed -n '7p' | grep '静音:否') + vol_text=$(pactl list sinks | grep $sink -A 7 | sed -n '8p' | awk '{printf int($4)}') + if [ "$LANG" != "zh_CN.UTF-8" ]; then + volunmuted=$(pactl list sinks | grep $sink -A 6 | sed -n '7p' | grep 'Mute: no') + vol_text=$(pactl list sinks | grep $sink -A 7 | sed -n '8p' | awk '{printf int($5)}') + fi if [ ! "$volunmuted" ]; then vol_text="--"; vol_icon="ﱝ"; elif [ "$vol_text" -eq 0 ]; then vol_text="00"; vol_icon="婢"; elif [ "$vol_text" -lt 10 ]; then vol_icon="奔"; vol_text=0$vol_text;