Conky for Window Managers

Austin Haedicke bio photo By Austin Haedicke Comment

Conky is a great tool for monitoring your Linux system. With endless possibilities for catchy graphic design, your respective Linux distribution forum probably has at least one forum thread dedicated to sharing screenshots and configurations of the tool.

About two years ago, after having been using Arch Linux for about 6 months or so, I decided to take up The Arch Way a bit more seriously. I rid my system of all GUIs and made a serious effort to downsize and strive for minimalism; not only for performance but for the sake of learning.

At any rate, switching to a window manager from a full desktop environment left me with a stale looking conky. This post will detail some tools and resources to put pzaz back in your usespace!

Initial Resources:

  1. To get conky working with your wm’s status bar, look at dzen.
  2. To start conky on login see this prior post on the subject.
  3. Bookmark a list of possible conky objects.
  4. If you’re going minimal, conky-cli should save a little disk space and overhead.

1) Clickable Areas and Pop-Ups:

The relevant Arch Wiki section for dzen is pretty clear and easy to implement. This will allow you to, as featured in the above image, keep a very clean and minimal constant output while maintaining great functionality. For example, the things I want to constantly be able to peek up and see in the corner of my screen may include:

  1. Time
  2. Battery status
  3. CPU usage / temperature
  4. Memory usage

The pop-ups, then, still give access to information you may want to get to quickly but don’t necessarily need to keep constant watch on, like:

  1. Disk usage
  2. Calendar / weather
  3. Uptime / login / mountpoints
  4. Package and upgrade transactions

2) Icon Fonts:

Minimalists have to take their eye candy where we can get it! So, instead of a gaudy MEM or CPU text in the output, you can implement tiny images or “iconfonts.”

Gather the necessary open source content:

$ git clone https://github.com/windelicato/dotfiles.git 
/tmp/dotfiles

$ mv /tmp/dotfiles/.xmonad/dzen2 ~/.icons/

Link to the specific icon file in your conky config:

~/.conkyrc
---
^i($HOME/.icon/dzen2/mem.xbm) ${memperc}%

3) Blinking Integer Ranges:

This can add a lot of flare as well. Rather than the same colors in the corner of your screen, you can configure conky to blink under specified conditions. You do that with a shell-like if / else statement. Common implementations for this would be memory usage, cpu temperature, and battery percentage.

For example, let’s say you want to have your battery monitor blink and turn red at a threshold value of 10%. In the example below this means that when the battery percentage is at 10 or lower, conky will A) change icons, B) turn the icon red, and C) start blinking the icon.

~/.conkyrc
---
$ {if_match ${battery_pecent BATC} <= 10}^fg(\#ff535a)${blink ^i($HOME/.icon/dzen2/battery_10.xbm)}^fg(\#eeeeee)${else}^i($HOME/.icons/dzen2.battery.xbm)${endif}

Conclusion:

There you have it, minimal doesn’t have to be bland! You could even take it all the way and have only icons with respective pop-ups for each of them. However, to me, that is only visually minimal and is a functional hassle that violates the KISS principle.

In review you can spice up your conky one-liner via:

  1. Changing font and color
  2. Adding clickable areas with pop-up information
  3. Including icons
  4. Configuring conditional blinking output
comments powered by Disqus