Ubuntu 22.04 System Monitoring with Conky widgets

Conky is a system monitoring program for Linux and BSD that runs on the GUI. It monitors various system resources to report the current usage of CPU, memory, disk storage, temperatures, users logged in, currently playing song, etc. in a sleek little widget on your screen. This way, you’re able to see at a quick glance how your computer’s components are being utilized.

Conky is lightweight and highly configurable, so you’re able to run it without having a negative impact on your system or seeing it stick out like it doesn’t belong. We’ll show you how to get it installed on Ubuntu 22.04 Jammy Jellyfish and some configuration options to get it looking nice.

In this tutorial you will learn:

  • How to install Conky on Ubuntu 22.04 Jammy Jellyfish
  • How to enable Conky to start at boot
  • How to customize the information Conky reports
  • How to customize the look of Conky
Conky system monitoring on Ubuntu 22.04 Jammy Jellyfish Linux
Conky system monitoring on Ubuntu 22.04 Jammy Jellyfish Linux
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Ubuntu 22.04 Jammy Jellyfish
Software Conky
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Conky installation on Ubuntu 22.04 step by step instructions




Get started by opening a command line terminal and entering the following two apt commands to install Conky:

$ sudo apt update
$ sudo apt install conky-all

Enable Conky to start at boot

Conky is the type of program that people typically run all the time. It just sort of integrates itself with your desktop. Therefore, you’ll probably want it to open automatically every time your system boots up. To achieve that, follow these steps:

  1. Open Ubuntu’s application launcher and type “startup” in the search bar to open Startup Applications.
    Open up Startup Applcations from the Ubuntu application launcher
    Open up Startup Applcations from the Ubuntu application launcher
  2. Inside Startup Applications, click “Add” to add a new program.
    Click the Add button to enter Conky into the list
    Click the Add button to enter Conky into the list
  3. In this window, we will enter the name of our program (Conky System Monitoring) and the full command to open Conky, which is /usr/bin/conky. Reference the screenshot below to see how yours should look:
    Fill out the information for Conky as seen here
    Fill out the information for Conky as seen here
  4. Hit the “Add” button to finish up, then you can close the Startup Applications Preferences window. When done, reboot or re-login to your Ubuntu 22.04 system.
    $ reboot
    
  5. When you load back into your desktop, you’ll be greeted by the Conky widget. It looks a little plain right now and it’s in a terrible position by default, but it should be giving you a concise view of what’s going on with your system resources. In the next section, we’ll cover how to get it looking better.



    Conky is now loaded, but looking rather ugly at the moment
    Conky is now loaded, but looking rather ugly at the moment

How to customize Conky

Now that Conky is up and running, we can work a bit on its aesthetics. Conky’s universal configuration file is located in /etc/conky/conky.conf. Editing this file will change the settings for every user on your Ubuntu 22.04 system. So if you’re looking to apply universal changes, work directly with this file. Otherwise, to edit the settings for your specific user, first create a single user defined Conky configuration file like so:

$ cp /etc/conky/conky.conf ~/.conkyrc

To apply those changes, you’ll have to reload your desktop by rebooting or logging out and back in. After that, use your favorite text editor to open up the configuration file. Here’s how to open it with gedit:

$ gedit ~/.conkyrc

One of the most apparent changes that needs to happen is getting Conky out of the left side of the screen, where it overlaps with GNOME’s dock bar. Change line 29 from alignment = 'top_left' to alignment = 'top_right' to get Conky to display on the right side of your desktop.

Fix the alignment of Conky
Fix the alignment of Conky

Next, let’s get the network monitoring to work correctly. By default, Conky monitors the eth0 network interface, but there’s a good chance that your network interface uses a different name. Obtain your network interface name and then replace the eth0 values on line 76 with the name of your network interface.

Enter your network interface name on line 76, replacing eth0
Enter your network interface name on line 76, replacing eth0




You can trying pinging a website to generate some network traffic and make sure that Conky is picking up on it. Note that you’ll need to save your changes to the configuration file before testing this.

$ ping google.com
Generate some network traffic to make sure Conky is reporting correctly
Generate some network traffic to make sure Conky is reporting correctly

Next, let’s make Conky look a little more fluid and a little less like a black blob of an eyesore. Add the following lines into your Conky configuration file at the top part of the main config section and click save to see how nice the changes look:

own_window_argb_visual = true,
	own_window_argb_value = 50,
	double_buffer = true,
Change these three lines to make Conky transparent and look nice
Change these three lines to make Conky transparent and look nice

As we mentioned earlier, Conky is highly configurable. There are a lot of things we can do to it. For example, to configure Conky to monitor our system’s external IP address, you can add the following line to the configuration file under the conky.text directive:

Conky is now reporting the external IP address of our system
Conky is now reporting the external IP address of our system

Even more options




Conky is looking pretty polished now, as you can see in our screenshot below.

Conky basic configuration on Ubuntu 22.04
Conky basic configuration on Ubuntu 22.04

Still, we’ve only touched on some basic configuration. There are infinite possibilities to what you can do with Conky, as long as you have a little knowledge and imagination. For example, check out how extensive the below configuration looks:

