marioortizmanero / polybar-pulseaudio-control

A feature-full Polybar module to control PulseAudio
MIT License
466 stars 49 forks source link

specify multiple blacklist devices only reads first entry #53

Closed NoobCam closed 2 years ago

NoobCam commented 2 years ago

Issue: when specifying multiple sinks to blacklist using the --sink-blacklist flag only the first entry is read.

Can you please tell me if this is a formatting issue on my side?

--sink-blacklist <name>[,<name>...] Sinks to ignore when switching. Default: none

click-middle = /usr/bin/pulseaudio-control.bash --sink-blacklist "alsa_output.usb-SteelSeries_Arctis_Pro_Wireless-00.mono-chat, alsa_output.usb-SENUCN_Digital_Hifi_Audio-00.iec958-stereo" next-sink

pactl list sinks short [15:30:38] 0 alsa_output.usb-SteelSeries_Arctis_Pro_Wireless-00.mono-chat module-alsa-card.c s16le 1ch 44100Hz SUSPENDED 1 alsa_output.usb-SteelSeries_Arctis_Pro_Wireless-00.stereo-game module-alsa-card.c s16le 2ch 44100Hz RUNNING 2 alsa_output.usb-SENUCN_Digital_Hifi_Audio-00.iec958-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED 4 alsa_output.pci-0000_01_00.1.hdmi-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED

marioortizmanero commented 2 years ago

I think the problem is the spacing between the sink names. I'll see if I can make this more user friendly, though.

marioortizmanero commented 2 years ago

Yup:

$ IFS=, read -r -a SINK_BLACKLIST <<< "1, 2, 3"
$ echo "'${SINK_BLACKLIST[1]}'"
' 2'
marioortizmanero commented 2 years ago

Please let me know if this works with the current script in master and I'll bump the version.

NoobCam commented 2 years ago

@marioortizmanero Thanks for the quick response and fix. Working as intended with the changes