#!/bin/sh sink=$(pactl list sinks |sed '/^Sink #./!d;s/^Sink #\(.\)/\1/' |tail -n1) if test "Mute: yes" = "$(pactl get-sink-mute $sink)" then echo  exit fi echo  $(pactl get-sink-volume $sink |sed -E '/balance/d;s/.*([0-9 ][0-9 ][0-9]%).*/\1/' |tr -d " ")