nixos-config/scripts/pulse_sink

27 lines
394 B
Plaintext
Raw Normal View History

2022-10-21 20:21:51 -03:00
#!/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
)
2022-10-21 20:21:51 -03:00
vol=$(pamixer --get-volume)
pactl set-default-sink "$device"
2022-10-21 20:21:51 -03:00
pamixer --set-volume "$vol"