Help ridding my system of pactl and replacing it with pw-cli and wpctl
from Communist@lemmy.ml to linux@lemmy.ml on 11 Jun 23:18
https://lemmy.ml/post/16769455

I currently use the following one-liner to switch between sinks

pactl set-default-sink $(pactl list short sinks | awk ‘{print $2}’ | sd ‘easyeffects_sink\n’ ‘’ | sd “$(pactl get-default-sink)\n” ‘’ | tofi --prompt-text " " --height 40% --width 40% --auto-accept-single true ) && pw-play --volume=0.2 /usr/share/sounds/freedesktop/stereo/audio-volume-change.oga

It seems wpctl doesn’t currently support node.names which makes this significantly more complex, has anyone done something similar with wpctl? I’ve found a massive script but I want something more simple that’s a one-liner.

wpctl set-default $(pw-cli i $(pactl list short sinks | awk ‘{print $2}’ | sd ‘easyeffects_sink\n’ ‘’ | sd “$(pactl get-default-sink)\n” ‘’ | tofi --prompt-text " " --height 40% --width 40% --auto-accept-single true ) | rg -oP ‘id: \K\w+’)

closest I’ve managed so far is this, which at least makes it so that wpctl sets the sink, which is an upgrade, I guess, but there’s still two pactl’s to eliminate…

#linux

threaded - newest

mactan@lemmy.ml on 12 Jun 00:01 collapse

for what it’s worth the pulsaudio APIs aren’t going anywhere anytime soon. keeping an eye on the replies out of curiosity though

Communist@lemmy.ml on 12 Jun 00:15 collapse

yeah i’m doing this because i’m anal not because there’s a good reason to.