aruhier / barython

Configures lemonbar
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

PulseaudioWidget could be more snappy #3

Closed aruhier closed 8 years ago

aruhier commented 8 years ago

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.