-
-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Force use of powersave or performance governors #476
Conversation
Awesome, always glad to hear this. I love it but I also have few remarks:
So in case flag was used and daemon is not running (--install) not run first, it would say something like: "Make sure auto-cpufreq --install is run first (running as daemon) before this flag can be used"
Could you please add "performance" and "powersave" in double quotes and "reset" in double quotes? Think it helps visually and is consistent with "--install_performance" flag description.
Thanks and looking forward to your reply |
Hi, thanks for your reply The option should be used as follows Also I think checking for the daemon running is a good idea. I'll update this PR as soon as I can with that change, as well as updating the flag description as far as the output of Thanks again. |
Yes, I was about to mention this as part of my original comment, let's update this section of README.
Awesome, looking forward to the change and take your time :)
Ack, well now that this PR is here I would love to hear from @niksingh710 what he meant by:
In particular:
In #312 I mentioned that it would be great if auto-cpufreq had indicator/gnome-extension type of thing in the future, so would love to hear what user had in mind exactly here. Adding another "state-verbose" flag might be too much, so we might as well just explain it as part of README ... |
I was saying that indicator one just because of some users who use window managers and some kind of bar to show status and all. E.g I use waybar so having a cli way to get the current state of autocpu-freq will be very easy to display there. |
Maybe I'll change |
Imo |
Let me know what you end up with, full fledged auto-cpufreq running in tray or gnome extension would be great, but this could be a great beginning as well. Might even be worthy mentioning/showcasing on Readme?
I have an even better proposal: |
In tray will be a better option as this will enable it for KDE or other DE those used system tray in their panel.
I do agree with |
I think tray should he handled in a separate PR to keep this one from having too much, but it's a good idea. I'll focus on the flag for now |
Sounds good! |
Ok new commits have been pushed. FIrst off, in commit 573452a, I added two functions for sending a message when a user tries to use Now in 08e5a2b, you can see I changed the Finally, the last commit is just the README update. I made it a little clearer and also added a dedicated section for overriding governors and hyperlinked to it. I'd love to hear your feedback. On another note, I'm willing to do another PR for the tray menu. Just know I've never done that before, so it will be a learning experience, but I am down to do it. Sorry for the long message haha |
That that would be great!
No worries, I actually prefer when folks are more verbose in their PR's as it reduces chances of having any ambiguity. Especially since my reply won't be any shorter :D Everything works as expected now, but I do have few remarks. Observations no: 1: If I run
Because, it's already outputting state, and yet auto-cpufreq daemon hasn't even been installed yet. I also noticed, that although
Where it would also be good idea to return similar message, i.e:
So I think it would be a good idea to rename
Then this way, it could be use for both cases of Observation no 2: Could you still do this as I mentioned in my initial comment:
Could you please add "performance" and "powersave" in double quotes and "reset" in double quotes? Think it helps visually and is consistent with "--install_performance" flag description. Also let's add description of this flag you used here as part of Readme as well, as it's bit more descriptive here, then it is in Readme. Observation no 3: I just realized now, it would be good if overwrite state (output of
I think it would be a good idea to be like:
This way we could even hide Looking forward to hearing your thoughts on this. |
I'll update this PR once again when I've made the changes |
Alright, commits have been merged. Just a few quick comments
So I did make this the case for both
That should be all. Let me know what you think :) |
One final thing before I merge this with
After which if I do While overwriting governor with Because, same thing will happen with Sidenote, after these changes are removed, and I make sure it all works great as part of snap package as well I'll probably proceed to remove |
Oh my goodness I could've swore I put the quotes in the README 😂. I guess I only did it for the dedicated section.
This shouldn't be happening. The whole point of the |
I was unable to reproduce this. On my system, it works as intended. Using In the meantime, I have updated the README... hopefully for the final time lol |
Hey @tpongo-afk. This is actually already the case. The governor override will use your config file as well So if I do I'm not sure what the best way to do it is as I feel "battery" and "charger" are also a little confusing as to what the flag is supposed to do. Maybe it should just be up to the user to be able to use any of the available governors? Let me know what you think. |
Good, and what about:
Can you reproduce this? As this is more of a potential issue.
No worries, that's why we have these code reviews :)
I suggest to simply mention this as part of a Readme, using |
Hm I guess I was confused by what you meant initially. I believe I tested this when I initially submitted the PR but I will double check |
I am unable to reproduce it. I'd like to explain exactly what is happening on my system so there is no confusion. I am running my laptop off of battery, so the "powersave" governor is in use. \he override runs all the time, until |
@shadeyg56 it's all good, I just realized what the problem was and it was on my side. Regardless, merging changes with Regarding next release, if you create a new PR for the tray icon, let's aim for this to be the big v2.0 release, as I think that would be a big one. If you're about to do this, let's also add an icon for auto-cpufreq as part of i.e: In meantime, I'll request Ubuntu Snap team to approve the access to I'll also look if we can get rid of Again, thanks and I hope I'll see more PR's from you :) |
Awesome. Thanks for your correspondence. As far as the tray goes, I might open up a discussion or you can reach me on Discord at shadeyg56#2429 so we can discuss the details of the tray menu so I can know exactly what you have in mind :) |
I noticed a couple of people had requested this and I wanted the feature myself, so I took the initiative. I threw this together, but I tested it well and it works flawlessly so far.
This adds two new options.
--force TEXT
allows the user to force a governor into use until the user disables it.For example, if I do
sudo auto-cpufreq --force=powersave
this will force the use of the powersave governor under any circumstance. If you plug in your laptop it will still use powersave mode, and changing the config file will not do anything. This will even persist after a reboot because it's stored to disk.Using
sudo auto-cpufreq --force=reset
will reset the override and return to using the config file or default governorsthe
--state
options returns the status of the override. if there's no override it simply returnsdefault
Hopefully, this is a welcome change. You're welcome to change any of the help messages or updates I made to the README as I made them on the fly and didn't put a ton of thought into the wording.