Recreating My Conky Setup With Two Scripts for the XFCE4 Genmon Plugin

I recently ended up switching linux distros (because I managed to break Debian like a fool) and had heard about MX Linux and decided to give it a shot.

Let me quickly start off by saying that I found the installation process of MX Linux to be easy, well-designed, and intuitive. The distro has pretty much everything an end-user might want pre-installed and set up, and runs rather smoothly. In fact, I’m pretty sure that with this XFCE4/Openbox configuration I’ve set up, that my laptop is running smoother than ever before … including after I reinstalled Debian last year.

However, I realized that I do like WhiskerMenu as a "start menu" type of thing, but it seemed to complain if I did not have XFCE4’s panel running. Rather than fight against the way that the distro has things set up — which is what got me in trouble in the first place — I decided to lean into XFCE4’s way of doing things, and decided to adapt a second panel into something like my horizontal Conky bar that I’ve been using essentially since 2011 or so.

That led me to discover the remarkably versatile Genmon plugin for the XFCE4 panel. In short, it can display all sorts of things that are output from any script or program, which meant it was a perfect way for me to recreate that Conky bar. As a result, I coded (while waiting for things to reinstall, etc) two scripts that provide pretty much all the same information, but in a prettier way. {1}

click to embiggenOne script displays CPU, RAM, CPU temperature, battery status, and system load, while the second displays network connection information. (I would recommend using something like Multiload-ng for graphs including network speeds.) It has a lot of built-in niceties that weren’t all present in other scripts for the plugin:

  • Definable "warning" and "alert" values for pretty much every variable in sysmon_script with colorization to yellow and red for definable WARN and ALERT values.
  • Automatic detection and display of VPN data.
  • Determines WAN IP address through a cascading fallback of sites and methods.
  • Uses emojis for inline "icons" so you can adjust the size of the bar easily to fit whatever height you prefer.
  • Using two instances of the Genmon plugin means you can have different refresh rates for each (I currently have the system monitor running at every 2 seconds, and the network connection info running at every 30 seconds).

These scripts crib significantly from several byobu scripts originally by Dustin Kirkland for Canonical in 2008, as well as the genmon example script as well as scripts from almaceleste and xtonousou and this StackOverflow answer for getting a simple human-readable CPU percentage.

There are preview images available (both oriented horizontally like it actually is meant to be, and vertically so you can read the text explanation more easily) and the LGPL licensed scripts are available at Github, GitLab, and my personal Git repository.

Featured Image by James Osborne from Pixabay

{1} The scripts can also be used — with some modification to strip out the color styling and such — with Conky, tmux statusbars, and the like.