Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At work I use to use an USB headset which gets detected as separate audio output and input (for the mic) devices. At home I use conventional analogue headset which is plugged into my laptop built-in sound system with headphone/mic jacks.

Every time I want to switch between the USB headset and my laptop built-in sound system I have to open PulseAudio control panel and select the device.

Can't I just make a couple of command line shortcuts to do the switch?

UPDATE: I've just came to even more interesting idea than using CLI-based shortcuts manually - I think It is possible to trigger their launching on the USB headset attachment/detachment detection.

share|improve this question

PulseAudio has got a command line interface. You can read about it on the official wiki.

You didn't mention witch distro You use, but with the default package manager it should be easy to search after the PulseAudio CLI package.

Basically you search the command which does the job for You, then You can create an alias command in Your ~/.bash_profile or ~/.bashrc with:

# cs like change source
alias cs='<command>'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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