From 153bbb387a5ff9a56e214384bd9d674e797e7bb6 Mon Sep 17 00:00:00 2001 From: qvalentin Date: Wed, 1 Dec 2021 18:05:47 +0100 Subject: [PATCH] add toggle Adio script --- .scripts/toggleAudio | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 .scripts/toggleAudio diff --git a/.scripts/toggleAudio b/.scripts/toggleAudio new file mode 100755 index 0000000..a0ac61f --- /dev/null +++ b/.scripts/toggleAudio @@ -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