Apologies if this issue already exists, I was unable to find it.
I would like to see increased standardization in the module's handling of "bad" state, and availability of a configurable format when in such state.
I use the same configuration on multiple machines with different hardware configurations and I would like to avoid maintaining multiple configuration files, to be loaded via scripting.
I currently use format_down on network interfaces to hide the text when the device doesn't exist or isn't plugged, but some modules do not provide (obvious?) ways to reproduce this behaviour.
Example: nvidia_smi; there is no format_down value, and my experience with partial name match using [\?name=NVIDIA*] for conditional string formatting didin't yield good results (it was a pain to get it working with lm_sensors for CPUs).
Am I approaching this the wrong way?
Could we see a feature that would simply hide sensor modules when the devices aren't present?
Am I approaching this the wrong way?
Imho, I think so. You want one config to rule them all. Others can want different goals such as a better way to manage configs between major versions, between drastic hardware, between major configs (aka profiles), etc.
I would like to avoid maintaining multiple configuration files
Sometimes things can't be helped. Try https://wiki.archlinux.org/index.php/Dotfiles. Otherwise, everybody would ought to support this magic feature of one config, multiple machines too... on their said software... as well as any other magic features too.
Example: nvidia_smi; there is no format_down value, and my experience with partial name match using [\?name=NVIDIA*] for conditional string formatting didin't yield good results (it was a pain to get it working with lm_sensors for CPUs).
There is always room for improvement. With nvidia_smi, we can try nvidia version first at startup. If it came back bad, skip the module. :wink: I haz nothing but dotfiles for your lm_sensors issue.
A simple version check in Nvidia_smi would work for me. As for the lm_sensor issue, it's already working :)
hi @XenHat I'm usure of what's expected in this issue?
@ultrabug I would like the ability (by default or otherwise configurable) to hide the nvidia_smi plugin output when there is no NVIDIA hardware present on the machine.
Network plugins achieve this behaviour through format_down = "", I would like to see something similar for nvidia_smi, and other plugins who don't offer a "null" output when the data is "not good". Perhaps as a global option, like color_* do?
Hopefully that made more sense.
@ultrabug ?
@XenHat with upcoming py3status 3.31 you will be able to do so by using the new on_error feature : https://py3status.readthedocs.io/en/latest/configuration.html#controlling-error-behavior
This got buried in my email pile. That is good. Thank you. 馃憤
Most helpful comment
@XenHat with upcoming py3status 3.31 you will be able to do so by using the new
on_errorfeature : https://py3status.readthedocs.io/en/latest/configuration.html#controlling-error-behavior