Our very first script, a very simple example,
example/01.sh.
This example describe parameters supported,
related to lemonbar configuration.
It is set from external lemonbar.
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.
2: 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,
example/gmc.sh.
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.
Foreground Color: %{F}
Background Color: %{B}
Underline Color: %{U}
Alignment: %{l}, %{c},
and %{r}
It is just an example, we need a more clear format,
than typing text+= over and over again.
And Conky is just the right tools comes for us.
3: 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. example/03-output.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.
conky.config and conky.text.
The first part, persist accros this tutorial.
But we need more attention to the second part.
4: 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:
main.sh.
A Conky Configuration Resource, as a script entry point:
conky.lua.
You can freely modify this conky.
Two submodule libraries:
helper.lua and
parts.lua.
One asset contain Google Material Color for convenience:
gmc.lua.
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 enabled variable?
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 assembly.lua code.
There is no need to make this script simpler.
No need any optimization.
It is designed to be modified.
Quick and Dirty.
5: Real Life Lemonbar with Lua in Conky
Update: Additional guidance.
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.