mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-05 20:50:15 +00:00
switch audio with rofi and add extraLib
This commit is contained in:
15
modules/nixos/graphical/rofi/pulse-sink.sh
Executable file
15
modules/nixos/graphical/rofi/pulse-sink.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Credit: https://gist.github.com/Nervengift/844a597104631c36513c
|
||||
|
||||
sink=$(
|
||||
ponymix -t sink list |
|
||||
awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}' |
|
||||
rofi -dmenu -p 'pulseaudio sink:' -location 6 -width 100 |
|
||||
grep -Po '[0-9]+(?=:)'
|
||||
) &&
|
||||
ponymix set-default -d "$sink" &&
|
||||
for input in $(ponymix list -t sink-input | grep -Po '[0-9]+(?=:)'); do
|
||||
echo "$input -> $sink"
|
||||
ponymix -t sink-input -d "$input" move "$sink"
|
||||
done
|
Reference in New Issue
Block a user