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:

  1. Set "Show icons on desktop" to true.
  2. Set a background.
  3. Set "Show icons on desktop" to false, then back to true.
  4. Change your background.
  5. 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_pager

41 Comments

http://gravatar.com/avatar/251eedee3a590dac25b7cbf83d2bdb8f.jpg?d=identicon
Reinmar says:

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...

Sep 09, 2006 02:54 PM PDT
http://gravatar.com/avatar/251eedee3a590dac25b7cbf83d2bdb8f.jpg?d=identicon
Reinmar says:

Ok - I set own_window like you, wallpaper using feh and double buffering on. Now everything is OK :) THX

Sep 09, 2006 03:21 PM PDT
http://gravatar.com/avatar/40f16fbbf1abc1b49bda1098e74f06c5.jpg?d=identicon
Logan says:

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.

Feb 08, 2007 02:56 AM PST
http://gravatar.com/avatar/4d84ec3981443dfd9c287e845b60d2ce.jpg?d=identicon
Brian says:

Glad it could be of help.

Feb 09, 2007 09:17 AM PST
http://gravatar.com/avatar/6ec66e124fb93c190e9207b0b82f542a.jpg?d=identicon
Dmitriy says:

Genius, you are simply genius! hehe

Mar 06, 2007 06:04 PM PST
http://gravatar.com/avatar/558c5dbba2b1ab9dbea4015f09f4ec24.jpg?d=identicon
demon says:

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

Mar 19, 2007 06:29 AM PST
http://gravatar.com/avatar/dc20cecd5f38ec622ee76b84dc24c542.jpg?d=identicon
Ewilly says:

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

May 23, 2007 05:52 AM PDT
http://gravatar.com/avatar/4d84ec3981443dfd9c287e845b60d2ce.jpg?d=identicon
Brian says:

Looks similar to what I was doing by hand before I started with feh. That's a good idea.

May 27, 2007 09:49 PM PDT
http://gravatar.com/avatar/899bbf36de867f9f217ed0dd50e15d15.jpg?d=identicon
Ed Daniel says:

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'?

May 29, 2007 06:49 AM PDT
http://gravatar.com/avatar/f20d68e72a7c57f1487f02bfea7c1d25.jpg?d=identicon
calraith says:

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.

May 31, 2007 11:22 PM PDT
http://gravatar.com/avatar/383663da28aa94e0c923dd7c6295759b.jpg?d=identicon
Zach says:

Thanks for the solution, conky drove me nuts trying to get it properly transparent.

Jun 13, 2007 03:56 PM PDT
http://gravatar.com/avatar/958fa2c39745547bac6eebc50f355a25.jpg?d=identicon
dragon_788 says:

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.

Jun 21, 2007 04:30 PM PDT
http://gravatar.com/avatar/8f65de234fe9459286b048bc0f71e761.jpg?d=identicon
Anonymous Cow says:

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}

Jun 29, 2007 10:27 PM PDT
http://gravatar.com/avatar/8f65de234fe9459286b048bc0f71e761.jpg?d=identicon
Anonymous Cow says:

Actually scratch last post. my bad.

Jun 29, 2007 10:47 PM PDT
http://gravatar.com/avatar/4d84ec3981443dfd9c287e845b60d2ce.jpg?d=identicon
Brian says:

:)

Jul 01, 2007 12:00 PM PDT
http://gravatar.com/avatar/b6558f042f0ad185a643d7eca76aa6de.jpg?d=identicon
TommyHot says:

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 =(

Jul 13, 2007 05:59 AM PDT
http://gravatar.com/avatar/b6558f042f0ad185a643d7eca76aa6de.jpg?d=identicon
TommyHot says:

Ok it seems I've solved my problem. I have to change: own_window_type desktop

to

own_window_type normal

Jul 13, 2007 06:03 AM PDT
http://gravatar.com/avatar/f976a2435d5fa85820c49bef1c25e5d8.jpg?d=identicon
circuit_breaker says:

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.

Jul 22, 2007 04:00 PM PDT
http://gravatar.com/avatar/1ea97e6d6a9dc09f8893d114cbe30d7c.jpg?d=identicon
sammael says:

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

Sep 25, 2007 09:38 PM PDT
http://gravatar.com/avatar/9fef9e6e0d0865f6522ad29a0d9946b4.jpg?d=identicon
jirka says:

Woks for me, thank you very much :)

Oct 26, 2007 02:14 PM PDT
http://gravatar.com/avatar/9fef9e6e0d0865f6522ad29a0d9946b4.jpg?d=identicon
jirka says:

Works for me, thank you very much :)

