nixos-config/scripts/pulse_sink
2024-08-17 11:47:48 -03:00

27 lines
394 B
Bash
Executable file

#!/bin/sh
list_sinks() {
env LC_ALL=C pactl list sinks
}
desc=$(
list_sinks |
grep -ie "description:" |
cut -d: -f2 |
sed 's/^ //g;s/ $//g;' |
wdmenu -i -p "Output:"
)
device=$(
list_sinks |
grep -C2 "Description: $desc"|
grep Name |
cut -d: -f2 |
xargs
)
vol=$(pamixer --get-volume)
pactl set-default-sink "$device"
pamixer --set-volume "$vol"