After running KDE 4 for a while on my work machine I’ve decided to switch to KDE 4 on my MacBook Pro as well. I really like what they did with the newest version of KDE 4 and while I was a little hesitant because of the controversy concerning the 4.0, the latest 4.1 iteration is very promising. Yes, a lot of features are still of beta quality, I experience frequent Plasma crashes on logout for example, but the sum of its parts makes it a really worthwhile experience.
One of the best things is the fact that they integated compositing and desktop effects directly into the window manager, instead of requiring an installation of Compiz Fusion and Emerald do the trick. The introduction of Mac OS X and with it Quartz and Microsoft copying this faithfully by introducing the Desktop Window Manager in Windows Vista show that composited window management is the future.
With KDE 4 you can install all these handy plasmoids, but unfortunately a lot of them are not included in either kdebase-plasma or kdeplasma-addons from the repositories, but are available as source code.
I’ve tried to compile some of them over the past few weeks but never succeeded until yesterday. This post helped me getting started down the right path.
I own two laptops and KDE 4 doesn’t have a suitable power management utility for notebooks (i.e. suspend to RAM on closing of the lid or warn about low battery). PowerDevil, which is currently under review to be included in future versions of KDE, is something which fits the aforementioned job description perfectly.
To install PowerDevil, which consists of a daemon, widget and System Settings module (called “Power Management Services”), just follow the steps below:
1. Get the source from the KDE svn repository, or download the beta from KDELook.org:
svn co svn://anonsvn.kde.org/home/kde/tags/powerdevil/4.1
2. Change to the newly created “powerdevil” directory containing the source code and create a build directory, then move into that build directory:
cd powerdevil
mkdir build
cd build
3. Make sure you have “build-essential” installed from the repositories and install “cmake”:
sudo apt-get install build-essential cmake
4. Install the following development packages from the experimental repository. The Lenny backports might work as well, but for me it doesn’t somehow:
sudo apt-get -t experimental install cmake g++ libkonq5-dev libkonq5 libplasma-dev kdelibs5-dev kdebase-dev
4. Run cmake:
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ..
5. You might get an error regarding X11_Xscreensaver_LIB:
Cmake Error: X11_Xscreensaver_LIB (ADVANCED)
To get rid of this install “libxss-dev”:
sudo apt-get -t experimental install libxss-dev
6. Run make.
7. You might run into an error regarding the PowerDevil daemon. This might indicate that the KDE workspace development package is missing, installing it will likely resolve the error:
sudo apt-get -t experimental install kdebase-workspace-dev
8. Now run sudo make install and the Plasmoid should be installed. It might take a while to get registred by KDE and some users have reported that it doesn’t register at all (it’s beta software after all), but my laptop is now power managed by PowerDevil.
With the same setup I’ve also compiled the QuickAccess plasmoid available here, which I duly recommend installing.
And totally unrelated; I really need to change the visual theme of this weblog to something a bit more personal.
Update:
I’ve updated the SVN part of the guide since PowerDevil moved out of kdereview.

Hi, and thanks for providing this great guide for building powerdevil!
I just wanted to notify you that it is now in kdebase, but I’ve created a branch for those who want to build it in KDE 4.1. It’s located in tags/powerdevil/4.1, so you eventually want to change your svn link
Thanks again and cheers!
Dario
Thanks for the heads up and for creating PowerDevil!
I’ve updated the guid to reflect the new situation. Building from SVN source doesn’t work for me however.
Yep, trunk can’t be built as a separate app… the right svn address is this one:
svn://anonsvn.kde.org/home/kde/tags/powerdevil/4.1
In this branch I keep a 4.1-compatible copy
Thanks to you for providing such a guide, again
Ah that explains the error. The SVN link now points to the 4.1 copy.
I tried to compile and install it on Kubuntu 8.04. In fact configuring, compilation and installation process looked fine, no error message. However, neither starting a new session nor waiting nor executing kbuildsycoca4 made the plasmoid appear in the list
That’s curious. My guess is that the recipe for Kubuntu is a bit different, according to this comment I took from KDE-apps.org PowerDevil might be installed under the wrong prefix:
The problem is that
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ..in the guide above should already point to the right install location. I’ve read other reports of PowerDevil not appearing in the System Setting nor the widgetlist. But isn’t Kubuntu going to be upgraded soon and ship KDE 4.2? PowerDevil is part of kdebase in 4.2, so you might want to take that route.Hi,
i hat a chat with apachlogger last friday who told me, that a plasmoid does not exist with 4.1 (maybe just with kubuntu 8.04, i don’t know).
PowerDevil is installed, though only to access via systemsettings → advanced → Power Management. But you have to switch the service on first of all.
There are also minor differences when installing it. kdebase-workspace-dev is a i prerequisite and kdebase-dev has to be kdebase-dev-kde4 (i suppose with intrepid the first version is rather correct, didn’t test it with intrepid though).
Since KDE 4.2 is going to be released in Jan, i don’t think that a pre-version of it is going to be released with 8.10. It is possible that 4.2 will be offered in other way, by a ppa repo most likely. But Jaunty will surely have 4.2, when it is going to be released in April.
I know there is a plasmoid in the works which is more sophisticated and detailed. Right now my install of PowerDevil only has a battery monitor (another one from the standard battery plasmoid), so you might be right PowerDevil is currently only installing itself in System Settings without adding a plasmoid.
Not adding KDE 4.2. in the upcoming 8.10 release of Kubuntu makes sense, since 4.2 hasn’t reached an alpha state at the moment, I believe.