Is it possible to set an upper limit for PulseAudio on startup? I would like to make sure that I do not put the volume too high for the sake of my eardrums.

I looked into pactl set-sink-volume but that doesn't allow me to set a maximum volume limit. As well I cannot find anything under man pactl.


1 Answer 1


You can do it by the following bash code

x=$(pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
if [[ $x -le 200 ]]
    pactl set-sink-volume 0 +5% 

In this volume is stored in variable x

  • What is $SINK?
    – Zheng Qu
    Aug 1, 2020 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.