-
I've written a custom module that outputs my current audio output and its volume. It first prints the current status immediately on launch, then subscribes to updates using I have placed the custom module in my right section: "modules-right": [
// ...
"custom/audio-output",
// ...
], Then configured the custom module: "custom/audio-output": {
"format": "THIS IS A TEST!"
}, This works and shows the text. However, as soon as I try to use the Python module: "custom/audio-output": {
"exec": "~/bin/waybar_show_audio.py output",
"return-type": "json",
"format": "{text}"
}, The module disappears and shows nothing. I've tried launching Waybar with trace logging and I don't see any output regarding my custom module whatsoever. What am I doing wrong here? 😕 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Figured it out. Even though the output displayed correctly in the terminal, it was apparently being buffered when called from Waybar. The solution was to explicitly flush the output in Python: print("...", flush=True) |
Beta Was this translation helpful? Give feedback.
Figured it out. Even though the output displayed correctly in the terminal, it was apparently being buffered when called from Waybar. The solution was to explicitly flush the output in Python: