Control Pulseaudio from the Command Line – Ruby Script

technology.png
For reasons far too tedious to go into here1 I needed to control PulseAudio’s volume (and toggle mute) from the command line. I eventually found a Ruby script – but it didn’t completely work. I tweaked it a bit, forked it on github, and now present it for your pleasure.

The main reason you’d want to use this over the various bash scripts floating around is this: It works on all your audio sinks, not just one of them. Something you never think about… until you have to (like I did this week).

I’m really quite thrilled – this is my first time figuring out a Ruby script and my first time using github for my own stuff. Huzzah!

Hope this helps someone!

1 I needed to control through pulseaudio instead of ALSA, largely because of the new USB speakers I have. I want the internal audio (for headphones, etc) to keep working too, and I use openbox, so graphical versions are out of the question and constantly switching sinks in scripts sucks. Hence this.

blankWas this post helpful or insightful? Buy me a coffee here or here and share this post with others!

Popular posts:

  • The difference between boundaries and rules
  • Two Ways to get CMYK Separation Using GIMP Instead of Photoshop in 2022
  • Word Porn Quotes
  • Weekend Project: Whole House and Streaming Audio for Free with MPD
  • Organizing and Tiling Your Windows on #Openbox Using Only... Openbox
  • Odds and Ends: Optimizing SSHFS, moving files into subdirectories, and getting placeholder images

Recent Posts