mabox-i18n-files/lang/en/.config/tint2/scripts/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-19 15:12:35 +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-19 15:12:35 +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-19 15:12:35 +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-19 15:12:35 +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-19 15:12:35 +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-19 15:12:35 +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-19 15:12:35 +02:00
echo "<sup><span size='xx-small'> $vol%</span></sup>"
2021-11-20 17:12:07 +01:00
fi
else
2022-05-19 15:12:35 +02:00
echo "<sub><span size='xx-small'> $vol%</span></sub>"
2021-11-20 17:12:07 +01:00
fi