nbfc icon indicating copy to clipboard operation
nbfc copied to clipboard

Add option to repeatedly output status information

Open 602p opened this issue 6 years ago • 3 comments

This patch introduces a -p option to the status verb of the cli tool that causes the status to be repeatedly output. The rate is configurable as an optional argument to the parameter (measured in seconds, supporting float values.)

The rationale behind this patch is that I like to have a display of the current (target) fan speed in my system bar, and the CPU overhead from repeated mono startup was a major contributor to load on an otherwise idle system. Keeping a copy of the cli tool running in the background avoids that. I use this as an i3blocks element by running nbfc status -p 1 -f 0 | awk '/Target/ { printf("%3d\n", $5); system("") }' with interval=persist.

If this is merged, we should be sure to update the CLI examples page on the Wiki.

602p avatar Feb 05 '19 01:02 602p

Looks like I made this PR against master instead of beta. Sorry about that. I changed it in the GitHub interface, but let me know if I should instead close and reopen one with this change rebased against beta.

602p avatar Feb 05 '19 01:02 602p

Thank you very much for your contribution! Sorry it took me so long to respond. I was quite busy in the last couple of months :/

Master is actually meant to be the public integration branch for this repository, so it was perfectly fine to base your patch on master.

I'm planning to create a REST API for the service to make it easier to access from other scripts/programs. This means the CLI tool will not be required to poll the service in the future. Therefore I'm not gonna merge this PR (sorry!), but I'm leaving it open so that it's easier to find for others which may find it useful.

hirschmann avatar Apr 14 '19 20:04 hirschmann

hey what about if you add a fan overcloking feature?

adolfo00000 avatar Jun 04 '19 00:06 adolfo00000