In the Part 5 of the FreeBSD Desktop series I would like to describe key components of self made custom desktop environment such as:

Window Manager

Status Bar

Task Bar

Wallpaper Handling

Application Launcher

Keyboard/Mouse Shortcuts

Locking Solution

Blue Light Spectrum Suppress

Today we will focus on the second part – the Status Bar. In the next series each of these components configuration would also be described along with eventual needed scripts.

You may want to check other articles in the FreeBSD Desktop series on the FreeBSD Desktop – Global Page where you will find links to all episodes of the series along with table of contents for each episode’s contents.

Status Bar

Also known as information bar, the place on the screen that would provide You needed information such as current date and time, CPU, RAM and storage usage, current network information or battery status. Such function can be done by dozens of open source solutions, but we will limit ourselves only to fast and low on resources ones. The list of potential solutions contains:

Conky

Dzen2

Xmobar

Polybar

Having tested all of them the Dzen2 and Conky seems to be the best solutions but I finally settled with Dzen2 for a various reasons that I will describe in a moment. While Xmobar is nice solution it comes with about 2 GB of dependencies of Haskell and Haskell libraries, keeping those on disk just to run ‘tiny’ status bar does not seem sensible not ‘light’.

Here is example of Xmobar in action.

While Polybar can look very nice on screenshots it is a lot more heavy on resources and is limited only to modules/features that were implemented in it.

Here is some more advanced Polybar setup.

Also the Polybar uses almost three times more RAM then Dzen2 and will use similarly more CPU time.

USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND vermaden 27560 0.0 0.2 41056 20544 8 S+ 11:17 0:00.21 polybar vermaden 10522 2.4 0.1 12876 8192 - S 11:21 0:00.07 dzen2

This left us with Conky and Dzen2. I have used Conky for quite long time but after recent tests I made Dzen2 is a lot less on resources then Conky while doing the same thing. The other even more important measure is battery time on a laptop. With same interval, exactly same look output and using same external scripts the laptop would run 5:19 using Conky but it will run 5:43 when running Dzen2. Almost 25 minutes more of battery time with same features is enough for me to switch to Dzen2.

PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 85291 vermaden 3 52 0 53484K 7500K select 2 2:52 0.29% conky 85289 vermaden 1 20 0 47452K 7524K select 3 0:41 0.00% dzen2

Of course if You want to plot gauges for CPU or RAM or possibly bars for filesystems usage then only Conky provides such features, but if You use text to present information, then Dzen2 provides similar features with lower footprint.

Example Conky setup.

The Dzen2 also offers feature that Conky does not offer. If you would like to implement refresh interval of 30 seconds for example (not so often) and also refresh that information everytime you ‘click’ on the status bar (or by other action) its possible to implement in Dzen2 using mkfifo(1) command. Its not possible to achieve with Conky. Why anyone would want to implement such ‘strange’ refresh policy? To get more battery life as often You do not need this information to be one only at most one second behind reality (refresh every second) and if You need it you refresh it manually and have the needed information. The other reason is ‘focus’. If this status bar refreshes every second, then it ‘caches’ your attention, this may prevent you from focusing deep enough on the task you are currently doing. If you do something important that requires focus then You do not want status bar (or anything else) to distract you with useless at the moment information.

Now Dzen2 configured similarly to Conky and Xmobar.

EOF