This series is written by a representative of the latter group, which is comprised mostly of what might be called "productivity users" (perhaps "tinkerly productivity users?"). Though my lack of training precludes me from writing code or improving anyone else's, I can, nonetheless, try and figure out creative ways of utilizing open source programs. And again, because of my lack of expertise, though I may be capable of deploying open source programs in creative ways, my modest technical acumen hinders me from utilizing those programs in what may be the most optimal ways. The open-source character, then, of this series, consists in my presentation to the community of open source users and programmers of my own crude and halting attempts at accomplishing computing tasks, in the hope that those who are more knowledgeable than me can offer advice, alternatives, and corrections. The desired end result is the discovery, through a communal process, of optimal and/or alternate ways of accomplishing the sorts of tasks that I and other open source productivity users need to perform.

Friday, January 4, 2013

Ninth Installment: Xmobar to the rescue!

Regular readers of this blog will be aware of my inclination towards minimalist desktops or window managers and my preference, within reasonable limits, for low-resource and/or command-line tools and applications. And I've previously mentioned making use lately of the evilwm window manager, which I've pretty much settled on now in preference to two other minimalist window manages--dwm and ion3--with which I experimented. One of the things I've missed, however, about the more full-blown desktops I've used, is some of the monitors or applets one can configure to run in the panel(s) and which give quite helpful system information like memory and/or CPU usage.

I became aware some time ago of conky, a minimalistic utility that can display these--and many other--types of helpful information under differing window managers or desktops and, though I'd seen screenshots of it configured to run as a sort of panel, most conky configurations I've come across actually have it display on the desktop background--not something particularly desirable for me since I tend to run applications full-screen on my evilwm desktops. But lately, I somehow came across information about another utility--Xmobar--that can display the sorts of system information I want but which seems to be configured to run mainly as a panel. So I decided to have a go with it. I was able to configure it to my liking fairly easily and decided to offer in this entry a further description of the program and to post the configuration I am using. That information follows.

To begin with a bit more information on Xmobar, it seems originally to have been written to complement the minimalist window manager Xmonad (which, incidentally, I've not tried). As the Arch Wiki entry--my main source for setting up and configuring Xmobar--informs us, it is written, as is Xmonad, in the Haskell programming language. In case you might be intimidated at the prospect of potentially having to learn something about that programming language, take heart; as the wiki entry further elucidates "while xmobar is written in Haskell, no knowledge of the language is required to install and use it."

As with many other GNU/Linux utilities, Xmobar relies on a hidden configuration file--named, predictably, .xmobarrc--located in the user's home directory. The Arch wiki contains a sample configuration file, and that's the one on which I based my initial experiments with Xmobar.

To start Xmobar, I simply call it as the last line in my .xinitrc file. That will, of course, not be the universally applicable way of starting the utility: those using a log-in manager will undoubtedly need to invoke the utility in some other way. Being the  GUI-adverse type I am, however, this is what works for me.

Below I include a screenshot of the lower section of one of my desktops, which shows Xmobar running as it is currently configured on one of my systems.

Though a good deal will be obvious from the picture, I will nonetheless offer a verbal description of each section of the panel. After the description, I will provide the content of my .xmobarrc file for further reference.

On the left side of the panel we see, on the far left, of course, a CPU meter of sorts (CPU percentage meter). Next to that is the memory meter, showing percentage of main RAM and swap in use. Then follows a network meter showing current upload/download speed: the dash to the left indicates Xmobar did not find eth0 since, in the instance when the screenshot was taken, no network cable was attched to it. After the network speed indicator follows a keyboard layout indicator: at the moment the US keyboard layout is in use, but I also have Russian and Greek keyboards configured for this machine (more on keyboard layouts and switching between them in a future entry).

On the right side of the panel is seen first the date and time. Next to that is a battery meter that displays percentage of battery charge left as well as estimated remaining time; the screenshot comes from a laptop, of course. That is followed by a location indicator and outside temperature reading: I happened to be near the town of Mikkeli in Finland at the time I wrote this entry--thus the EFMI weather station code in the configuration file below. Finally, the kernel version and distribution are listed--this being derived, of course, from uname output.

Below, then, is the content of my .xmobarrc file. I added a few tweaks to the one I found on the Arch Wiki, mainly the battery meter as well as the keyboard layout indicator. I also did a bit of color tweaking since it seemed to me the section dividers (the pipe character--|) needed to be in a different color so as to more readily draw attention to the field delimitations. A bottom rather than top orientation was more to my liking, so I made that modification as well.

I am thus far quite happy with Xmobar. At the same time, I would be interested to hear from conky users who have their layout configured as a panel like this. Feel free to pipe in with your input on these or other minimalist panel utilities.


  1. I am using i3 and conky.

    In my i3 config I have

    # Start i3bar to display a workspace bar (plus the system information i3status
    # finds out, if available)
    bar {
    position top
    status_command conky
    font -xos4-terminus-medium-r-normal--12-120-72-72-C-60-iso8859-1

    My .conkyrc is

    out_to_x no
    use_xft yes
    xftfont Terminus:size=8
    background no
    out_to_console yes
    update_interval 5
    total_run_times 0
    use_spacer none
    #no_buffers yes
    double_buffer yes
    cpu_average_samples 1
    net_average_samples 1

    ${time %H:%M:%S} ${time %e.%m.%G} ${rss 30 item_titles 1 } CPU ${cpu cpu0} RAM ${memperc} ROOT ${fs_used_perc /}% SWAP ${swapperc}% HOME ${fs_used_perc /home}% ${fs_used /home}/${fs_size /home} up ${upspeedf eth0}kb/s ${totalup eth0} down ${downspeedf eth0}kb/s ${totaldown eth0}

  2. Xmobar is fine I have also tried it, but personally I like to show lots of information regarding my computer and to fit and display this all in a panel would not be easy nor practical (unless I doubled its width or perhaps had a widescreen monitor. Thus I use conky, and minimize any full-screen window to see it.