It was first April 2017 when I configure my dzen setup, and I’ll speak the truth about dzen2. Dzen is actually simple, the issue is, there was nobody to help me. I could not find any good tutorial, sufficient to ease my troubled mind. There was nothing I could do, but read as many dotshare sample as I could.
I can give you an illustration, a story you can imagine
"It was a frozen winter in cold war era. We are two men, a boy, two women, a husky, and two shotguns. After three weeks, we finally configure dzen2. But we lost our beloved husky before we finally made it. Now, every january, we remember our husky, that helped all of us to survive."
Now that the hard day was over, this tutorial is for you. Dzen2 is easy when you have guidance.
Why Learn Dzen2 ?
As a complement of Tiling Window Manager. People use standalone panel (or statusbar), e.g. Dzen2, Lemonbar, and stuff.
Let us see this preview image to see what can be achieved by Dzen2.
The thing is, Tiling Window Manager itself is also not complicated. Once you get the idea of one Tiling Window Manager, it is going to be easy to switch beetwen any of them. Just learn some keystrokes, and everything is functional. And later you can go deep into configuration if you want.
Further than this, especially for ricing, the hardest part is to make a beautiful panel/ statusbar setup. Most of the time, the panel part, is the longest configuration part.
With understanding of dzen2 statusbar, learning Tiling Window Manager, become easier. You can focus on the Window Manager instead of statusbar stuff.
There are a few consideration in building an acceptable panel.
Make the panel show the shape, as you wish.
Make the panel, in a structured script, flexible enough to be themed.
Make the panel, not resource hungry. Not hogging the CPU proccess.
Here we are going to cover the first and second part using BASH.
In order to make the shape we need to know a few tags.
^fn()We are going to use AwesomeFont to show Icons. And PowerlineSymbols to make a Powerline like statusbar.
^i()This tag is used to show Icon from Image Glyph. But we are going to use it to make a better Powerline like statusbar.
Hello World in Command Line
In order to keep dzen2 running, we need to echo output in endless loop, and pipe it to dzen2. Otherwise, dzen2 will dissappear, as the script stop.
This command will show you ‘Hello World’ at the top of your desktop.
Let’s do it for a more dynamic input using date that changed every second. Dzen will be shown at bottom right corner.
Yu can use Transparency with either transset-df or
transset (from xorg-transset), by using -title-name.
& to detach process from the console.
You can stop the process later using pkill command.
Further information about dzen parameters,
you can read in manual page in github.
I mean not in
man dzen2, from the command line.
Simple dzen2 in Script
Let’s put this dzen in a script
And examine the output.
Again, let’s give some color in generated output,
And let’s also refactor between the panel and output,
And again examine the output, with color and transparency.
Font in dzen2
^fn() can be used to show
Unicode Character, e.g. Japanese Number with Takao Font
Eye Candy Icons, e.g. AwesomeIcon Font
Powerline Style Arrow, e.g. PowerlineSymbols
You need to get these font installed properly in your system. Or maybe or just put proper font in your .font directory.
Here is a working example:
Graphic Decoration in dzen2
^i() can be used to show
Graphic Decoration, more than Powerline Style Arrow
Eye Candy Glyph Icons
There are many limitation, on using PowerlineSymbol as decoration.
And it is not portable enough, when the font is not always installed.
If you need a more precise decoration,
you might consider icon feature in Dzen2,
Here is a working example:
Dzen2 can read
.xbm image format.
For your convenience, I have made some eight glyph icons.
For each has height of 24px, the same height as dzen panel.
Create Decoration for Your own Suite.
Everybody has different requirement, taste and style.
Instead of giving
I’d better give the Source Image. And explain the creation process.
The creation process has been explained in previous chapter. I only use use Inkscape and GIMP with very few steps. And yeah, very simple process.
You can use Dzen2 as monitoring panel. Let’s make a more complete segment, than just a date.
For convenience you can make your script themable. I just made a quick and dirty after midnight script, that maybe useful for dzen2 theming. I do not claim that my script here is a good script, just because it is just works. But you should get my point, that with a little tweak, theming is possible. In fact, I desire to find a better script, and I wait for you to write it. I’m sure you can do better than me.
Let’s see how the variation goes.
After all, it depends on your imagination.
"Use the source Luke"
Combine Dzen with Tiling Window Manager
This is outside of the basic scope of configuring Dzen. But you can see my unfinished code here for my HerbstluftWM.
Using Dzen2 with Conky Lua
This is a very interesting topic. Conky is less complicated, and Lua can help you more. But since we need to leave BASH for Lua. This deserve an article of its own.
I think that’s all. Thank you for reading. Sorry for my english. I know how terrible it is.