Created
July 26, 2024 17:02
-
-
Save acestudiooleg/81bfa1bdaaba99dfcc376b690e0961b5 to your computer and use it in GitHub Desktop.
switch kde audio input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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