Setting Up Conky System Monitor Utility

Conky is a system monitor for X originally based on torsmo (see conky(1) manual). In this tutorial you will learn how to setup conky on both Archlinux and FreeBSD. Here’s what mine look like in FreeBSD. In my Archlinux machine it looks pretty much the same.

Install Conky 1.10.x

In Archlinux:

$ sudo pacman -S conky

In FreeBSD via package manager:

$ sudo pkg install conky

In FreeBSD via ports (sysutils/conky), I prefer this approach:

$ cd /usr/ports/sysutils/conky
$ sudo make install clean

Configure Conky

Conky configuration in both Archlinux and FreeBSD is pretty much the same. The configuration file conky.conf both reside in ~/.config/conky/ in userspace.

Since conky 1.10, conky comes with a new syntax and that’s what we’re going to cover here. For my own setup this is pretty much what it looks like:

conky.config = {
     alignment = 'tr',
     background = true,
     border_width = 0,
     color1 = 'ffc766',
     color2 = 'b8b4ad',
     color3 = 'c89696',
     cpu_avg_samples = 4,
}
conky.text = [[
${font verdana:size=8:style=bold}${color1}SYSTEM${font} ${color7}${hr 3}
${color2}Hostname: ${color}${nodename}
${color2}Kernel: ${color}${kernel}
${color2}Processes: ${color}${processes} total
${color2}Desktop: ${color}No.${desktop}
${color2}Uptime: ${font mono:size=8:style=bold}${color}$uptime${font}
]]

You can get the complete configuration file from Github: https://github.com/greencloud/Conky_1.10.x. This repository also include several short bash scripts for getting the CPU temperature (AMD only) within conky, local IP and public IP addresses.

Autostart Conky

There are several ways to do this depending on the Desktop Environment you’re using. In my case I’m using XFCE4 on both my FreeBSD and Archlinux setup. The common approach is through the .xinitrc file. To do that just add this line of code in your .xinitrc file before the exec line.

conky -d &
exec startxfce4

But, if you don’t want to use .xinitrc, you can utilize autostart within XFCE4 (or whatever DE you’re using). For XFCE4 just create a file called conky.desktop in your ~/.config/autostart/ directory:

$ nano ~/.config/autostart/conky.desktop

And then type in these codes:

[Desktop Entry]
Type=Application
Exec=conky --daemonize --pause=5
Hidden=false
Name=Conky System Monitor
Comment=
Terminal=false

The 5 in the –pause parameter will make conky wait for 5 seconds before it draws on the screen.

To start conky without restarting your computer just type in your terminal:

$ killall conky && conky -d &

Leave a comment