Cpu Frequency Selector Ruby

Plasma 4 Extensions

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

1
Become a Fan
7.6

Description:
"sudo chmod +s /usr/bin/cpufreq-set" Requires KDE 4.2, cpufreq-utils and cpufreq modules. Multi-cpu support. Fits into plasma better. Change CPU governor and frequency. More compatible.

Note:
You can change the UI if you think the default popup ui is ugly.
Check out the examples, Just set the 4 required things (3 listwidgets and 1 label) in the Qt Designer GUI Builder, and set the applets minimum size to something (Required!)
Last changelog:

ported to ruby
remove last 3 zeros add Mhz to numbers

Changed interface entirely. Now a button that opens a window, the button displays current cpu speed in mhz, window allows slection of governor or cpu frequency.

Minor interface tweaks

Added Ghz, Made button smaller to fit better on panel, still not perfect in panel, but much better.

More interface changes, can now directly use the output of rbuic4 popupdialog.ui >> ../code/Ui_PopupDialog.rb without modifications
New better UI that scales properly and looks alright. I'm still learning qtdesigner sorry!

Added GPL About dialog - Note, this breaks my rbuic4 compiled file, it's missing a backslash somewhere.

Sorry for all the updates.. made smaller default size of popup dialog

Took me a long time but I figured out how.. Dialog pops up in a smart position now instead of in the corner, yay!

fixed signal on frequency select

Where do I start?
Lots of code cleanup and commenting
Fixed ui compiling by moving gpl about dialog to gpl.rb - requires qlabel called gpllabel
New GUI, looks suspiciously like the old one, but it's not
Code cleanup, lots of comments added
Button removed, now draw text directly to "Applet" - resizes text properly in panel, takes up enough space in panel, fixe all panel related bugs by doing this.
Fixed a potentially nasty core logic bug where if you had "1.65ghz" and "1.6ghz" it would show two but only 1.6ghz would work, or if you had 1.65 ghz only it wouldn't work at all - with a nice map

Just when you think I'm done.. I go and toss in multi-cpu support. Next maybe will be min/max frequencies to go with governor settings as sliders or something

Maintainance: (1) Keep open file pointers to system nodes
(2) X.XXGhz instead of X.XGhz
(3) Use dialog->isVisible to decide hide or not


Ratings & Comments

20 Comments

MartinKN

same here ... Ruby Plasmoid says "Dieses Objekt kann aus folgendem Grund nicht erstellt werden: Script-Initialisierung fehlgeschlagen" "Was nun tun sprach Zeus?" ... oder war es so ähnlich? Leider beschränken sich meine Ruby Kenntnisse aufs starten von Ruby Programmen ;-)

hipsterical

i tried both ruby and non-ruby version and both, to say it plain, suck like s#|t.. the ruby widget complains about being unable to start the ruby script engine, the non-ruby one whines for the lack of some package plasma-cpufreq that i can't find anywhere. so much for the excellent kpowersave and generally speaking kde3. looks like libkorundum is conflicting over /usr/lib/ruby/1.8/x86_64-linux/korundum4.so also present in libkde4-ruby1.8 4:4.5.90-0ubuntu1~maverick1~ppa2 . oh, i have kubuntu maverick 64.

nukru

hi! I use archlinux 64b when I try launch it, i have this error: lasmoidviewer ruby-cpufreq RubyAppletScript::Applet#init mainScript: /home/****/.kde4/share/apps/plasma/plasmoids/ruby-cpufreq/contents/code/main.rb RubyAppletScript::Applet#init instantiating: RubyCpufreq::Main /usr/share/apps/plasma_scriptengine_ruby/applet.rb:90:in `method_missing': undefined method `kindof?' for #<Qt::SizeF:0x000000014eed40 width=126,000000, height=26,000000> (NoMethodError) /usr/share/apps/plasma_scriptengine_ruby/applet.rb:90:in `resize' /home/****/.kde4/share/apps/plasma/plasmoids/ruby-cpufreq/contents/code/main.rb:132:in `init' /usr/share/apps/plasma_scriptengine_ruby/applet.rb:183:in `init' and in the plasmoid puts "Script initialization failed" thanks

Desdenova88

Same problem here, Arch Linux 64 bit, too.

gravy

Had the same error on kubuntu 11.04 Commenting out lines 132 and 206 on /.kde/share/apps/plasma/plasmoids/ruby-cpufreq/contents/code/main.rb fixed the issue.

DesireRebound

Thanks a lot, that solved my problem!!

pyra

Hi, i try to write my own plasmoid on ruby, bu i have a big bug with gc: Thread 1 (Thread 0x7f4f151b87a0 (LWP 4963)): [KCrash Handler] #5 0x0000000000000021 in ?? () #6 0x00007f4ef2da499e in ?? () from /usr/lib/libsmokeqtgui.so.3 #7 0x00007f4ef877e36e in smokeruby_free(void*) () from /usr/lib/libqtruby4shared.so.2 #8 0x00007f4ef8e95ed3 in ?? () from /usr/lib/libruby1.8.so.1.8 #9 0x00007f4ef8e95efe in ?? () from /usr/lib/libruby1.8.so.1.8 #10 0x00007f4ef8e95f62 in rb_gc_finalize_deferred () from /usr/lib/libruby1.8.so.1.8 #11 0x00007f4ef8e855d0 in rb_thread_schedule () from /usr/lib/libruby1.8.so.1.8 Does anyone here know what is it? And how i can come over this bug in my plasmoid? This happens while disposing graphics widgets. I really cry :( Sorry for my english.

