Why Lemonbar Conky Guidance
Because I can.
Just Kidding. I like to learn. And I also like to share what I learn. In Short. I don’t even know, why I wrote this guidance, in the first place. Or maybe I’m just to tied to write any preface as an eyecatching entry point. I don’t know what to write. I’m more in push people to read code than explaining stuff. So All I’ve got is this paragraph.
Allright. Let me try.
Lemonbar is great, and the creation of this cool statusbar can be made easier with Conky. There is a lot of dotfile out there showing amazing Lemonbar case. But very few tutorial, so hard for beginner to step in to this ricing n00berland. So yeah. We need a guidance, rather than scattered case.
How about conky? Conky is getting more interesting after Lua binding. It makes the configuration very flexible, because it can be programmed. With this article, I can say that Conky is proven to be used as multipurpose system monitor tools, as long as it takes text feed. Name it, from conky itself, i3bar, dzen2, lemonbar, and even command line interface.
Lemonbar and Dzen2
Lemonbar has a more different compared to Dzen2.
The ability to align: left, center, and right, in the same panel. With Dzen2, we have to create three panels, or just one panel with dzen-textwidth calculation.
Font support. The original Lemonbar only support XDFL. But you can install lemonbar-xft-git, that support XFD.
Unlike Dzen2, Lemonbar does not support Image. Nor .xbm or other. It is also designed to be lightweight in source code.
Underline Feature: It is an important feature, to show tagged desktop very nicely, in Tiling Window Manager.
Native transparency support.
Lemonbar has manual page.
Yesterday, I wrote another article about XLFD font. I recommend you to read that article before using Lemonbar.
Simple Piping to Lemonbar
Our very first script, a very simple example,
This example describe parameters supported,
related to lemonbar configuration.
It is set from external lemonbar.
For more information you can use the manual.
Figure below show a transparent lemonbar on top. With three different Font, in one panel.
Here we are using XFLD font, and unicode number. This is important part, as you cannot use XFT with original Lemonbar.
I also add alpha transparency. Have a look at the source.
Decorating Lemonbar with BASH
The next step is feature related to text formatting in lemonbar.
It is set internally by lemonbar. I separate main script
example/02-main.sh that configure
external parameter. And generated output by loop
example/02-output.sh that set
internal lemonbar formatting. I also put all colors in one place,
GMC stand for Google Material Color.
In this step, I’m using XFT Font. So we need lemonbar-xft-git, replacing the original lemonbar.
You can see in figure below, how alignment made in lemonbar. The home icon is on the right side of the statusbar panel. It lso has very nice underline.
This step, require knowledge, of a few lemonbar tags.
It is just an example, we need a more clear format,
text+= over and over again.
And Conky is just the right tools comes for us.
Composing Lemonbar in Conky Format
Just like the previous example, I have separated lemonbar parameter
example/03-main.sh and formatting.
This time in Lua.
The only different of the main bash script is the Conky loader.
You can debug your Conky output via command line interface.
Conky configuration itself is in fact a Lua script.
It contain two main parts.
The first part, persist accros this tutorial.
But we need more attention to the second part.
Lemonbar with Modularized Lua in Conky
"Let's be tidy and get organized."
I have made quick-and dirty-scripts. Just an example. It is never intended to be a perfect script. And you can write better than mine later.
Le’ts see the file structure. It contains:
Main BASH script, top pipe Conky to Dzen2:
A Conky Configuration Resource, as a script entry point:
conky.lua. You can freely modify this conky.
Two submodule libraries:
One asset contain Google Material Color for convenience:
One Themable File:
assembly.lua. This assembly combine some segments, and put them together into panel. You can make your own assembly, and change the looks.
The entry point
conky.lua relatively is simple.
I have put all the stuff in libraries.
Arrrghh… What is this
Well, this script assembly each segment parts to build a nice statusbar.
Unneeded segments, I put on disabled variable.
This is the best parts about using conky as a lua programming language.
The assemby process looks neat and tidy.
You can change the color and segment without a lot of effort. Just edit the conky.lua, and save. The lemonbar statusbar panel will updated automatically
This is the
There is no need to make this script simpler. No need any optimization. It is designed to be modified. Quick and Dirty.
Real Life Lemonbar with Lua in Conky
Now the Final part. The lemonbar example for your desktop. You should see the source yourself.
Lemonbar only need two bars while dzen2 need six bars. For code comparation you should see both source code yourself.
Coding is Fun. Especially when it comes to lemonbar-conky-lua tiers.
That is all for now. Thank you for reading.