#!/bin/bash

# Get current mute state and return appropriate icon
get_volume_icon() {
    muted=$(pactl get-sink-mute @DEFAULT_SINK@ | grep -o 'yes\|no')
    if [ "$muted" = "yes" ]; then
        echo " "
    else
        echo ""
    fi
}

# Output initial icon
get_volume_icon

# Subscribe to volume changes (including mute/unmute)
pactl subscribe | grep --line-buffered "sink" | while read -r line; do
    get_volume_icon
done
