Conquer Conky the easy way

Last night I managed to kill my system trying to compile from source Conky. The configure command detected the luck of some libraries and I decided to compulsively use zypper to install them.

I updated xorg’s x11 libraries and installed libxi6’s rendering my system useless. So please do not go that way unless you know what you are doing.

To get conky working you just need to get the rpm provided in the openSUSE repos. You can get it here searching for “conky” without quotes. Please choose the latest version available (1.8.0-31.1 as for 05/29/2010)

Once installed you will need to get a config file. Normally conky looks for a file called .conkyrc under your personal folder. You can create an initial conky configuration file with the following command.

conky -C > ~/.conkyrc

Please do not use that command if you allready have a .conkyrc file under your personal folder since it will be overwritten

By now conky should be working and the standard configutarion file created. All we have to do is modify it so we can make it look as readable and beautiful as possible.

If you have Compiz enabled transparency will not work for most people with the standard conky configuration. But conky has a workarround for this. Edit the .conkyrc file and include this


own_window yes
own_window_transparent no
own_window_colour 000000 #optional
own_window_type normal
own_window_argb_visual #this is the magic line
own_window_argb_value 90 #this is for opacity (0 transparent, 255 opaque)
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

Please remember to delete or comment any other own_window parameter.

Now your conky window should look transparent. You just need to set it up to satisfy your likes and needs. To achieve this you can read the conky configuration settings’ page here and the conky variables here or you can get a lot of examples of .conkyrc files here
For color reference you may use this chart. Conky will only use colors written with capital letters!

I’ll put my .conkyrc for further guidance


# Conky, a system monitor, based on torsmo
#
# Any original torsmo code is licensed under the BSD license
#
# All code written since the fork of torsmo is licensed under the GPL
#
# Please see COPYING for details
#
# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
# Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# $Id: conky.conf 1193 2008-06-21 20:37:58Z ngarofil $
# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048

# Update interval in seconds
update_interval 4

# 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 no
own_window_colour 000000
own_window_type normal
own_window_argb_visual
own_window_argb_value 90
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# Minimum size of text area
minimum_size 0 0
#maximum_width 200

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders yes

# Stippled borders?
stippled_borders 0

# border margins
# border_margin 10
border_inner_margin 10

# border width
border_width 1

# Default colors and also border colors
default_color grey
#default_shade_color black
#default_outline_color grey
# own_window_colour grey

# 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 30
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
${color white}SYSTEM ${hr 2}$color
${color white}Linux: ${alignr}${nodename} ${kernel} on ${machine}$color
Uptime: ${alignr}${uptime}
RAM: $memperc% ${alignr}${color 2E8B57}${membar 8,100}$color
SWAP: $swapperc% ${alignr}${color 3CB371}${swapbar 8,100}$color

${voffset -10}${color white}DATE ${hr 2}$color
${alignc 17}${color white}${font Arial Black:size=16}${time %H:%M}${font}$color
${alignc}${time %A %d %B %Y}

${voffset -10}${color white}CPU ${hr 2}$color
Core 0 Usage: ${cpu cpu1}% ${alignr}${color 4169E1}${cpubar cpu1 8,100}$color
Core 1 Usage: ${cpu cpu2}% ${alignr}${color 4682B4}${cpubar cpu2 8,100}$color
CPU Frequency: ${alignr}${freq cpu1}MHz
Core 0 Temp: ${alignr}${execi 8 sensors | grep Core0 | tail -1 | cut -c15-19 | sed '/^$/d'}C
Core 1 Temp: ${alignr}${execi 8 sensors | grep Core1 | tail -1 | cut -c15-19 | sed '/^$/d'}C

