mirror of
https://github.com/starr-dusT/dotfiles.git
synced 2025-02-19 19:27:31 -08:00
13 lines
447 B
Plaintext
13 lines
447 B
Plaintext
|
|
sink=$( pactl list short sinks | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,' | head -n 1 )
|
|
volume=$( pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
|
|
mute=$(pactl list sinks | grep '^[[:space:]]Mute:' | head -n $(( $SINK + 1 )) | tail -n 1 | awk '{print $2}')
|
|
|
|
if [ "$mute" == "yes" ]; then
|
|
color="#f92672"
|
|
else
|
|
color="#a6e22e"
|
|
fi
|
|
|
|
echo "<fc=$color> $volume%</fc>"
|