This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.
nixos-config/scripts/pulse_sink

27 lines
394 B
Bash

#!/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"