setting the volume from the command line
I have a laptop where the default volume is weak. On the system tray the volume is on 100% but it’s still weak. So far I started the program “pavucontrol”, which is a GUI application, and there I set the volume to 150% (that’s the maximum). However, if I watch a youtube video and pause it, in pavucontrol the volume falls back to 100%, so I need to adjust it after each pause.
I found a command line program that allows one to set the volume. It’s independent of pavucontrol. So I made a script that runs automatically when the graphical interface comes up:
#!/usr/bin/env bash # # from http://askubuntu.com/questions/44680 # listing current volume: # # pacmd list-sinks | grep volume # cmd="pacmd set-sink-volume 0 100000" echo "#" $cmd $cmd
First list your sinks with “pacmd list-sinks”. I only had one, hence the id 0. The value 100000 is the volume (on my system it’s equivalent to 153%). Value 65535 is volume 100%.
Tip from here.
I made a wrapper script around
pacmd; you can find it here on GitHub. Its usage is very simple. Do you want to increase the volume? Just call “
volume.py 140%” and you are done.