falconindy / ponymix

CLI volume control for PulseAudio
MIT License
177 stars 27 forks source link

"is-muted" doesn't work #49

Closed williamzeni99 closed 6 years ago

williamzeni99 commented 6 years ago

Hi! I'm newer so I apologize if I fail.

I tried to make a script to change the icon on my i3 blocks status bar, but I can't make the mute condition work. Any ideas?

Here the script https://github.com/zeni99ArchLinux/i3-archlinux/blob/Work/config/i3/scripts/audio


vol=`ponymix get-volume`
muted=`ponymix is-muted`

# determine icon (this part works)
if [ $vol == "0" ]; then
    echo "  $vol"
else
    if [ $vol -le 63 ]; then
        echo "  $vol"
    else
        echo "  $vol"
    fi
fi

# determine mute status (this part doesn't works )
if [ $muted == "0" ]; then
    echo $vol
fi

If I write ponymix is-muted in my terminal I don't have any output.

falconindy commented 6 years ago

is-muted exits 0 (muted) or non-zero (not muted). It has no output. This is how it's documented to work.