Waybar does not show custom command outputs
Hello.
This is maybe not a bug but rather something wrong with my script or configuration, however even after several hours I cannot figure out what is wrong. I have a script that should ping some servers and display that in the bar.
The script outputs in 5sec interval something like this:
{"text": "VPS: 41.0ms", "tooltip": "nothing", "class": "custom-normal", "alt": "nothing", "percentage": 50}
Relevant configuration:
"modules-center": [ "custom/pinger-vps" ]
"custom/pinger-vps": {
"exec": "/data/home/suk/.config/sway/bar-ping/pinger.py vps my.vps.tld",
"return-type": "json"
},
Full version of config: https://gist.github.com/sukovec/be1c47d32dac49097c3fa0e82171e61e Full pinger.py script: https://gist.github.com/sukovec/a737766f4d17e8ace32413540f2ea14e Waybar output: https://gist.github.com/sukovec/7c5939ddb764a21499b3c21dafcaeeb2
Hello. If you haven´t found the solution yet, try to eliminate "-" in the name of the module. Rename it to something like "custom/pingervps". If I'm not wrong I had the same problem and that solved the issue.
Make sure you flush the output in the python script, otherwise it could buffer it for a long time..
try to add flush=True to your print