Created
January 20, 2024 13:12
-
-
Save new-penguin/1aa80316b3d104f64635bc3b4cdbab2e to your computer and use it in GitHub Desktop.
Quickly switch audio in pipewire. Works great when set to a global hotkey
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
#!/bin/bash | |
# Define sinks | |
NORMALIZED='Normalized' | |
STANDARD='alsa_output.pci-0000_0e_00.4.iec958-stereo' | |
# Get first line of running audio sink and choose other | |
if [ $(pactl list short sinks | grep -m 1 RUNNING | awk {'print $2'}) = $STANDARD ]; then | |
DEVICE=$NORMALIZED | |
else | |
DEVICE=$STANDARD | |
fi | |
# Set default device | |
pactl set-default-sink $DEVICE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment