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.

Popular posts:

  • HOWTO Make Your Hamburger Helper Better
  • The Songs That Chronicle Our Lives
  • Word Porn Quotes
  • I am not a number; I am a free man, OR, why you should never rely on social media
  • It's not being "Awkward", and the difference between Excuses and Explanations
  • If there's one Nazi (or a racist) at the table...
  • I really like you, but I have to break up with you before I don't.