Oct 26, 2007 02:17 PM PDT
http://gravatar.com/avatar/493075dce10d325a04e6d96aa110a991.jpg?d=identicon
Al says:

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.

Nov 03, 2007 08:36 AM PST
http://gravatar.com/avatar/a1046f41693478dbbf83920bac737021.jpg?d=identicon
nrwilk says:

This works for me, but after I instantiate the transparent conky, if I click on the desktop, conky disappears.

How can I fix this?

Dec 10, 2007 04:08 PM PST
http://gravatar.com/avatar/361051bffa217b446e21cae9a777f5d0.jpg?d=identicon
chepioq says:

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?

Apr 06, 2008 08:40 AM PST
http://gravatar.com/avatar/361051bffa217b446e21cae9a777f5d0.jpg?d=identicon
chepioq says:

You know (or not...) but with kde 4 ?feh --bg-scale dcop kdesktop KBackgroundIface currentWallpaper 1? don't work because dcop is replaced by dbus. And with dbus I don't know how replace this command. But I find an other way.

1) Install feh

2) Create a script in /home/~/.kde4/Autostart with:

!/bin/bash

eval cat $HOME/.fehbg conky -c .conkyrc/.conkyrc1 &

adapt path of your conkyrc (mine is conkyrc1 because I have a conkyrc for gnome) and give it executable

3)Add in your .conkyrc file just under "TEXT":

${execi 100 feh --bg-scale "grep 'wallpaper=' ~/.kde4/share/config/plasma-appletsrc | tail --bytes=+11"}

