This commit is contained in:
zcake 2021-01-30 14:50:10 +00:00
parent e47c1d3797
commit b8a25d9a11
1 changed files with 6 additions and 2 deletions

View File

@ -1,15 +1,19 @@
#!/bin/bash
vol="$(pactl list sinks | awk '$1=="Volume:" {print $5}'|sed 's/%//g')"
tmp='/tmp/vol'
if [ -s $tmp ]
then
cat $tmp
else
if pactl list sinks | grep 'Mute: yes'>/dev/zero;then echo "🔇" > $tmp;else
vol="$(pactl list sinks | awk '$1=="Volume:" {print $5}'|sed 's/%//g')"
if pactl list sinks | grep 'Mute: yes'>/dev/zero
then echo "🔇" > $tmp
echo "!$vol" >/tmp/volbar&
else
if [ $vol -lt 10 ] ; then echo '🔈 '$vol'%'> $tmp;
elif [ $vol -gt 10 ] && [ $vol -lt 40 ] ;then echo '🔉 '$vol'%'> $tmp;
elif [ $vol -gt 40 ] && [ $vol -lt 100 ] ; then echo '🔊 '$vol'%'> $tmp;
elif [ $vol -gt 100 ] ; then echo '📢 '$vol'%' > $tmp; fi
echo "$vol" >/tmp/volbar&
fi
cat $tmp
fi