Skip to content

Instantly share code, notes, and snippets.

@acestudiooleg
Created July 26, 2024 17:02
Show Gist options
  • Save acestudiooleg/81bfa1bdaaba99dfcc376b690e0961b5 to your computer and use it in GitHub Desktop.
Save acestudiooleg/81bfa1bdaaba99dfcc376b690e0961b5 to your computer and use it in GitHub Desktop.
switch kde audio input
# /usr/local/bin/audio-device-switch.sh
acerAudio="alsa_output.usb-0c76_USB_PnP_Audio_Device-00.analog-stereo"
laptopAudio="alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink"
isLaptop=$(wpctl status | grep "0. Audio/Sink" | grep "pci")
isAcer=$(wpctl status | grep "0. Audio/Sink" | grep "usb")
nextaudio=laptopAudio
if [[ "$isLaptop" != "" ]]; then
nextaudio=${acerAudio}
else
nextaudio=${laptopAudio}
fi
pactl set-default-sink ${nextaudio}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment