iso-profiles/mabox-linux/desktop-overlay/etc/skel/.config/tint2/scripts/volumettf
2021-12-10 23:52:16 +01:00

26 lines
1021 B
Bash
Executable File

#!/bin/bash
# Tint2 volume executor with ttf icons
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 "<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 "<sub><span size='xx-small'> $vol%</span></sub>"
fi