Transparent Conky in KDE, part 2
I posted earlier about getting Conky to be transparent in KDE. Unsetting and resetting the “Show icons on desktop” and “Allow programs in desktop window” options would allow Conky to look correct when transparent. Otherwise it would be a black box.
This is OK but it's a hassle to do this every time I restart KDE. Via various posts on the Gentoo forums I finally realized WHY this works (I think). Conky's pseudo-transparency works by reading the root window, and then compositing itself onto that. The root window is apparently not what normally shows in KDE when you're looking at your desktop background. KDE apparently draws another window on top of the root window and displays the desktop window there (including your background wallpaper and icons). Underneath that is the REAL root window, and it's entirely blank by default. Conky sees that real root window and composites itself on top, resulting in blackness.
When you tell KDE not to "Show icons on desktop", apparently KDE then defaults to setting the background of the REAL root window. So switching this option on and off results in the real root window's appearance matching KDE's "fake" root window.
Interestingly, in KDE if you do this:
- Set "Show icons on desktop" to true.
- Set a background.
- Set "Show icons on desktop" to false, then back to true.
- Change your background.
- Start a transparent Conky.
Conky will be properly transparent, but it will use the FIRST background you selected, not the second. This leads me to believe I'm right.
So the real way to get a nice transparent Conky in KDE is to set the background of the root window using a program like feh.
ppurka posted in this thread a great automated way to do this in KDE:
feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`
If you're like me and use centered wallpaper, use --bg-center instead. Incidentally this is the relevant section of my Conky config file:
own_window yes own_window_type desktop own_window_transparent yes own_window_hints undecorated,below,sticky,skip_taskbar,skip_page

First, I start conky without config file, and it was working good - icons were on my desktop and it has transparent window.
So, I had been adding lines from config, which I know it made icons hide and when I added ‘double_buffer yes’, icons disappeared.
Unfortunately - without double buffering conky blinks on my desktop, what looks awful…
Ok - I set own_window like you, wallpaper using feh and double buffering on. Now everything is OK :) THX
Brilliant! I had some trouble seemingly due to the fact that my wallpaper had a space in the filename, but I changed it, reset the default wallpaper, ran feh, and all is well. You have no idea how long I was looking for this solution.
Glad it could be of help.
Genius, you are simply genius!
hehe
Just to thanks your contribution.
It works in opensuse 10.2 + kde3.5.5 + beryl 0.1.4
To make it works at start, just make a script in your $HOME/.kde/Autostart
Thx
i found an easiest way to have conky transparent without installing / using feh on KDE :
OLDWALLPAPER=`dcop kdesktop KBackgroundIface currentWallpaper 1`
killall conky
sleep 10 && conky -d
dcop kdesktop KBackgroundIface setBackgroundEnabled false
sleep 1 && dcop kdesktop KBackgroundIface setBackgroundEnabled true
dcop kdesktop KBackgroundIface setWallpaper “$OLDWALLPAPER” 7
Looks similar to what I was doing by hand before I started with feh. That’s a good idea.
Sorry to throw a spanner in the works… is there a hack for those using the ‘gradient’ desktop background feature i.e. wallpaper set to ‘none’?
For what it’s worth, appending this line to the bottom of .conkyrc works as well as autostarting feh; but since it only executes when conky launches, I think it’s a little more graceful.
${exec feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`}Yes, I’m slightly obsessive at times. =)
Ed Daniel: I would guess you could theoretically accomplish the same task by using Esetroot or gsetroot or some other ?setroot utility capable of setting gradients.
Thanks for the solution, conky drove me nuts trying to get it properly transparent.
Thanks Brian and calraith. I ended up using feh from within conky with a direct link to the wallpaper since the dcop command wasn’t working properly.
NOTE with Beryl/Compiz:
If you’re going to put the command in your .conkyrc file use $texeci instead of $exec. Personally for me on kdemod + compiz-fusion it caused some lag when using the compiz-fusion toys. Something like this
${texeci feh –bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`}
Actually scratch last post. my bad.
:)
Even if I use feh and my conky gets transparent, after I click anywhere on the screen, conky diseappears.
But I can still find it in ps -auxe =(
Ok it seems I’ve solved my problem. I have to change: own_window_type desktop
to
own_window_type normal
for the beryl+emerald+kde users:
own_window yes
own_window_transparent yes
own_window_hints desktop,undecorated,below,sticky,skip_taskbar,skip_pager
own_window_type override
and use the feh recipe. now they stick to the fake KDE root background and don’t drag either.
oh my god thank you my saviour i finally can get some sleep!!! this was nagging me ever since i discovered conky, thanks a lot once again
Woks for me, thank you very much :)
Works for me, thank you very much :)
I googled upon this site, I use gnome, with the default conkyrc it didn’t display icons on the desktop. This line: own_window_type desktop seemed to fix the icon issue.
This works for me, but after I instantiate the transparent conky, if I click on the desktop, conky disappears.
How can I fix this?
I use your “feh –bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`” for my conky for a long time but now with Kde4 it is not working and I know why…
dcop in kde4 is replaced by d-bus and I don’t know how replaced dcop by d-bus.
Can you help me?