Problem is that pactl subscribe receives events when running pulseaudio-ctl, so fetching the volume will send an event to pactl, what will call pulseaudio-ctl, etc…
A hack has been found to "flush" the subprocess' stdout after launching pulseaudio-ctl, with a communicate() that times out after a few hundreds milliseconds but it slows down the widget.
The subprocess' stdout mights be "shutdown" after the notify, and then reopened again after having executed the command.
Problem is that
pactl subscribe
receives events when runningpulseaudio-ctl
, so fetching the volume will send an event to pactl, what will callpulseaudio-ctl
, etc…A hack has been found to "flush" the subprocess' stdout after launching
pulseaudio-ctl
, with a communicate() that times out after a few hundreds milliseconds but it slows down the widget. The subprocess' stdout mights be "shutdown" after the notify, and then reopened again after having executed the command.