Adapt the path of your plasma-appletsrc (in Ubuntu there is in .kde4, but with fedora in .kde...) I use execi 100 because when I change wallpaper, the name of new wallpaper appear after 1 minute in ~/.kde4/share/config/plasma-appletsrc ( I don't know why...)

And that work for me with Fedora9 and for other with Ubuntu. If anybody know how use feh with dbus in kde4...

Jul 21, 2008 11:13 AM PDT
http://gravatar.com/avatar/361051bffa217b446e21cae9a777f5d0.jpg?d=identicon
chepioq says:

Have you seen my reply #25 in "http://briancarper.net/2006/08/25/transparent-conky-in-kde-part-2/"?

Jul 28, 2008 08:20 AM PDT
http://gravatar.com/avatar/4d84ec3981443dfd9c287e845b60d2ce.jpg?d=identicon
Brian says:

Sorry, I forgot to respond. I'm going to have to try this now that I put KDE4 on my laptop. Maybe there is a dbus equivalent command to set or get the background filename.

Jul 28, 2008 09:36 AM PDT
http://gravatar.com/avatar/361051bffa217b446e21cae9a777f5d0.jpg?d=identicon
chepioq says:

I don't know if there are and equivalent command but I search with qdbusviewer and I don't find an entry for wallpaper...

Jul 28, 2008 09:46 AM PDT
http://gravatar.com/avatar/361051bffa217b446e21cae9a777f5d0.jpg?d=identicon
chepioq says:

You know that I am not able to use dbus, but I have solution with inotify (this package is in fedora and I think it is also in ubuntu... In resume I delete the "${execi 60 feh --bg-scale "grep 'wallpaper=' ~/.kde/share/config/plasma-appletsrc | tail --bytes=+11"}" line in my conkyrc and I change the script in my /home/dominique/.kde/Autostart like this: Code:

!/bin/bash

feh --bg-scale "grep 'wallpaper=' ~/.kde/share/config/plasma-appletsrc | tail --bytes=+11" conky -c .conkyrc/.conkyrc1 & while inotifywait /home/dominique/.kde/share/config/plasma-appletsrc; do feh --bg-scale "grep 'wallpaper=' ~/.kde/share/config/plasma-appletsrc | tail --bytes=+11" done

And that work for me... (with 30 seconds of latency when I change wallpaper)

Aug 03, 2008 06:08 AM PDT
http://gravatar.com/avatar/264a289f5eb8af236a42c7431fae684e.jpg?d=identicon
rsff says:

yeah the trick from post 18 worked for me too

thanks

Sep 21, 2008 05:33 PM PDT
http://gravatar.com/avatar/1b7bf5f52c5efd7fce1cb238b5189d8b.jpg?d=identicon
George says:

Worked fine for me. Had to change 'own_window_type normal' though. Thanks - Been annoying me for a long time :-)

Oct 08, 2008 03:16 PM PDT
http://gravatar.com/avatar/326a115d6573b17f185dae6f70f87e74.jpg?d=identicon
Pablo says:

Arrgh! this doesn't work with kde4 in a multimonitor setup.

I suspect it is both because "grep ?wallpaper=' ~/.kde/share/config/plasma-appletsrc" returns multiple lines, (one for each screen's wallpaper.)

Also, is feh even multi-monitor capable?

Oct 26, 2008 04:49 PM PST
http://gravatar.com/avatar/9f7d1541b204ea8a5827b43ad97ef23c.jpg?d=identicon
Vaulter says:

That's real transcendental! I think, this also will be work as cron task, as i have slideshow. But, if conky be real transparent, with rendering against program background too :)

Jan 17, 2009 10:29 AM PST
http://gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e.jpg?d=identicon
anonymouse says:

no, no no .. there is no need to hack the desktop app and mess around with feh like this. The below instructions are for kde4 with desktop effects; in kde3 the process is a bit different but I'm sure it supports all the same per-window effects.

In kde4, run conky normally (as a window), then right-click its menu title and from "Advanced" select:

  • To all desktops
  • Keep below others (or above, if you can find a nice place for it!)
  • Adjust opacity
  • No border

You'll then have to press Alt+F3 to get the menu back, and in "Special window settings" you will probably want "Accept focus" disabled. There are heaps of other options in this area, so keep experimenting.

Then save conky to your KDE session, and you're done! Much better than hacking the desktop, right?

May 08, 2009 07:18 PM PDT
http://gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e.jpg?d=identicon
anonymouse says:

I should add: once you've disabled the menu and focus, to tune the conky window's behaviour you'll have to go into system settings -> window behavour -> window specific.

May 08, 2009 07:29 PM PDT
http://gravatar.com/avatar/8b4e96d5b811e27260a499a6c0bee438.jpg?d=identicon
xoros says:

@anonymouse...

Conky doesn't show as a normal window for me in KDE4

Is this part of my .conkyrc wrong?

This is the number of times Conky will update before quitting.

Set to zero to run forever.

total_run_times 0

own_window yes own_window_transparent no own_window_type override own_window_type desktop

own_window_type normal #use this if you want a nice shadow to appear around conky

If own_window is yes, these window manager hints may be used

own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

Use double buffering (reduces flicker, may not work for everyone)

double_buffer no

How do I set it so I can work with it like you say?

May 30, 2009 10:01 AM PDT
http://gravatar.com/avatar/1c2671359bd8afbba99f6b54f1604ce0.jpg?d=identicon
xoros says:

Can someone please post a pastebin link to a WORKING KDE4 .conkyrc so we can work with it like anonymouse is stating??

May 30, 2009 10:08 AM PDT
http://gravatar.com/avatar/1c2671359bd8afbba99f6b54f1604ce0.jpg?d=identicon
xoros says:

Sorry to bother again, but how do you "save conky to your KDE session" ?

I have it working in windowed mode with these settings:

own_window yes own_window_transparent no own_window_type normal double_buffer no

I have all the other window settings how I want. I just wish I knew how to "save it to my session" now. :(

May 30, 2009 10:27 AM PDT
http://gravatar.com/avatar/9efc314b65237d5d646e1b817372afc6.jpg?d=identicon
Victor says:

The command:

xsetroot -solid grey // use your desktop color here instead of "grey"

does all the job!

BTW: see your /usr/bin/startkde and look for xsetroot.

Jun 26, 2009 07:00 AM PDT
http://gravatar.com/avatar/cfab1ba8c67c7c838db98d666f02a132.jpg?d=identicon
Victor says:

NO NO NO !

It's even more easier !!!

simply put : "own_window no" and it will start working transparent in KDE (I use Slax and KDE3.5, also tested in Xfce/Fluxbox/e16).

cheers!

Jun 26, 2009 07:06 AM PDT
http://gravatar.com/avatar/560372ca14bbdcf11263d4d66157503e.jpg?d=iden
ticon
rusty_dragon says:

Thanks a lot for this post. I think better use zero instead of one in option of currentWallpaper. If you put 1 feh made only picture from first desktop as fake-root. Instead of this 0 is wallpaper of current desktop.
feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 0`
in .conkyrc
${exec feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 0`}
A last we have that conky set

Sep 25, 2009 08:14 AM PDT

Speak Your Mind

This says COWS.

Preview

Commenting Help

Email / Avatar

  • Supply your email address and your Gravatar will be used.
  • I will never email you and your address won't be published.

No HTML allowed!

All HTML is auto-escaped. Use Markdown. Examples:

  • *emphasis* = emphasis
  • **strong** = strong
  • [link](http://foo.bar) = <a href="http://foo.bar">link</a>
  • `code in backticks` = code in backticks
  •     code indented 4 spaces =
    code indented four spaces
  • > Angle-brace quoted text =
    Angle-brace quoted text