mabox-i18n-files/lang/en/.config/tint2/scripts/volume
2021-11-20 17:12:07 +01:00

34 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Tint2 volume executor with icond from volumeicon
muted=$(pacmd list-sinks | awk '/muted/ { print $2 }')
vol=$(LANG=C pactl list sinks | awk '/Volume:/ {printf "%s ",$5}' | cut -f1 -d ' ' | cut -f1 -d '%')
if [[ $muted = "no" ]]; then
if [[ $vol -ge 80 ]]; then
echo /usr/share/volumeicon/icons/Blue Bar/8.png
echo "$vol%"
elif [[ $vol -ge 70 ]]; then
echo /usr/share/volumeicon/icons/Blue Bar/7.png
echo "$vol%"
elif [[ $vol -ge 60 ]]; then
echo /usr/share/volumeicon/icons/Blue Bar/6.png
echo "$vol%"
elif [[ $vol -ge 50 ]]; then
echo /usr/share/volumeicon/icons/Blue Bar/5.png
echo "$vol%"
elif [[ $vol -ge 30 ]]; then
echo /usr/share/volumeicon/icons/Blue Bar/4.png
echo "$vol%"
elif [[ $vol -ge 10 ]]; then
echo /usr/share/volumeicon/icons/Blue Bar/3.png
echo "$vol%"
elif [[ $vol -ge 0 ]]; then
echo /usr/share/volumeicon/icons/Blue Bar/2.png
echo "$vol%"
fi
else
echo /usr/share/volumeicon/icons/Blue Bar/1.png
echo ""
fi