Conky extensive configuration on Ubuntu 22.04
Conky extensive configuration on Ubuntu 22.04

Interested in this configuration? Just paste the following code into Conky’s configuration file that we were editing earlier:

conky.config = {
	
	update_interval = 1,
	cpu_avg_samples = 2,
	net_avg_samples = 2,
	out_to_console = false,
	override_utf8_locale = true,
	double_buffer = true,
	no_buffers = true,
	text_buffer_size = 32768,
	imlib_cache_size = 0,
	own_window = true,
	own_window_type = 'normal',
	own_window_argb_visual = true,
	own_window_argb_value = 50,
	own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
	border_inner_margin = 5,
	border_outer_margin = 0,
	xinerama_head = 1,
	alignment = 'bottom_right',
	gap_x = 0,
	gap_y = 33,
	draw_shades = false,
	draw_outline = false,
	draw_borders = false,
	draw_graph_borders = false,
	use_xft = true,
	font = 'Ubuntu Mono:size=12',
	xftalpha = 0.8,
	uppercase = false,
	default_color = 'white',
	own_window_colour = '#000000',
	minimum_width = 300, minimum_height = 0,
	alignment = 'top_right',

};
conky.text = [[
${time %H:%M:%S}${alignr}${time %d-%m-%y}
${voffset -16}${font sans-serif:bold:size=18}${alignc}${time %H:%M}${font}
${voffset 4}${alignc}${time %A %B %d, %Y}
${font}${voffset -4}
${font sans-serif:bold:size=10}SYSTEM ${hr 2}
${font sans-serif:normal:size=8}$sysname $kernel $alignr $machine
Host:$alignr$nodename
Uptime:$alignr$uptime
File System: $alignr${fs_type}
Processes: $alignr ${execi 1000 ps aux | wc -l}

${font sans-serif:bold:size=10}CPU ${hr 2}
${font sans-serif:normal:size=8}${execi 1000 grep model /proc/cpuinfo | cut -d : -f2 | tail -1 | sed 's/\s//'}
${font sans-serif:normal:size=8}${cpugraph cpu1}
CPU: ${cpu cpu1}% ${cpubar cpu1}

${font sans-serif:bold:size=10}MEMORY ${hr 2}
${font sans-serif:normal:size=8}RAM $alignc $mem / $memmax $alignr $memperc%
$membar
SWAP $alignc ${swap} / ${swapmax} $alignr ${swapperc}%
${swapbar}

${font sans-serif:bold:size=10}DISK USAGE ${hr 2}
${font sans-serif:normal:size=8}/ $alignc ${fs_used /} / ${fs_size /} $alignr ${fs_used_perc /}%
${fs_bar /}

${font Ubuntu:bold:size=10}NETWORK ${hr 2}
${font sans-serif:normal:size=8}Local IPs:${alignr}External IP:
${execi 1000 ip a | grep inet | grep -vw lo | grep -v inet6 | cut -d \/ -f1 | sed 's/[^0-9\.]*//g'}  ${alignr}${execi 1000  wget -q -O- http://ipecho.net/plain; echo}
${font sans-serif:normal:size=8}Down: ${downspeed enp0s3}  ${alignr}Up: ${upspeed enp0s3} 
${color lightgray}${downspeedgraph enp0s3 80,130 } ${alignr}${upspeedgraph enp0s3 80,130 }$color
${font sans-serif:bold:size=10}TOP PROCESSES ${hr 2}
${font sans-serif:normal:size=8}Name $alignr PID   CPU%   MEM%${font sans-serif:normal:size=8}
${top name 1} $alignr ${top pid 1} ${top cpu 1}% ${top mem 1}%
${top name 2} $alignr ${top pid 2} ${top cpu 2}% ${top mem 2}%
${top name 3} $alignr ${top pid 3} ${top cpu 3}% ${top mem 3}%
${top name 4} $alignr ${top pid 4} ${top cpu 4}% ${top mem 4}%
${top name 5} $alignr ${top pid 5} ${top cpu 5}% ${top mem 5}%
${top name 6} $alignr ${top pid 6} ${top cpu 6}% ${top mem 6}%
${top name 7} $alignr ${top pid 7} ${top cpu 7}% ${top mem 7}%
${top name 8} $alignr ${top pid 8} ${top cpu 8}% ${top mem 8}%
${top name 9} $alignr ${top pid 9} ${top cpu 9}% ${top mem 9}%
${top name 10} $alignr ${top pid 10} ${top cpu 10}% ${top mem 10}%
]];

For further reading, visit the official Conky git page or take a look at the man page documentation:

$ man conky


Closing Thoughts

Conky is one of the oldest and most useful system monitoring utilities available on Linux. Its lightweight and highly configurable nature make it a favorite of Ubuntu users. Once you have it looking nice, it’s easy to forget that it’s not actually part of the default Ubuntu desktop environment.

In this tutorial, we showed how to install Conky for system monitoring on Ubuntu 22.04 Jammy Jellyfish Linux. We also showed how you can apply your own configuration changes to control what information Conky reports, as well as various aesthetic changes to make it look fluid on your desktop.