Gatsu84

Maybe i have found a bug, but i have to do some other tests. On Kubuntu Intrepid (amd64) the plasmoid works fine, but cause a memory leak, plasma process increase the usage of ram without stopping. I' ve tried to reinstall the plasmoid but nothing change. It' s strange, because i use this plasmoid from the first release, and all the previous version works without this problem... Someone else can confirm this bug?

speed47

Wow, yes, indeed, this plasmoid is causing a major plasma memory leak. Confirmed under KDE 4.2.0 and KDE 4.2.1. The process could hit 1 Gb of used RAM after less than 24 hours of uptime, and never stops eating more RAM until killed by the kernel OOM_Killer.

0xDeadC0de

It's ruby, so there isn't _much_ I can do about a leak, but anyway, there has been yet another port of this plasmoid to C++ (I know - first python, then ruby, and now C++.) You can find it in playground on kde's svn server, unless they've since moved it. In C++ I have explicit control over the memory, and there are no problems like this.

trickykid

Install from net fails. plasmapkg -i 92573-cpufreq.plasmoid gives me: Error: "/var/tmp/kdecache-tommy" is owned by uid 1000 instead of uid 0. Error: "/tmp/kde-tommy" is owned by uid 1000 instead of uid 0.

0xDeadC0de

This is very odd, you sure you're not running it as sudo? It shouldn't be installed by root.

0xDeadC0de

***************************** Warning! I've had reports of this plasmoid package failing to install in KDE 4.2 from get hot new stuff (right click on desktop, add widget, Install new widgets, from internet). If you are one of these cases, please remove the failed installed version, then download the package, then use in a console: plasmapkg -i xxxx-cpufreq.plasmoid And it should work. Thank you. ******************************

0xDeadC0de

I upgraded to 4.2b2 myself, found out it doesn't actually fail, just says it did. All is fine. Make sure to upgrade to the latest version for all the bugfixes, especially that one giant core bug that made it not work when people selected certain speeds. If it's a button - it's an old version. Download from here, or GHNS whenever it syncs.

0xDeadC0de

Not entirely true, Updates do seem to fail. Fresh installs seem alright. To update: in a console type: cd /tmp/kde-YOURUSERNAME plasmapkg -r 92573-cpufreq.plasmoid plasmapkg -i 92573-cpufreq.plasmoid

0xDeadC0de

I don't know what I changed but after uninstalling and reinstalling some packages, all of a sudden the script was erroring saying "mainscript" not found (after installing the plasmoid you can debug it from the command line with plasmoidviewer ruby-cpufreq), I made a couple softlinks and added them to the new release, they solve it for me. If you do have problems, I and many others would appreciate it if you run it in plasmoidviewer and copy/paste the errors here. I will get around to fixing it.

palacio

A recent change in kdebase broke the ruby plasmoids. You can fix it by reverting the ruby scriptengine package.

0xDeadC0de

The dependencies should all be listed, the Ruby bindings should all be in the 4.1x tree, the python stuff however is a kde backport to 4.1x tree so it wasn't always there. Doesn't mean every distro included ruby bindings when 4.1x was released, bindings are optional. Ubuntu supports the python version out of the box, but the python version was buggy for me, buggy bindings. The exact same code in ruby had no bugs with positioning and sometimes not starting after login/logout. (k)Ubuntu version needs the ruby bindings for kde4.1 in place (Listed in the description) Also, you need to enable the cpu frequency scaling modules with the kernel (It's easy for those who may be scared), hint: /etc/modules and cpufreq

gravy

It keeps saying that the package ruby-cpufreq could not be opened. Am I missing any dependencies? (I installed all dependencies you mentioned!) Couldn't find any information about this "package".

jwistead

I get the same problem. Did you have any luck getting the Python version of Cpu Frequency Selector to work? (it works for me... maybe better luck there?)

Pling
0 Affiliates
Details
license
version 2.4
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 1

More Plasma 4 Extensions from 0xDeadC0de:

Cpu Frequency Selector
0xDeadC0de
last update date: 15 years ago

Score 7.3

Other Plasma 4 Extensions:

Icon Tasks deb build
N00bun2
last update date: 13 years ago

Score 4.3

Prayer Times Plasmoid
riyad
last update date: 13 years ago

Score 5.2

KPrayertime4 Islamic Prayer Times
ahaq
last update date: 15 years ago

Score 4.4

Hostinfo
mgraesslin
last update date: 13 years ago

Score 4.7

Monitor QuadCore Russian
kuchumovn
last update date: 16 years ago

Score 5.0

blaKjaK
werevire
last update date: 15 years ago

Score 5.0