#!/bin/sh
PATH="$(dirname $0):$PATH"

mixer=$(/usr/lib/gutenbach/gutenbach-get-config mixer)
channel=$(/usr/lib/gutenbach/gutenbach-get-config channel)

volstat=$(amixer get $mixer | grep "$channel" \
 | perl -lne 'print $1 if (/: Playback .*\[(on|off)\]$/)'
)

case "$volstat" in 
    on)  result=unmuted;;
    off) result=muted;;
    *)   result=unknown;;
esac

echo $result
