![]() Registered Member ![]()
|
The background: the "ondemand" cpu governor work perfectly on most situations BUT when I need to perform a demanding process for a long time. For example, doing a skype video conference with ondemand governor push the cpu temperature for my five years old laptop above 90 degrees while when using "powersave" governor (which scale down cpu frequency) do not pass 60 degrees.
Because kpowersave do not give any more the chance to control cpu governors, I'm now using a small scrip to call cpufreq-set and slow down both cores:
And that's the problem: I cannot find a way to use only one kdesu command so I need to enter my root password twice. Is there an easy alternative? Thanks!
RGB, proud to be a member of KDE forums since 2008-Nov.
And proud to be a kde user since 1.1.2 |
![]() Registered Member ![]()
|
There are many ways you could accomplish that, here are a few suggestions:
1. in this case, simply doing "kdesu cpufreq-set -c 0 -c 1 -g powersave" should probably work. 2. you could remove kdesu commands from the script (running just cpufreq-set) and run the script with kdesu (which means the whole script will run as root) 3. you can chain multiple commands with kdesu by (for example) invoking a shell to run them: kdesu "sh -c 'command1 ; command2'" These are not the only solutions, but any one of these should work, choose your poison.
Thinking Inside the Box
|
![]() Registered Member ![]()
|
Thanks for the hints! Funny fact is that I already tried option 2 without success (it gave me an error that was not possible to run the script, without any other hint... who knows what I did...), but now it is working, so problem solved!
About option 1, it seems cpufreq-set can only accept one parameter at a time: it displays an error that the parameter was sent twice and then do nothing. But anyway, everything is perfect now: I have a small auto-hide panel with two buttons, one to slow down the processor and the other to return to "normality". Thanks again!
RGB, proud to be a member of KDE forums since 2008-Nov.
And proud to be a kde user since 1.1.2 |
![]() Administrator ![]()
|
Yet another alternative is to use the -c option. Not sure if the command below works, but you get the idea:
This way you can also use && to run the second command only if the first one succeeded. (Well, I guess you could do that with the other methods as well... but anyway!)
Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.
10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]