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:

  • Link Salad: References From The Digital Publishing Talk
  • A Quick Reminder About My "Artistic License" Policy (Or: I'm Not Talking About You)
  • It isn't how you screw up as a feminist. It's how you deal with screwing up.
  • Ignore stupid "scary" music. Go for some deeply creepy stuff this season.
  • The MarcoPoloization of Culture
  • What A Cover Letter Should Look Like When Submitting To A Magazine
  • Room Service - Published at the WiFiles