At work I often switch my audio output between the USB headset and the normal speakers. Switching means:
- Start pavucontrol (PulseAudio Volume Control)
- Mark the USB headset output device as default ("Set as fallback")
- Tell all applications that are playing music to use the USB headset as output.
Luckily, this is Linux, so this is scriptable:
#!/bin/sh # found with "pactl list sinks" sinkname=alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo pactl set-default-sink $sinkname for inputid in `pactl list short sink-inputs | cut -f1`; do pactl move-sink-input $inputid $sinkname done