diff options
| author | pants <niklasjo2004@gmail.com> | 2026-09-21 14:17:03 -0700 |
|---|---|---|
| committer | pants <niklasjo2004@gmail.com> | 2026-09-21 14:17:03 -0700 |
| commit | 7b21727285e50b0b050c4ddd70d07542229c5366 (patch) | |
| tree | 5d369153c5df5b41f3750d25479a68f20169c8ff /bin/audioswitch | |
init
Diffstat (limited to 'bin/audioswitch')
| -rwxr-xr-x | bin/audioswitch | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/audioswitch b/bin/audioswitch new file mode 100755 index 0000000..8b910c1 --- /dev/null +++ b/bin/audioswitch @@ -0,0 +1,14 @@ +#!/bin/sh +CARD=$(pactl list cards short | grep '1f.3' | awk '{print $2}') +CURRENT_SINK=$(pactl info | grep "Default Sink:") +dunstctl close-all +case $CURRENT_SINK in + *iec958*) + pactl set-card-profile $CARD output:analog-stereo + notify-send "analog out active" -i : + ;; + *) + pactl set-card-profile $CARD output:iec958-stereo + notify-send "digital out active" -i : + ;; +esac |
