#!/bin/sh RUNNING_SINK=$(pactl list sinks | awk ' /^Sink #/ {sink=$2} /State: RUNNING/ {print sink} ' | head -n1) pactl list sinks | grep -A 20 "^Sink $RUNNING_SINK" | grep '^[[:space:]]Volume:' | \ head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,'