${voffset -10}${color white}HD ${hr 2}$color
Root:   ${fs_used /}/${fs_size /} ${alignr}${color FF9933}${fs_bar 8,100 /}$color
Home:   ${fs_used /home}/${fs_size /home} ${alignr}${color FFA500}${fs_bar 8,100 /home}$color
Pancho: ${fs_used /home/pancho}/${fs_size /home/pancho} ${alignr}${color FF6600}${fs_bar 8,100 /home/pancho}$color

${voffset -6}${color white}BATTERY ${hr 2}$color
Status: ${battery BAT1} ${battery_time BAT1} ${alignr}${color 7FFF00}${battery_bar 8,100}$color

${voffset -20}${if_up wlan0}
${color white}NETWORK wlan0 ${hr 2}$color
${voffset 4}${font PizzaDude Bullets:size=10}O${font}   Up: ${upspeed wlan0}kb/s ${alignr}${upspeedgraph wlan0 8,100 FFFFFF 00FF00}
${voffset 4}${font PizzaDude Bullets:size=10}U${font}   Down: ${downspeed wlan0}kb/s ${alignr}${downspeedgraph wlan0 8,100 FFFFFF FF0000}
${voffset 4}${font PizzaDude Bullets:size=10}N${font}   Upload: ${alignr}${totalup wlan0}
${voffset 4}${font PizzaDude Bullets:size=10}T${font}   Download: ${alignr}${totaldown wlan0}
${voffset 4}${font PizzaDude Bullets:size=10}Z${font}   Signal: ${wireless_link_qual wlan0}% ${alignr}${color red}${wireless_link_bar 8,100 wlan0}$color
${voffset 4}${font PizzaDude Bullets:size=10}a${font}   Local Ip: ${alignr}${addr wlan0}
${endif}${if_up wlan1}
${color white}NETWORK wlan1 ${hr 2}$color
${voffset 4}${font PizzaDude Bullets:size=10}O${font}   Up: ${upspeed wlan1}kb/s ${alignr}${upspeedgraph wlan1 8,100 FFFFFF 00FF00}
${voffset 4}${font PizzaDude Bullets:size=10}U${font}   Down: ${downspeed wlan1}kb/s ${alignr}${downspeedgraph wlan1 8,100 FFFFFF FF0000}
${voffset 4}${font PizzaDude Bullets:size=10}N${font}   Upload: ${alignr}${totalup wlan1}
${voffset 4}${font PizzaDude Bullets:size=10}T${font}   Download: ${alignr}${totaldown wlan1}
${voffset 4}${font PizzaDude Bullets:size=10}Z${font}   Signal: ${wireless_link_qual wlan1}% ${alignr}${color red}${wireless_link_bar 8,100 wlan1}$color
${voffset 4}${font PizzaDude Bullets:size=10}a${font}   Local Ip: ${alignr}${addr wlan1}
${endif}${if_up eth0}
${color white}NETWORK eth0 ${hr 2}$color
${voffset 4}${font PizzaDude Bullets:size=10}O${font}   Up: ${upspeed eth0}kb/s ${alignr}${upspeedgraph eth0 8,100 BEBEBE BEBEBE}
${voffset 4}${font PizzaDude Bullets:size=10}U${font}   Down: ${downspeed eth0}kb/s ${alignr}${downspeedgraph eth0 8,100 BEBEBE BEBEBE}
${voffset 4}${font PizzaDude Bullets:size=10}N${font}   Upload: ${alignr}${totalup eth0}
${voffset 4}${font PizzaDude Bullets:size=10}T${font}   Download: ${alignr}${totaldown eth0}
${voffset 4}${font PizzaDude Bullets:size=10}a${font}   Local Ip: ${alignr}${addr eth0}
${endif}

${voffset -20}${color white}PROCESSES ${hr 2}$color
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}

${voffset -6}${color white}MESSAGES ${hr 2}$color
${execi 8 tail -n3 /var/log/messages | cut -c28-200}

http://img13.imageshack.us/img13/7408/instantnea1w.th.png](http://img13.imageshack.us/i/instantnea1w.png/)

Uploaded with ImageShack.us

Hi
If you want to add conkyforecast it’s also there ;
http://software.opensuse.org/search?baseproject=ALL&p=1&q=conkyforecast

http://thumbnails28.imagebam.com/8250/400c9382496495.gif](ImageBam)


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (i586) Kernel 2.6.32.12-0.7-pae
up 0:13, 2 users, load average: 0.27, 0.23, 0.21
ASUS eeePC 1000HE ATOM N280 1.66GHz | GPU Mobile 945GM/GMS/GME

Thanks for your input Malcolm. I’ve decided to leave conkyForecast apart since it’s necessary to subscribe to weather.com xml feed service (weather.com).

Once subscribed you may receive an e-mail with your partner_id and license_key. With those you may be able to edit the .conkyForecast.config file. You can create this file using this code

cp /usr/share/conkyforecast/.conkyForecast.config ~/.conkyForecast.config

You may also need your location code. You can find it searching for your home city in weather.com website. (i.e. ARBA0009 for Buenos Aires, Argentina)

If your .conkyForecast.config file is already set up you can add this code to your .conkyrc file for conky to display the weather forecast


WEATHER ${hr 2}
${if_existing /proc/net/route wlan0}
${voffset -10}${alignr 56}${font ConkyWeather:style=Bold:size=40}${execi 600 conkyForecast --location=??? --datatype=WF}${font}
${voffset -50}${font Weather:size=40}y${font}  ${voffset -38}${font Arial Black:size=26}${execi 600 conkyForecast --location=??? --datatype=HT}${font}

${voffset 0}${alignc 43}${execpi 600 conkyForecast --location=??? --datatype=DW --startday=1 --shortweekday} ${alignc 8}${execpi 600 conkyForecast --location=??? --datatype=DW --startday=2 --shortweekday} ${alignc -29}${execpi 600 conkyForecast --location=??? --datatype=DW --startday=3 --shortweekday} ${alignc -64}${execpi 600 conkyForecast --location=??? --datatype=DW --startday=4 --shortweekday}
${voffset 0}${alignc 75}${font ConkyWeather:size=28}${execpi 600 conkyForecast --location=??? --datatype=WF --startday=1 --endday=4 --spaces=1}${font}
${voffset 0}${font DejaVu Sans:size=7}${alignc 48}${execpi 600 conkyForecast --location=??? --datatype=HT --startday=1 --hideunits --centeredwidth=3}/${execpi 600 conkyForecast --location=??? --datatype=LT --startday=1 --hideunits --centeredwidth=3} ${alignc -14}${execpi 600 conkyForecast --location=??? --datatype=HT --startday=2 --hideunits --centeredwidth=3}/${execpi 600 conkyForecast --location=??? --datatype=LT --startday=2 --hideunits --centeredwidth=3} ${alignc -40}${execpi 600 conkyForecast --location=??? --datatype=HT --startday=3 --hideunits --centeredwidth=3}/${execpi 600 conkyForecast --location=??? --datatype=LT --startday=3 --hideunits --centeredwidth=3} ${alignr 6}${execpi 600 conkyForecast --location=??? --datatype=HT --startday=4 --hideunits --centeredwidth=3}/${execpi 600 conkyForecast --location=??? --datatype=LT --startday=4 --hideunits --centeredwidth=3}${font}
${else}${if_existing /proc/net/route eth0}
${voffset -10}${alignr 56}${font ConkyWeather:style=Bold:size=40}${execi 600 conkyForecast --location=??? --datatype=WF}${font}
${voffset -50}${font Weather:size=40}y${font}  ${voffset -38}${font Arial Black:size=26}${execi 600 conkyForecast --location=??? --datatype=HT}${font}

${voffset 0}${alignc 43}${execpi 600 conkyForecast --location=??? --datatype=DW --startday=1 --shortweekday} ${alignc 8}${execpi 600 conkyForecast --location=??? --datatype=DW --startday=2 --shortweekday} ${alignc -29}${execpi 600 conkyForecast --location=??? --datatype=DW --startday=3 --shortweekday} ${alignc -64}${execpi 600 conkyForecast --location=??? --datatype=DW --startday=4 --shortweekday}
${voffset 0}${alignc 75}${font ConkyWeather:size=28}${execpi 600 conkyForecast --location=??? --datatype=WF --startday=1 --endday=4 --spaces=1}${font}
${voffset 0}${font DejaVu Sans:size=7}${alignc 48}${execpi 600 conkyForecast --location=??? --datatype=HT --startday=1 --hideunits --centeredwidth=3}/${execpi 600 conkyForecast --location=??? --datatype=LT --startday=1 --hideunits --centeredwidth=3} ${alignc -14}${execpi 600 conkyForecast --location=??? --datatype=HT --startday=2 --hideunits --centeredwidth=3}/${execpi 600 conkyForecast --location=??? --datatype=LT --startday=2 --hideunits --centeredwidth=3} ${alignc -40}${execpi 600 conkyForecast --location=??? --datatype=HT --startday=3 --hideunits --centeredwidth=3}/${execpi 600 conkyForecast --location=??? --datatype=LT --startday=3 --hideunits --centeredwidth=3} ${alignr 6}${execpi 600 conkyForecast --location=??? --datatype=HT --startday=4 --hideunits --centeredwidth=3}/${execpi 600 conkyForecast --location=??? --datatype=LT --startday=4 --hideunits --centeredwidth=3}${font}
${endif}${else}${if_existing /proc/net/route eth1}
${voffset -10}${alignr 56}${font ConkyWeather:style=Bold:size=40}${execi 600 conkyForecast --location=??? --datatype=WF}${font}
${voffset -50}${font Weather:size=40}y${font}  ${voffset -38}${font Arial Black:size=26}${execi 600 conkyForecast --location=??? --datatype=HT}${font}

${voffset 0}${alignc 43}${execpi 600 conkyForecast --location=??? --datatype=DW --startday=1 --shortweekday} ${alignc 8}${execpi 600 conkyForecast --location=??? --datatype=DW --startday=2 --shortweekday} ${alignc -29}${execpi 600 conkyForecast --location=??? --datatype=DW --startday=3 --shortweekday} ${alignc -64}${execpi 600 conkyForecast --location=??? --datatype=DW --startday=4 --shortweekday}
${voffset 0}${alignc 75}${font ConkyWeather:size=28}${execpi 600 conkyForecast --location=??? --datatype=WF --startday=1 --endday=4 --spaces=1}${font}
${voffset 0}${font DejaVu Sans:size=7}${alignc 48}${execpi 600 conkyForecast --location=??? --datatype=HT --startday=1 --hideunits --centeredwidth=3}/${execpi 600 conkyForecast --location=??? --datatype=LT --startday=1 --hideunits --centeredwidth=3} ${alignc -14}${execpi 600 conkyForecast --location=??? --datatype=HT --startday=2 --hideunits --centeredwidth=3}/${execpi 600 conkyForecast --location=??? --datatype=LT --startday=2 --hideunits --centeredwidth=3} ${alignc -40}${execpi 600 conkyForecast --location=??? --datatype=HT --startday=3 --hideunits --centeredwidth=3}/${execpi 600 conkyForecast --location=??? --datatype=LT --startday=3 --hideunits --centeredwidth=3} ${alignr 6}${execpi 600 conkyForecast --location=??? --datatype=HT --startday=4 --hideunits --centeredwidth=3}/${execpi 600 conkyForecast --location=??? --datatype=LT --startday=4 --hideunits --centeredwidth=3}${font}
${endif}${else}
${font PizzaDude Bullets:size=14}4${font}   Weather Unavailable
${endif}

Remember to replace the ??? signs with your location code

Pancho