TamtamHero / fw-fanctrl

A simple systemd service to better control Framework Laptop's fan(s)
BSD 3-Clause "New" or "Revised" License
186 stars 35 forks source link

[FEATURE] `print` command option for current fan speed #74

Closed Speenah closed 3 weeks ago

Speenah commented 3 weeks ago

Is your feature request related to a problem? Please describe.

Currently there are only two supported options for the print command: list and current. At the moment I'm not using separate strategies for charging and discharging so, these two options aren't particularly relevant for me. What I am interested in printing is the current fan speed percentage and/or exact RPM.

Describe the solution you'd like

Additional supported arguments for the print command to monitor the current fan speed, such as:

$ fw-fanctrl print speed_percentage
23

and/or

$ fw-fanctrl print speed_rpm
672

No strong preferences on the naming of the arguments

Describe alternatives you've considered

I could get the current fan speed by extracting it from the log messages, but the current fan speed feels like it should be a valid option supported by the script

Additional context

My exact use case is to add a custom fan speed module to my waybar setup. Having a concise command able to print the value to display makes it much more simple to configure:

{
  "custom/fan-speed": {
    "exec": "fw-fanctrl print speed_percentage",
    "format": "{}%",
    "interval": 5
  }
}

Would you like to be involved in the development? Sure! Python is not my strong suit, though. I believe I could come up with an implementation that does work, but it might not be the "right" way to do it

leopoldhub commented 3 weeks ago

Hi,

Thanks for your feedback. Sure, I agree that it would be nice to have additional status information like this.

If you want to implement it, feel free to create a pull request for it. Don't worry about doing things the "right way" on the first try. We will talk about it and I will give you feedback so you can improve things step by step.

If you have any questions, feel free to ask them, I will do my best to answer them.

Have a nice day!