Get in touch!

Latest News

August 2017 Dzen Presentation Summary

This past August, I had the pleasure of giving my first talk. The topic was Dzen. A great little utility you can find in just about any Unix like operating system that supports X11. This post will illustrate the most basic examples of how Dzen works. For more information please refer to my slides and the scripts that I posted.

Requirements and Outcome

Dzen's only real requirement is X11 and knowledge of a scripting language. It is a simple X application that will display whatever you pipe into it into an X window. Most people tend to use Dzen to build custom panels or status bars, but you could really use it for anything that you'd use an X window for. Some people have built notification systems, some have even built alternative box style contextual menus similar to what you might find in openbox or fluxbox. The examples I presented, show the process I went through to build my own personal panel. The end result can be seen in the screenshot below (click for hi res image).

Hello World!

Please note that I used BASH for all my examples but you can substitute bash with your scripting language of choice. The basic structure of a dzen command looks something like this. You pipe some data into dzen and then specify the dzen window size, placement and duration options (-w = width -h = height -x = x axis -y = y axis)

Dzen also allows for inline formatting options. The general idea is very similar to css. You can set your default styles in your dzen command, but put your overrides in the string that you pipe into dzen. This becomes useful when you want to do things like use one font for text and another for icon glyphs (check out NerdFonts). A few of the common ones are listed below.

^fn(fontname:weight:size)

^fg(foreground color)

^bg(background color)

Updating Data

If you want to display data that gets continuously updated, you can use a loop.

Putting it Together

You can put all of these together and build something like a color coded battery level indicator. The example script is battery.sh . The script switches colors and icons depending on the battery level and the battery's charge state. The end result will look like this...

More About Dzen

As I stated at the beginning of this post, these are just the basics of what was covered at the Dzen presentation. If you would like to go through more examples please refer to my slides and the corresponding scripts in the repo.