Laysan_A
December 19th, 2010, 11:55 AM
Hi,
I'm a fan of Gkrellm. I'm also a fan of KDE. Unfortunately, though Gkrellm and KDE get along very nicely in a general way, there are two issues with it that I needed fixed, and want to share with the community (so hopefully some one else won't have to spend hours scouring the internet). The first issue (which is really secondary to this post) has to do with support for sensor output in Gkrellm, and it applies to all Ubuntu derivatives. I will be very brief about this. The second issue, and the main reason for this post, is that KDE 4x doesn't support transparent themes in Gkrellm. The non-transparent themes in Gkrellm are nice, in their way, but the general taste in looks is moving toward the transparent look - esp. for utilities, like plasmoids, applets, and docks. Who doesn't like the look of a nice transparent widget? So, I'm going to share what I discovered about how to enable transparent themes on Gkrellm and KDE 4. AND ASK FOR HELP WITH A PROBLEM FURTHER DOWN THE PAGE. ;)
First, though, about the sensors. Libsensors is THE program for gathering sensor data for use in various applets. Some few (mostly older) sensors have their output sent to a system file, where it can be picked-up and used by the system, but the best way to get sensor data, especially for newer sensor chips, is directly from libsensor.
Since 2007 libsensor support has been built out of Gkrellm in Ubuntu (perhaps all of Debian, though I'm unclear on that). From some cursory research on the internet, I discovered that in 2007 libsensors did a major update, and Gkrellm did not. Problems insued. Support for libsensors was dropped in Gkrellm. Even though a patch was produced fairly quickly, support for libsensors in Gkrellm was never re-allowed. There is a bug on this here. (https://bugs.launchpad.net/ubuntu/+source/gkrellm/+bug/688944)
To enable support for libsensors in Gkrellm you have to build Gkrellm from source (EGADS!!) It's really pretty easy with this package and mine went off without a hitch (and I now have WONDERFUL readouts from my atk0110 sensors on my asus mb.). You can find the source package for Gkrellm here, (http://members.dslextreme.com/users/billw/gkrellm/gkrellm.html) and you can find some easy instructions for building it here. (https://help.ubuntu.com/community/CompilingEasyHowTo) Piece of cake (really!).
Okay, on to invisibility....
Gkrellm invisibility doesn't happen in KDE 4 (without a little tinkering...).
I discovered the fix by looking for insights in pages discussing the same problem in conky. I found a good one, and thinking the same situation might apply to gkrellm, I tried it and IT WORKED! Here's the original post. (http://everydaylht.com/howtos/eyecandy/conkykde-transparencymonitoring-remote-machines/) My gratitude to the author. I'm going to reproduce the process here for posterity's sake, and because the command has changed slightly with the location of the plasma-desktop-appletsrc file.
So, gkrellm uses fake transparency. It samples the desktop at its coordinates and reproduces the image as its background. Gkrellm doesn't use the user's desktop to sample from - it uses the root desktop image - hence the strange-looking colors I got whenever I tried one of the transparent themes.
Okay, so first you need to make your current desktop image your root desktop image. To do this you need to install "feh" (copy and paste these commands into terminal)
sudo apt-get install fehAfter that's done, enter this in terminal:
feh --bg-scale "`grep 'wallpaper=' ~/.kde/share/config/plasma-desktop-appletsrc | tail --bytes=+11`"Okay, now it needs to be set-up so that it'll load automatically. The feh documentation recommends setting this in ~/.xsessionrc (if you don't have one, make one with kate - and don't forget the dot before the name http://kubuntuforums.net/forums/Smileys/classic/wink.gif [ the expression ~/ is shorthand for your home directory path, /home/username, so the aforementioned path in full would be /home/username/.xsessionrc ]):
`cat $HOME/.fehbg`That done, we arrive at a problem. I could use some help here, if anyone has any idea how to fix it. It's not a deal-breaker, but it's definitely inconvenient if you like to change your wallpaper a lot.
The feh program creates a file called ~/.fehbg to store the actual path of the image used as 'wallpaper'. Unfortunately, it stores it like this:
feh --bg-scale '/home/laysan/Pictures/shadows_1280.jpg_cropped.png'The two single quotes enclosing the path are unfortunately read as part of the path, so when feh (or if it hands it off to bash or kde) looks for the image file it can't find it. http://kubuntuforums.net/forums/Smileys/classic/sad.gif You get a no such file error in feh. I created a bug report here. (https://bugs.launchpad.net/ubuntu/+source/feh/+bug/691845)
The only way I know of to fix it (I tried removing various sets of quotation marks from the original feh command to no avail) is to open the ~/.fehbg file in kate and remove the two single quotations, so it looks like this:
feh --bg-scale /home/laysan/Pictures/shadows_1280.jpg_cropped.pngBut you must still do one more thing. You must change the permissions on ~/.fehbg to root, or the image's path will be overwritten the next time it's opened (at next login), with the single quotes included. Doing so fixes the issue in the short term, but when you change desktop images you'll have to reinstate your user privileges on the file, and re-run the original command to allow the file to be written to by feh (with the new image path), then edit the file again to remove the single quotes. Then you'll have to reset the root permissions (kind of a pain, huh?)
I'm not very good with bash, so the easiest way for me to change permissions on a file or folder is to open dolphin as root, like this:
sudo dolphinThen just right-click on the file, select properties, permissions, and select and change appropriately. By the way, never use a rooted dolphin for general file management or poking around - close it as soon as you no longer need it (fair warning..http://kubuntuforums.net/forums/Smileys/classic/wink.gif )
So far, it has been set-up so that every login the current desktop image is set to X root's desktop. This is because the actual path to the current plasma desktop image is listed in .fehbg. When the desktop image changes, the X root desktop image will stay the same (and so the Gkrellm background) unless the original bash command is re-run to set the path for the new plasma desktop image in .fehbg.
For me, the best way to do this was to create a bash script, place it my home directory (where I wouldn't lose it), and make a menu shortcut for it, including assigning an icon (so I wouldn't forget what or where it was).
All that's required for this simple script is to open kate and paste this:
#!/bin/bash
exec feh --bg-scale "`grep 'wallpaper=' ~/.kde/share/config/plasma-desktop-appletsrc | tail --bytes=+11`"Then save it in your home dir. as whatever name you want, with a .sh extension. I called mine TransparentGkrellm.sh You can test that it works by dragging it into an open terminal. If your .fehbg file is still set to root, you'll get an error message that feh was unable to write to the .fehbg file. That means it worked as expected. To make TransparentGkrellm executable, you need to select it in dolphin, right-click and select properties, and tic make executable. Now you can click on it and it will run.
If I knew anything about scripting, I could automate the entire process of establishing the new root image and removing the single quotes from the .fehbg file, so the whole process would require a single click. Unfortunately, establishing the new image is all I get, for now. (Could use some help here! http://kubuntuforums.net/forums/Smileys/classic/wink.gif )
To put TransparentGkrellm in the menu, open the menu editor (right-click on the menu icon - or if you're using Lancelot, open the menu and click on the Lancelot icon in the upper right corner) and decide on a category. I put mine in settings. Select the category, then select new item. Type in the name, comment and description (make it descriptive enough that you will not forget what it does). In the command block place the full path and name (~/TransparentGkrellm.sh). If you click on the blank icon image you can choose a nifty icon for it. I chose one from the settings manager for setting the desktop image (appropriate...). Click to save the new settings and that's it!
Well...my two desktop images weren't quite aligned...the root image was set with bg-scale, which I assume is the same as the scale option in plasma. I had my plasma desktop set to scale (keep proportions), which ended-up being slightly different. I changed it to scale and voila, they matched (If for some reason your desktop doesn't look good in scale mode try "feh --help", or "man feh" in terminal for some options). Now the issues are fine-tuning the appearance. One thing I will say about that concerns the window type. In dock or panel mode (set in gkrellm) the window stays above normal windows (although you may be able to change that in special window settings - have to try and see). This is not desirable, even though it looks better right off the bat, because of the fake transparency. In normal window mode, even when "no borders" is selected in the window management dialogue, there is still a shadow under the window, making it stand out too much for my taste. This, too, may be addressable in special window settings. The important thing now is...it works, and without too much trouble.
Edit:
Okay, I got the results I wanted by setting the window type in gkrellm to be dock or panel, then selecting to force below other windows in special window settings in kde. Here's the final result. (http://img837.imageshack.us/img837/5738/desktoptransgkrellm2122.png) The theme is "invisible-jkx". I found it on some guy's site (Here it is (http://www.larsen-b.com/tags/gkrellm)). Anyway, except for the two invisible themes (black and white) from kde-look (which don't work for some reason), all the transparent themes work.
Also, for anyone not very familiar with gkrellm:
You can change the width of Gkrellm in the gkrellm configuration dialogue (right click in the little button that appears near the top) in General, Options.
You can change the height of any of the charts by right-clicking on the chart (mine are mostly at 15).
You can change the height of gkrellm (it'll vary considerably depending on the theme) by going to Themes, Options, Scale.
You can also globally change the fonts, also in Themes.
I'm a fan of Gkrellm. I'm also a fan of KDE. Unfortunately, though Gkrellm and KDE get along very nicely in a general way, there are two issues with it that I needed fixed, and want to share with the community (so hopefully some one else won't have to spend hours scouring the internet). The first issue (which is really secondary to this post) has to do with support for sensor output in Gkrellm, and it applies to all Ubuntu derivatives. I will be very brief about this. The second issue, and the main reason for this post, is that KDE 4x doesn't support transparent themes in Gkrellm. The non-transparent themes in Gkrellm are nice, in their way, but the general taste in looks is moving toward the transparent look - esp. for utilities, like plasmoids, applets, and docks. Who doesn't like the look of a nice transparent widget? So, I'm going to share what I discovered about how to enable transparent themes on Gkrellm and KDE 4. AND ASK FOR HELP WITH A PROBLEM FURTHER DOWN THE PAGE. ;)
First, though, about the sensors. Libsensors is THE program for gathering sensor data for use in various applets. Some few (mostly older) sensors have their output sent to a system file, where it can be picked-up and used by the system, but the best way to get sensor data, especially for newer sensor chips, is directly from libsensor.
Since 2007 libsensor support has been built out of Gkrellm in Ubuntu (perhaps all of Debian, though I'm unclear on that). From some cursory research on the internet, I discovered that in 2007 libsensors did a major update, and Gkrellm did not. Problems insued. Support for libsensors was dropped in Gkrellm. Even though a patch was produced fairly quickly, support for libsensors in Gkrellm was never re-allowed. There is a bug on this here. (https://bugs.launchpad.net/ubuntu/+source/gkrellm/+bug/688944)
To enable support for libsensors in Gkrellm you have to build Gkrellm from source (EGADS!!) It's really pretty easy with this package and mine went off without a hitch (and I now have WONDERFUL readouts from my atk0110 sensors on my asus mb.). You can find the source package for Gkrellm here, (http://members.dslextreme.com/users/billw/gkrellm/gkrellm.html) and you can find some easy instructions for building it here. (https://help.ubuntu.com/community/CompilingEasyHowTo) Piece of cake (really!).
Okay, on to invisibility....
Gkrellm invisibility doesn't happen in KDE 4 (without a little tinkering...).
I discovered the fix by looking for insights in pages discussing the same problem in conky. I found a good one, and thinking the same situation might apply to gkrellm, I tried it and IT WORKED! Here's the original post. (http://everydaylht.com/howtos/eyecandy/conkykde-transparencymonitoring-remote-machines/) My gratitude to the author. I'm going to reproduce the process here for posterity's sake, and because the command has changed slightly with the location of the plasma-desktop-appletsrc file.
So, gkrellm uses fake transparency. It samples the desktop at its coordinates and reproduces the image as its background. Gkrellm doesn't use the user's desktop to sample from - it uses the root desktop image - hence the strange-looking colors I got whenever I tried one of the transparent themes.
Okay, so first you need to make your current desktop image your root desktop image. To do this you need to install "feh" (copy and paste these commands into terminal)
sudo apt-get install fehAfter that's done, enter this in terminal:
feh --bg-scale "`grep 'wallpaper=' ~/.kde/share/config/plasma-desktop-appletsrc | tail --bytes=+11`"Okay, now it needs to be set-up so that it'll load automatically. The feh documentation recommends setting this in ~/.xsessionrc (if you don't have one, make one with kate - and don't forget the dot before the name http://kubuntuforums.net/forums/Smileys/classic/wink.gif [ the expression ~/ is shorthand for your home directory path, /home/username, so the aforementioned path in full would be /home/username/.xsessionrc ]):
`cat $HOME/.fehbg`That done, we arrive at a problem. I could use some help here, if anyone has any idea how to fix it. It's not a deal-breaker, but it's definitely inconvenient if you like to change your wallpaper a lot.
The feh program creates a file called ~/.fehbg to store the actual path of the image used as 'wallpaper'. Unfortunately, it stores it like this:
feh --bg-scale '/home/laysan/Pictures/shadows_1280.jpg_cropped.png'The two single quotes enclosing the path are unfortunately read as part of the path, so when feh (or if it hands it off to bash or kde) looks for the image file it can't find it. http://kubuntuforums.net/forums/Smileys/classic/sad.gif You get a no such file error in feh. I created a bug report here. (https://bugs.launchpad.net/ubuntu/+source/feh/+bug/691845)
The only way I know of to fix it (I tried removing various sets of quotation marks from the original feh command to no avail) is to open the ~/.fehbg file in kate and remove the two single quotations, so it looks like this:
feh --bg-scale /home/laysan/Pictures/shadows_1280.jpg_cropped.pngBut you must still do one more thing. You must change the permissions on ~/.fehbg to root, or the image's path will be overwritten the next time it's opened (at next login), with the single quotes included. Doing so fixes the issue in the short term, but when you change desktop images you'll have to reinstate your user privileges on the file, and re-run the original command to allow the file to be written to by feh (with the new image path), then edit the file again to remove the single quotes. Then you'll have to reset the root permissions (kind of a pain, huh?)
I'm not very good with bash, so the easiest way for me to change permissions on a file or folder is to open dolphin as root, like this:
sudo dolphinThen just right-click on the file, select properties, permissions, and select and change appropriately. By the way, never use a rooted dolphin for general file management or poking around - close it as soon as you no longer need it (fair warning..http://kubuntuforums.net/forums/Smileys/classic/wink.gif )
So far, it has been set-up so that every login the current desktop image is set to X root's desktop. This is because the actual path to the current plasma desktop image is listed in .fehbg. When the desktop image changes, the X root desktop image will stay the same (and so the Gkrellm background) unless the original bash command is re-run to set the path for the new plasma desktop image in .fehbg.
For me, the best way to do this was to create a bash script, place it my home directory (where I wouldn't lose it), and make a menu shortcut for it, including assigning an icon (so I wouldn't forget what or where it was).
All that's required for this simple script is to open kate and paste this:
#!/bin/bash
exec feh --bg-scale "`grep 'wallpaper=' ~/.kde/share/config/plasma-desktop-appletsrc | tail --bytes=+11`"Then save it in your home dir. as whatever name you want, with a .sh extension. I called mine TransparentGkrellm.sh You can test that it works by dragging it into an open terminal. If your .fehbg file is still set to root, you'll get an error message that feh was unable to write to the .fehbg file. That means it worked as expected. To make TransparentGkrellm executable, you need to select it in dolphin, right-click and select properties, and tic make executable. Now you can click on it and it will run.
If I knew anything about scripting, I could automate the entire process of establishing the new root image and removing the single quotes from the .fehbg file, so the whole process would require a single click. Unfortunately, establishing the new image is all I get, for now. (Could use some help here! http://kubuntuforums.net/forums/Smileys/classic/wink.gif )
To put TransparentGkrellm in the menu, open the menu editor (right-click on the menu icon - or if you're using Lancelot, open the menu and click on the Lancelot icon in the upper right corner) and decide on a category. I put mine in settings. Select the category, then select new item. Type in the name, comment and description (make it descriptive enough that you will not forget what it does). In the command block place the full path and name (~/TransparentGkrellm.sh). If you click on the blank icon image you can choose a nifty icon for it. I chose one from the settings manager for setting the desktop image (appropriate...). Click to save the new settings and that's it!
Well...my two desktop images weren't quite aligned...the root image was set with bg-scale, which I assume is the same as the scale option in plasma. I had my plasma desktop set to scale (keep proportions), which ended-up being slightly different. I changed it to scale and voila, they matched (If for some reason your desktop doesn't look good in scale mode try "feh --help", or "man feh" in terminal for some options). Now the issues are fine-tuning the appearance. One thing I will say about that concerns the window type. In dock or panel mode (set in gkrellm) the window stays above normal windows (although you may be able to change that in special window settings - have to try and see). This is not desirable, even though it looks better right off the bat, because of the fake transparency. In normal window mode, even when "no borders" is selected in the window management dialogue, there is still a shadow under the window, making it stand out too much for my taste. This, too, may be addressable in special window settings. The important thing now is...it works, and without too much trouble.
Edit:
Okay, I got the results I wanted by setting the window type in gkrellm to be dock or panel, then selecting to force below other windows in special window settings in kde. Here's the final result. (http://img837.imageshack.us/img837/5738/desktoptransgkrellm2122.png) The theme is "invisible-jkx". I found it on some guy's site (Here it is (http://www.larsen-b.com/tags/gkrellm)). Anyway, except for the two invisible themes (black and white) from kde-look (which don't work for some reason), all the transparent themes work.
Also, for anyone not very familiar with gkrellm:
You can change the width of Gkrellm in the gkrellm configuration dialogue (right click in the little button that appears near the top) in General, Options.
You can change the height of any of the charts by right-clicking on the chart (mine are mostly at 15).
You can change the height of gkrellm (it'll vary considerably depending on the theme) by going to Themes, Options, Scale.
You can also globally change the fonts, also in Themes.