#!/bin/sh while true do volume="$(mpc volume | awk '{print $2}' | cut -f1 -d'%')" choice="$(printf "plus\nmin\n" | commander -d -c -p "$volume" | sed 's/plus/+/;s/min/-/')" [ "$choice" ] || break nb="$(commander -c -p "$volume$choice" -i)" [ "$nb" ] || break mpc volume "$choice$nb" done