add toggle Adio script

This commit is contained in:
qvalentin 2021-12-01 18:05:47 +01:00
parent 254e3714b3
commit 153bbb387a
1 changed files with 13 additions and 0 deletions

13
.scripts/toggleAudio Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
dp="alsa_output.pci-0000_01_00.1.hdmi-stereo-extra2"
headphone="alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo"
current="$(pactl get-default-sink)"
if [ "$current" = $headphone ]; then
pactl set-default-sink $dp
else
pactl set-default-sink $headphone
fi