diff --git a/.bin/pulseaudio-assert-volume b/.bin/pulseaudio-assert-volume index ac6458e..b8bdd6c 100755 --- a/.bin/pulseaudio-assert-volume +++ b/.bin/pulseaudio-assert-volume @@ -14,7 +14,7 @@ signal(SIGTERM, handle_signal) try: - print('Startup') + print('Startup', flush=True) while True: try: @@ -31,12 +31,12 @@ try: if line.startswith('volume:'): for speaker, absolute, percent in findall('([a-z-]+):\W+([0-9]+)\W+\/\W+([0-9]+)%', line): if int(percent) < 100: - print(f' sink {sink_id} speaker {speaker} at {percent} % volume') + print(f' sink {sink_id} speaker {speaker} at {percent} % volume', flush=True) needs_adjusting = True if needs_adjusting: check_output(['pactl', 'set-sink-input-volume', sink_id, '100%']) - print(f' adjusted sink {sink_id} to 100%') + print(f' adjusted sink {sink_id} to 100%', flush=True) needs_adjusting = False @@ -45,4 +45,4 @@ try: sleep(0.5) finally: - print('Shutdown') + print('Shutdown', flush=True)