#!/bin/bash

if [[ $# -lt 1 ]] ; then
    printf "\nPulseAudio volume setter. Add desired volume in percents as first parameter of this script.\n\n"
else
    echo "Volume WAS:"
    pacmd list sinks | grep -A 1 sink: | sed -e '1d'
    pactl set-sink-volume `pacmd list sinks | grep sink: | grep -o ' [0-9]\{1,\} '` $(($1 * 65535 / 100))
fi

echo "Volume NOW IS:"
pacmd list sinks | grep -A 1 sink: | sed -e '1d'
