mabox-i18n-files/common/volumettf

26 lines
1.0 KiB
Plaintext
Raw Normal View History

2021-11-20 17:12:07 +01:00
#!/bin/bash
# Tint2 volume executor with ttf icons
2022-04-15 19:02:01 +02:00
muted=$(LANG=C pactl list sinks | awk '/Mute/ { print $2 }')
2021-11-20 17:12:07 +01:00
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
2022-05-20 13:05:26 +02:00
echo "<sup><span size='xx-small'> $vol%</span></sup>"
2021-11-20 17:12:07 +01:00
elif [[ $vol -ge 70 ]]; then
2022-05-20 13:05:26 +02:00
echo "<sup><span size='xx-small'> $vol%</span></sup>"
2021-11-20 17:12:07 +01:00
elif [[ $vol -ge 60 ]]; then
2022-05-20 13:05:26 +02:00
echo "<sup><span size='xx-small'> $vol%</span></sup>"
2021-11-20 17:12:07 +01:00
elif [[ $vol -ge 50 ]]; then
2022-05-20 13:05:26 +02:00
echo "<sup><span size='xx-small'> $vol%</span></sup>"
2021-11-20 17:12:07 +01:00
elif [[ $vol -ge 30 ]]; then
2022-05-20 13:05:26 +02:00
echo "<sup><span size='xx-small'> $vol%</span></sup>"
2021-11-20 17:12:07 +01:00
elif [[ $vol -ge 10 ]]; then
2022-05-20 13:05:26 +02:00
echo "<sup><span size='xx-small'> $vol%</span></sup>"
2021-11-20 17:12:07 +01:00
elif [[ $vol -ge 0 ]]; then
2022-05-20 13:05:26 +02:00
echo "<sup><span size='xx-small'> $vol%</span></sup>"
2021-11-20 17:12:07 +01:00
fi
else
2022-05-20 13:05:26 +02:00
echo "<sub><span size='xx-small'> $vol%</span></sub>"
2021-11-20 17:12:07 +01:00
fi