Created
June 11, 2021 12:17
-
-
Save CIAvash/c78612b7015180c9ed071381e0a2318d to your computer and use it in GitHub Desktop.
Select/Switch Pulse/Pipewire audio sink/device/node with `rofi` and `pactl`
This file contains 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/bin/env bash | |
all_sinks=$(pactl list short sinks | cut -f 2) | |
default_sink=$(pactl info | grep 'Default Sink' | cut -d : -f 2) | |
active_sink=$(echo "$all_sinks" | grep -n $default_sink | cut -d : -f 1) | |
selected_sink=$(echo "$all_sinks" | rofi -dmenu -i -a $(($active_sink - 1)) -p 'Select a device: ') | |
pactl set-default-sink $selected_sink |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment