# How to use Conky inside KDE 4.x

## d2_racing

Hi everyone, I had a hard time to configure my Conky with the transparent feature inside KDE 4.3.5.

So, here is my little wiki : http://gentoo-quebec.org/wiki/index.php/Guide_Conky

I hope that someone will safe precious time reading this one.

Google translator is your friend  :Razz: 

This little howto will describe how to install a little tool called Conky that can monitor your Gentoo box in real time.

== Version  == :

First, just to get you the best chance to have a working Conky, it's recommended to use the version 1.8.0_rc2 or higher, because this version handle the transparency inside Kde,Gnome.

```

# nano -w /etc/portage/package.keywords

```

Add this line :

```

>=app-admin/conky-1.8.0_rc2 ~arch

```

Where arch can be x86 or amd64.

== USE flags ==

With Conky, you can enable some Use flags that may give you more monitoring stuff to play.

So you can add these :

```

# nano -w /etc/portage/package.use}}

```

```

app-admin/conky audacious hddtemp nvidia -ipv6

```

Of course, if you don't use audacious and you don't have an Nvidia, please don't enable it  :Razz: 

== Installation ==

I recommend that you install feh only for one reason, it's because it can be use to integrate your Conky applet directly inside your wallpaper.

```

# emerge app-admin/conky media-gfx/feh

```

I use feh because I use KDE4 and I enabled the transparency feature, so my Conky is pretty clean actually.

== Configuration ==

To have a pretty cool Conky, you need to actually code what you want.

=== Creation of the file .conkyrc ===

```

# touch .conkyrc

```

=== Configuration of the file .conkyrc ===

```

## Do not close Conky

total_run_times 0

## Display Conky outside of the console

out_to_consoleu no 

out_to_x yes

## To relaxe the flicking

double_buffer yes

## Enable temp memory

no_buffers yes 

text_buffer_size 256

## Refresh rate

update_interval 1

## Number of samples

cpu_avg_samples 4

net_avg_samples 2

## Position and size of the Conky 

alignment top_right

minimum_size 320 5 

maximum_width 320

## Position of the Conky from origin 0 0 

gap_x 5

gap_y 5

## Enable shadow

draw_shades yes 

## Enable outline

draw_outline no

## Enable shadow beside text

draw_borders no

## 

border_width 1

## 

border_inner_margin 4

## Enable Conky in background

background no

## Enable Conky to use its own window

own_window yes

## Type of window

own_window_type override 

## Enable  transparency

own_window_transparent yes 

own_window_class conky

## Enable nice police

use_xft yes

xftalpha .1

override_utf8_locale yes 

## 

use_spacer right

## Color

default_color 28529D

default_shade_color 000000

default_outline_color FFFFFF

color1 white 

color2 black

color3 white  

TEXT

${color1}${font :style=Bold:pixelsize=20}${time %H:%M:%S}${font}${color}

${color3}${time %A %d %B %Y}

${color1}${font URW Chancery L:style=Medium Italic:pixelsize=25} Ordinateur ${color2}${hr}${font}

${color3}$sysname ${color1}$kernel ${color1}$machine

${color3}${nodename}${color1} running since ${color3}$uptime

${color1}${font URW Chancery L:style=Medium Italic:pixelsize=25} Network ${color2}${hr}${font}

${color1}Lan :${alignr}${offset -25}${color3}${addr eth0}

${color1}Wan :${alignr}${offset -33}${color3}${texeci 3600 wget http://checkip.dyndns.org -O - -o /dev/null | cut -d : -f 2 | cut -d \< -f 1}

${color3}${downspeedgraph eth0 16,115 white black}${alignr}${offset -35}${upspeedgraph eth0 16,115 white black}

${color1}${downspeed eth0}ko/s ${totaldown eth0}${alignr}${offset -5}${upspeed eth0}ko/s ${totalup eth0}

${color1}${font URW Chancery L:style=Medium Italic:pixelsize=25} Process / processor ${color2}${hr}${font}

${color1}Frequency CPU: $freq_g Ghz

${color1}Utilization Core 1: ${cpu cpu1}% ${cpubar cpu1}

${color1}Utilization Core 2: ${cpu cpu2}% ${cpubar cpu2}

${color1}Utilization Core 3: ${cpu cpu3}% ${cpubar cpu3}

${color1}Utilization Core 4: ${cpu cpu4}% ${cpubar cpu4}

${font}${color1}${alignr}${offset -32}Total : ${color3}$process   ${color1}Currently running :${color3}$running_processes

${color1}RAM :${color3} $mem/$memmax - $memperc% ${tab 70}

${color3}${membar 7,120}

${color3}Swap :${color3} $swap/$swapmax - $swapperc% ${tab 70}

${color1}${swapbar 7,120}

${color1}${font URW Chancery L:style=Medium Italic:pixelsize=25}Disk ${color2}${hr}${font}

${color1} /boot : ${fs_used /boot} / ${fs_size /boot}${alignr}${fs_used_perc /boot}%

${color3}${fs_bar 7,120 /boot}

${color1} / : ${fs_used /} / ${fs_size /}${alignr}${fs_used_perc /}%

${color3}${fs_bar 7,120 /}

${color1} /mnt/win_c : ${fs_used /mnt/win_c} / ${fs_size /mnt/win_c}${alignr}${fs_used_perc /mnt/win_c}%

${color3}${fs_bar 7,120 /mnt/win_c}

${color1} /mnt/win_d : ${fs_used /mnt/win_d} / ${fs_size /mnt/win_d}${alignr}${fs_used_perc /mnt/win_d}%

${color3}${fs_bar 7,120 /mnt/win_d}

${color1} /mnt/win_e : ${fs_used /mnt/win_e} / ${fs_size /mnt/win_e}${alignr}${fs_used_perc /mnt/win_e}%

${color3}${fs_bar 7,120 /mnt/win_e}

${color1} /mnt/pont : ${fs_used /mnt/pont} / ${fs_size /mnt/pont}${alignr}${fs_used_perc /mnt/pont}%

${color3}${fs_bar 7,120 /mnt/pont}

```

== Creation of a nice script ==

<div style="margin-left: 20px; margin-top: 20px; margin-bottom: 20px;">

Now that everything is done, you can adapt the script and you can also run it as you want with this little script.

```

$ cd ~

$ touch conky.sh

$ chmod +x conky.sh

```

```

$ nano conky.sh

#! /bin/bash

conky -&

sleep 3

feh --bg-scale `grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --bytes=+11`

```

The feh command is use to merge the conky frame inside your wallpaper.

```

$ ./conky.sh

```

You can see my result here : http://www.gentoo-quebec.org/index/Config_Sylvain/Conky.png

== Autostart with KDE 4 ==

```

$ cd ~

$ cp conky.sh ~/.kde4/Autostart

$ rm ~/conky.sh

```

== More info ==

You can find the programmation guide here : http://conky.sourceforge.net/Last edited by d2_racing on Wed Mar 03, 2010 3:27 pm; edited 1 time in total

----------

## Sadako

Belongs in Documentation, Tips & Tricks, you silly little mod.

 :Razz:   :Razz:   :Razz: 

----------

## d2_racing

In fact  :Razz: 

----------

## nikaya

Nice work, d2_racing   :Smile: 

My notes:

Instead of media-gfx/feh it can also be used media-gfx/qiv. It is only in testing, but there is no problem of using it. The command is 

```
qiv --root `grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --bytes=+11`
```

The last code listing has the header "Fichier .conkyrc". I think it should be "Fichier .conky.sh".

----------

## d2_racing

I will try that solution too.

Thanks for the typo error  :Razz: 

----------

## Randy Andy

Thank you d2_racing,

for that really good Howto. Sadly it's language is french, and the google-translator is not really your friend for this case, cause it doesn't stop translating  the command line part, and so it confuses the user a lot of misinterpretations.

But i get it working much better then my one year old .conky config before.

My old config confused my desktop when i zoomed out to show all the virtual desktops. It scales all of the opened windows to small, and brake only the conky window into many parts, and scattered it over half of each of the virtual desktops windows.

i tried to do a snap-shot of it, to paste it, but that doesn't worked in this zoomed view, only when getting back to the desktop.

Thank God, now it's solved, and also the flickering when conky starts has gone, cause your delay trick, and to start conky from the kde autostart.

Really great work, thanks again!

Andy.

----------

## d2_racing

No problem, maybe I will translate it in English when I find the time  :Razz: 

----------

## Randy Andy

Thanks for this prospect,

that would be a great help for the community (if you find the time, sometime).

Regards, Andy.

----------

## d2_racing

Yeah, I will  :Razz: 

----------

## d2_racing

The English version is now added.

----------

## Randy Andy

Hi d2_racing.

I would like to say "that was very quick, and good job, and thanks a lot for your work",

but i can't find the English version, or a button to switch the language.

Can you post the link, please, or did you forget to make it reachable, or am i to stupid or blind?

Andy

----------

## d2_racing

It's directly inside this thread, actually the first post, because I cannot mix language on the wiki.

Sorry  :Razz: 

----------

## Randy Andy

Ahhh,

so i'm blind and stupid!   :Laughing: 

i don't read the thread again from the beginning, i just used my old bookmarked link,

to watch your wiki.

Thanks again for your engagement!

Andy.

----------

## d2_racing

No problem  :Razz: 

----------

## rahulthewall

I got inspired as well.

http://i.imgur.com/3Fx43.png

----------

## d2_racing

Nice, can you post your .conkyrc here  :Razz: 

----------

## rahulthewall

Here is the conkyrc file. 

Notes - Install conkyForecast from here: https://bugs.gentoo.org/255948

Download conkyColors and install the fonts that are bundled in: http://gnome-look.org/content/show.php/CONKY-colors?content=92328

EDIT: Installation instructions at http://rahulthewall.wordpress.com/2010/03/08/the-perfect-conky-setup/.

And here is the .conkyrc

```

# Use Xft?

use_xft yes

xftfont DejaVu Sans:size=8

xftalpha 0.8

text_buffer_size 2048

# Update interval in seconds

update_interval 1

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

# Set to zero to run forever.

total_run_times 0

# Create own window instead of using desktop (required in nautilus)

own_window yes

own_window_transparent yes

own_window_type override

own_window_class conky

own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

background no

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

double_buffer yes

# Minimum size of text area

minimum_size 180 0

#maximum_width 200

# Draw shades?

draw_shades no

# Draw outlines?

draw_outline no

# Draw borders around text

draw_borders no

# Stippled borders?

stippled_borders 0

# border margins

border_inner_margin 5

# border width

border_width 1

# Default colors and also border colors

default_color black

default_shade_color black

default_outline_color black

own_window_colour black

color1 black

# Text alignment, other possible values are commented

#alignment top_left

alignment top_right

#alignment bottom_left

#alignment bottom_right

# Gap between borders of screen and text

# same thing as passing -x at command line

gap_x 35

gap_y 35

# Subtract file system buffers from used memory?

no_buffers yes

# set to yes if you want all text to be in uppercase

uppercase no

# number of cpu samples to average

# set to 1 to disable averaging

cpu_avg_samples 2

# number of net samples to average

# set to 1 to disable averaging

net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT

override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.

use_spacer none

TEXT

${font :style=Bold}SYSTEM${font} ${hr 2}

${alignc 17}${font Arial Black:size=16}googly${font}

${alignc}fly, you fools

${voffset 2}${font StyleBats:size=16}i${font}   Kernel:  ${alignr}${kernel}

${font StyleBats:size=16}A${font}   CPU1: ${cpu cpu1}% ${alignr}${cpubar cpu1 8,60}

${font StyleBats:size=16}A${font}   CPU2: ${cpu cpu2}% ${alignr}${cpubar cpu2 8,60}

${font StyleBats:size=16}g${font}   RAM: $memperc% ${alignr}${membar 8,60}

${font StyleBats:size=16}j${font}   SWAP: $swapperc% ${alignr}${swapbar 8,60}

${font Webdings:size=16}~${font}  Battery: ${battery_percent BAT0}% ${alignr}${battery_bar 8,60 BAT0}

${font StyleBats:size=16}q${font}   Uptime: ${alignr}${uptime}

${font :style=Bold}HD${font} ${hr 2}

${voffset 4}${font Pie charts for maps:size=14}7${font}   ${voffset -5}Root:

${voffset 4}${fs_used /}/${fs_size /} ${alignr}${fs_bar 8,60 /}

${font Pie charts for maps:size=14}7${font}   ${voffset -5}Home:

${voffset 4}${fs_used /home}/${fs_size /home} ${alignr}${fs_bar 8,60 /home}

${font Pie charts for maps:size=14}7${font}   ${voffset -5}XP:

${voffset 4}${fs_used /mnt/XP}/${fs_size /mnt/XP} ${alignr}${fs_bar 8,60 /mnt/XP}

${font :style=Bold}WIRELESS${font} ${hr 2}

${voffset 4}${font PizzaDude Bullets:size=14}O${font}   Up: ${upspeed wlan0} ${alignr}${upspeedgraph wlan0 8,60 000000 000000}

${voffset 4}${font PizzaDude Bullets:size=14}U${font}   Down: ${downspeed wlan0} ${alignr}${downspeedgraph wlan0 8,60 000000 000000}

${voffset 4}${font PizzaDude Bullets:size=14}N${font}   Upload: ${alignr}${totalup wlan0}

${voffset 4}${font PizzaDude Bullets:size=14}T${font}   Download: ${alignr}${totaldown wlan0}

${voffset 4}${font PizzaDude Bullets:size=14}Z${font}   Signal: ${wireless_link_qual wlan0}% ${alignr}${wireless_link_bar 8,60 wlan0}

${voffset 4}${font PizzaDude Bullets:size=14}a${font}   Local Ip: ${alignr}${addr wlan0}

${font :style=Bold}MUSIC${font} ${hr 2}

${if_running mpd}

$mpd_smart

$mpd_album

$mpd_status $mpd_elapsed/$mpd_length

$endif

${font :style=Bold}PROCESSES${font} ${hr 2}

NAME $alignr PID    CPU

${top name 1} $alignr ${top pid 1} ${top cpu 1}

${top name 2} $alignr ${top pid 2} ${top cpu 2}

${top name 3} $alignr ${top pid 3} ${top cpu 3}

${top name 4} $alignr ${top pid 4} ${top cpu 4}

${top name 5} $alignr ${top pid 5} ${top cpu 5}

${top name 6} $alignr ${top pid 6} ${top cpu 6}

${font :style=Bold}WEATHER${font} ${hr 2}

Location: ${execi 3600 conkyForecast --location=SZXX0033 --datatype=CN}

Conditions: ${execi 3600 conkyForecast --location=SZXX0033 --datatype=CC}

${font ConkyWeather:size=36}${execi 3600 conkyForecast --location=SZXX0033 --datatype=WF}${font}

Temp: ${execi 3600 conkyForecast --location=SZXX0033 --datatype=HT}

Extended Forecast

${font ConkyWeather:size=36}${execi 3600 conkyForecast --startday=1 --endday=3 --location=SZXX0033 --datatype=WF}${font}

${execi 3600 conkyForecast --location=SZXX0033 --startday=1 --endday=3 --spaces=15 --datatype=HT}

${execi 3600 conkyForecast --location=SZXX0033 --startday=1 --endday=3 --spaces=5 --datatype=DW}

```

----------

## d2_racing

Thanks for the script.

----------

## Art Vandalay

 *d2_racing wrote:*   

> 
> 
> ```
> 
> $ nano conky.sh
> ...

 

i used this tutorial on my old computer and it worked flawlessly.

but on my new system i can't get feh to work properly....it is driving me mad.

i am using kde 4.4.3 and have my desktop wallpaper set to use images in desktop activity settings.

on my new system, when i run feh i get this:

```

$ feh --bg-scale `grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --bytes=+11`

feh WARNING: wallpaper=/usr/share/wallpapers/Ethais does not exist - skipping

feh WARNING: wallpaper=/usr/share/wallpapers/Ethais does not exist - skipping

feh WARNING: wallpaper=/usr/share/wallpapers/Ethais does not exist - skipping

feh WARNING: wallpaper=/usr/share/wallpapers/Code_Poets_Dream does not exist - skipping

feh WARNING: wallpaper=/usr/share/wallpapers/Code_Poets_Dream does not exist - skipping

feh WARNING: wallpaper=/usr/share/wallpapers/Ethais does not exist - skipping

feh WARNING: wallpaper=/usr/share/wallpapers/Code_Poets_Dream does not exist - skipping

feh WARNING: wallpaper=/usr/share/wallpapers/Code_Poets_Dream does not exist - skipping

feh WARNING: /usr/share/wallpapers/Air/ - Directory specified for image filename

feh ERROR: Couldn't load image in order to set bg

```

my feh version is as follows:

```

[ebuild   R   ] media-gfx/feh-1.4.3  USE="xinerama" 0 kB

```

has something changed with kde 4.4.3? I am sure it is something stupid i have overlooked!

----------

## Art Vandalay

hmmm i think it has something to do with my new kde set up having dual monitors now and using twinview...whereas on my old system i had one screen.

anyhow, passing a hardcoded image to feh i have since discovered that feh treats my 2 (1680x1050) screens as one big screen (ie 3360 x1050) as so the image is stretched horizontally.

i have tried using the --geometry switch without much success.....hmmm guess ill switch to superkaramba until things improve :(

----------

## devsk

can sensors (from 'sensors' output) be added to conky? Is there a howto for that?

----------

## Zizo

Hi, thanks for your help, but why do you use feh for a transparent conky? As far as I know in conky 1.8 you can set "own_window_argb_visual yes" for real transparency  :Smile: 

----------

## billium

See this post:

http://www.linuxquestions.org/questions/slackware-14/transparent-conky-no-longer-in-slackware-13-1-kde-4-4-3-a-811006/

.. works for me & is less complicated.

Billy

----------

## avieth

I've been trying desperately to make conky work well with plasma, but it's just not happening. Whenever I run conky with double buffer on, it seems to overlap plasma's background image with black. I thought maybe this script would help but it doesn't, the background just stays black. Any ideas? I'm running kde 4.5 from the kde overlay.

edit

Oh, forgot to set it to own_window.

Still though, there's a problem with plasma...

```

grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc
```

doesn't give an actual background image, it always produces:

```

wallpaper=/usr/share/wallpapers/Atra_Dot/

```

Even though I no longer use the Altra_Dot background. I suppose this is a plasma bug, right?

edit again

 :Laughing:  Woops. Rebooting the system fixed it.

----------

## while true

I am sorry for posting here, but I am trying to get all the help I can get.

As a newbie to Linux and newbier Gentoo I am having some troubles with my conky.

Please read about it here:

https://forums.gentoo.org/viewtopic-p-6548279.html#6548279

Thank you

----------

