2022-10-21 20:21:51 -03:00
|
|
|
#!/bin/sh
|
2022-11-30 22:00:19 -03:00
|
|
|
|
|
|
|
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)
|
2022-11-30 22:00:19 -03:00
|
|
|
|
|
|
|
pactl set-default-sink "$device"
|
|
|
|
|
2022-10-21 20:21:51 -03:00
|
|
|
pamixer --set-volume "$vol"
|