#!/bin/sh poll() { pamixer --get-volume | grep -E '^[0-9]+$' } pactl subscribe | while read -r ;do case "$REPLY" in *change*) poll ;; esac done