mabox-i18n-files/common/volumettf
2022-09-20 13:58:30 +02:00

26 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Tint2 volume executor with ttf icons
muted=$(LANG=C pactl list sinks | awk '/Mute/ { 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 "墳<sup><span size='xx-small'> $vol%</span></sup>"
elif [[ $vol -ge 70 ]]; then
echo "墳<sup><span size='xx-small'> $vol%</span></sup>"
elif [[ $vol -ge 60 ]]; then
echo "奔<sup><span size='xx-small'> $vol%</span></sup>"
elif [[ $vol -ge 50 ]]; then
echo "奔<sup><span size='xx-small'> $vol%</span></sup>"
elif [[ $vol -ge 30 ]]; then
echo "奔<sup><span size='xx-small'> $vol%</span></sup>"
elif [[ $vol -ge 10 ]]; then
echo "奄<sup><span size='xx-small'> $vol%</span></sup>"
elif [[ $vol -ge 0 ]]; then
echo "奄<sup><span size='xx-small'> $vol%</span></sup>"
fi
else
echo "婢<sup><span size='xx-small'> $vol%</span></sup>"
fi