Skip to content

Instantly share code, notes, and snippets.

@jsuryahyd
Last active August 8, 2022 04:41
Show Gist options
  • Save jsuryahyd/64d04917ae0a86d8898adf915fe2cb6a to your computer and use it in GitHub Desktop.
Save jsuryahyd/64d04917ae0a86d8898adf915fe2cb6a to your computer and use it in GitHub Desktop.
Set Extenal Microphone as default on Startup in Linux
  • Make sure PulseAudio is installed
  • Search for "Startup applications" in applications (click on windows menu and search)
  • click Add item
  • In Command input - pactl set-default-source 'alsa_input.usb-0c76_USB_PnP_Audio_Device-00.mono-fallback' [refer below for how to get the name of the mic]
  • Click save
  • It should run automatically from next startup

How to get the name of the mic?

  • LANG=C pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d" " -f2 stackoverflow
  • This will list all input and output devices names. Copy the name of the device you want and pass to above patcl set-default-source command

Make a clickable icon on desktop, to set the source

  • create a bash file with following text
    #! /bin/bash
    pactl set-default-source 'alsa_input.usb-0c76_USB_PnP_Audio_Device-00.mono-fallback'
    echo "done"
    
  • save it as "setMic.sh"
  • Make the file executable, with chmod or by right click on the file and going to properties
  • Now we can double click on this file icon on desktop, anytime we want to set the mic as default source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment