Overview
conky](http://conky.sourceforge.net/) is a light-weight powerful monitoring tool that displays information about CPU load and temperature, file systems and RAM usage, hard disk IO and temperature, network traffic, top CPU and memory processes, weather forecast and many other things.
conkyconf is a bash script that generates a conky system or user configuration file based on the information gathered from your system. It has several options which let you add a few things you want to monitor. In addition to this script, the conkyconf package includes a lua script that adds functionality that can’t be done in conky alone and improves conky’s appearance. conkyconf has the following dependencies under openSUSE:
The following NEW packages are going to be installed:
conky conky-devel conkyconf conkyweather hddtemp imlib2 imlib2-loaders tolua++
Credits
The conky version installed with conkyconf is the one with nvidia support I branched from @malcolmlewis’s repo - thanks go to him! It allows conky to monitor nvidia graphics card frequency and temperature. I added curl and rss support to Malcolm’s build - the latter is needed by conkyconf - as well as hddtemp prerequisite.
conkyweather, also installed with conkyconf, is based on google weather](http://hardikmehta.wordpress.com/2009/08/04/a-script-to-display-weather-forecast-for-conkyconky-screen-shot/) by Hardik Mehta. Thanks go to him too!
Installation
To install conkyconf with all dependencies, just install my repo (if you don’t have it already) and the package:
su -l
zypper ar [noparse]http://download.opensuse.org/repositories/home:/please_try_again/openSUSE_11.4/[/noparse] PTA
zypper refresh
zypper in conkyconf
Basic Usage
To write a basic conky configuration, just type:
conkyconf
Kde users might want to type the following instead:
conkyconf -k
This command creates the file .conkyrc in the user’s home directory (~/.conkyrc).
The difference between conkyconf an conkyconf -k resides in this conky setting:
--- /root/.conkyrc.kde 2011-08-30 20:51:58.000000000 -0700
+++ /root/.conkyrc 2011-08-30 20:52:20.000000000 -0700
@@ -17,7 +17,7 @@
own_window_type normal
own_window_transparent yes
own_window_class Conky
-own_window_argb_visual yes
+own_window_argb_visual no
own_window_colour 082103
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
To achieve conky’s transparency under kde (and some xfce but not the one in openSUSE 11.4), own_window_argb_visual has to be set to no. Older conkyconf versions used to write a different config file for KDE. Now the conky wrapper (conky.sh) installed with the package takes care of that. There is also a function setargb in the lua script which can switch this value while initializing conky but I wasn’t too happy with this function and disabled it by default.
You can create a standard or KDE-specific system-wide conky configuration by using respectively:
conkyconf -s
or
conkyconf -sk
However the conky wrapper won’t modify the system-wide /etc/conky/conky.conf in user’s session. And it’s not necessary to create a system-wide configuration for conky - but the feature exists.
The basic configuration file generated by conkyconf while used without options displays:
- Current Date & time and system uptime
- CPU(s) info and load
- available and used RAM
- CPU & Mainboard temperature (if sensors were found). Critical temperatures are displayed in red.
- Default network interface up and down traffic
- local IP, gateway and DNS
- space utilization of mounted filesystems (in GB and percentage)
- top 5 CPU processes
- top 3 memory processes
Everytime you run conkyconf, the configuration file gets overwritten with the new settings. When the configuration file has been changed, such as after running conkyconf, conky reloads itself to reflect the new configuration. It is sometimes necessary to kill and restart conky.
Display options
conkyconf has several options that can be used to add other monitoring panels. Each option as a short and a long name.
You can print the available options with:
conkyconf -h
-d --diskio
Monitors write/read IO and temperature of all found hard disks.
-N --nvidia
Monitors nvidia GPU frequency and temperature. This option is ignored if the nvidia module is not loaded or the conky version used doesn’t have nvidia support.
The temperature sensor might not be available on older nvidia chipsets (such as GeForce 6150). In this case N/AC will be displayed (I’ll fix this detail later). A lua function defined in /etc/conky/conky.lua returns the temperature in red if it exceeds the threshold given by the sensor.
-w --weather
-f --forecast
Weather and weather forecast. Simply use -wf for both. These options requires conkyweather, installed with conkyconf.
**-g --geo **<location>
Specifies the geographical location as City,Country State for weather info and forecast above. You have to use this option, as the default location defined in conkyconf is unlikely to be your place. Don’t try too many locations or you will get banned fom Google weather site (it happened to me). Last time I checkecd, locations like the following were valid:
-g London,UK
-g Sydney,AU
-g Austin,TX
-g Paris,FR
You can (and you should) also modify the default location by editing /usr/bin/conkyconf as root and changing the value of the variable LOC in the script. Then you won’t have to specify it on the command line.
**-r --rss **<RSS feed>
Displays RSS feed in one line of horizontal scrolling text. The default rss feed for openSUSE is ‘http://forums.opensuse.org/external.php?type=RSS2’. It can be changed in /usr/bin/conkyconf. Horizontal scrolling doesn’t work properly in conky 1.8.0. It got fixed in conky 1.8.1 at the cost of new line parsing. Basically both conky versions are buggy, but I would say that the bug in 1.8.1 is worse. It prevents conky from parsing strings returned by the lua script (or by any external command) correctly as soon as they include more they one line. Thus conkyconf checks which conky version is installed and generates a configuration file accordingly. Version 1.8.0 makes internally a better use of the lua functions but the appearance of conky shows no difference.
-l --log <logfile>
-n --lines <lines>
Displays the number of lines of the given logfile. You need read access to this file. It doesn’t work very well because of the bugs mentioned above.
other options
-k --kde
generates a config file appropriate for kde transparency
**-i --interval **<n.n>
This option sets the given update interval in ~/.conkyrc but doesn’t overwrite other settings or variables. The default update interval is 1 second. Increasing this value will drasticaly reduce conky’s CPU usage. You can try
conkyconf -i 5
and (just for fun):
conkyconf -i 0.1
and watch the difference.
-p --print
prints the generated config file to standard output rather than writing it - useful for testing.
other variables you can change
You can change several default values in the script itself. Some of them have can be set by command line options.
variables/default value cli option
LOC="Victoria,BC" -g --geo # City/State, province or country for weather info.
interval=1.0 -i --interval # Update interval
log=/var/log/messages -l --log # default log file
lines=5 -n --lines # number of log lines to display
topcpu=5 # Number of top CPU processes to display - 0 to disable
topmem=3 # Number of top MEM processes to display - 0 to disable
vspace=3 # vertical space in pixels between panels
alignment=top_right # top_left, top_right, bottom_left, bottom_right, none
Colors
There are 5 color themes predefined in conkyconf. The one used by default is determined by the first 3 letters of the Distributor ID returned by lsb_release: sus fed man arc and ubu - or the first 3 letters of the value stored in the variable OS in all other cases. You can overwrite some of all colors in the theme by uncommenting these colors and changing their value:
# You can define some colors here to overwrite the distro themes.
# You have to to define the colors here if the distro colors are not defined!
# !!! When specifying the color value in hex, omit the leading hash (#) !!!
#own_window_color=black
#default_color=white
#label_color=goldenrod
#caption_color=white
#hr_color=white
#fs_color=white
#fs_used_color=red
#fs_free_color=green
#weather_label_color=yellow
#weather_color=yellow
#value_color=yellow
#frame_color=ivory1
#forecast_color=LightGray
#critical_color=red
#fs_pct_color=yellow
#cpu_pct_color=white
#shade_color=black
#outline_color=black
#uptime_color=DarkOrange1
#netup_color=red
#netdown_color=yellow
#proc_run_color=red
#forecasticon_color=LightGray
#rss_color=yellow
# !!! The following colors must be specified in hex.
#fs_bar_color=00ff00
#cpubar_color=ffa500
#cpugd1_color=ffe421
#cpugd2_color=ff0000
#netdowngd1_color=000000
#netdowngd2_color=00ff00
#netdupgd1_color=000000
#netdupgd2_color=ff0000
#log_color=af0000
http://www.unixversal.com/linux/openSUSE/conkyconf_thumb.png](http://www.unixversal.com/linux/openSUSE/conkyconf.png)
More settings from here
conkyconf covers only a few of the many conky variables. You can modify the ~/.conkyrc file created by conkyconf to suit your needs. Be aware though that this file will be overwritten next time you run conkyconf. For more info, read the documentation about conky variables and config file settings.
The conky wrapper
The conky wrapper (/usr/bin/conky.sh) is a small bash script that you can use to start conky. It checks if conky is already running before starting it - don’t use it if you want to launch several instances of conky! It set the value of own_window_argb_visual to yes or no by checking the value of the environment variable DESKTOP_SESSION. This variable is set by kdm and gdm. It won’t work if your kde session is not called ‘kde’. It works for me because I try to organize things in the way that seems the most clean and the most logical to me, and so my kde session is called ‘kde’. If yours is called ‘default’ - as explained in this post by jdmcdaniel3, either modify your session name or the conky wrapper, or don’t use it. It is only useful if you often switch between KDE an other desktops and want to preserve conky’s transparency. Transparency only works under KDE when compositing (desktop effects) is enable. Most people use desktop effects under KDE and there are on by default. However, the conky wrapper checks if KDE compositing is enable and if not, starts the simple compositing manager xcompmgr (if present), providing a way to have conky’s transparency under KDE without desktop effects.
Compositor is a bash script that set/unset composting on the fly under various desktops. As I originally wrote it to test conky transparency, it is included in conkyconf.
Autostarting conky
conkyconf includes /etc/xdg/autostart/conky.desktop wich starts conky.sh by default in Gnome, XFCE, LXDE and other sessions evaluating the files in /etc/xdg/autostart, such as openbox-session running xdg-autostart in ~/.config/openbox/autostart.sh:
# Run XDG autostart things. By default don't run anything desktop-specific
# See xdg-autostart --help more info
DESKTOP_ENV="OPENBOX"
if which /usr/lib64/openbox/xdg-autostart >/dev/null; then
/usr/lib64/openbox/xdg-autostart $DESKTOP_ENV
fi
To prevent the conky wrapper from starting automatically, you can disable it in the desktop’s sessions and autostart setup or edit the /etc/xdg/autostart/conky.desktop and change these values:
--- /etc/xdg/autostart/conky.desktop.orig 2011-08-31 11:02:49.000000000 -0700
+++ /etc/xdg/autostart/conky.desktop 2011-08-31 11:03:34.000000000 -0700
@@ -6,7 +6,7 @@
Exec=conky.sh
StartupNotify=false
Terminal=false
-Hidden=false
+Hidden=true
X-KDE-autostart-phase=2
NotShowIn=KDE;
-X-GNOME-Autostart-enabled=true
+X-GNOME-Autostart-enabled=false
To start conky rather than the wrapper, replace Exec=conky.sh with Exec=conky.
To autostart conky or conky.sh in kde, create the file ~/.kde4/Autostart/conky.desktop with the following content:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=conky
Exec=conky
StartupNotify=false
Terminal=false
Hidden=false
**X-KDE-autostart-phase=2**
OnlyShowIn=KDE;
X-KDE-autostart-phase=2 is needed to start conky after the saved session, so that it doesn’t get both restored and autostarted. This variable seems to be evaluated only in ~/.kde4/Autostart but NOT in ~/.config/autostart (and the system-wide /etc/xdg/autostart). Alternatively, you can add excludeApps=conky in the [General] section of ~/.kde4/share/config/ksmserverrc to exclude conky from sessions.
To autostart conky in icewm-session, create the file ~/.icewm/startup with following content:
#!/bin/bash
( sleep 1 && conky.sh )