Polybar 3.5.0 Release

02 Dec 2020 -- Polybar Team

Good Things Take Time

Polybar version 3.5.0 is finally here! With 17 months since the 3.4.0 release, this has been the longest time between two larger polybar releases. To make up for it, this release has more changes, new features, and bugfixes than any other release since we started creating release changelogs.

A total of 32 contributors have worked on this release. Through 183 commits, they changed 164 files, added 5451, and deleted 2409 lines of code. We were able to fix over 19 bugs, some of which have been around for quite a long time.

You can download the release tarball here.

What’s New?

A lot of work this release went into cleaning up and replacing internal mechanisms, but this did help us fix a few bugs and implement new features.

I will go over some of the bigger changes here. You can read the full changelog on GitHub.

First off, polybar now has a properly specified configuration syntax. Before, things were very brittle, the config parser was inconsistent and would break due to the smallest changes (for example having an extra whitespace after header sections) while allowing clearly illegal constructs. The config syntax specification is available at man 5 polybar (if you have version 3.5.0) and in our documentation. The syntax itself didn’t change, we now just exactly define what is allowed and what is not.

We have also completely reworked how actions from click events (for example opening the menu module) are delivered to modules. This change isn’t really visible to you, except that you should now update the menu module to use the new action names (see the migration guide below). But it allowed us to fix a longstanding bug where you couldn’t have multiple modules of the same type on the bar (for example multiple menu or mpd modules) because clicks on one module were handled by the other module. This change has the upside that you can now finally have multiple menu modules on the same bar. We now also publicly expose module actions to programmatically trigger module behavior (this was possible before, but now it is actually documented). You can learn more about what actions are and how to use them here

If you have ever written your own menu module to launch applications, you have probably noticed that polybar freezes until the launched application finishes. The canonical solution for this was to background the program with &. In addition, programs launched through polybar crashed as soon as they produced any kind of output to stdout or stderr. Here, the solution was to redirect all program output to /dev/null. This lead to almost all commands run through polybar having an ugly >/dev/null 2>&1 & attached to the end to solve both issues above. Well, no longer! All programs launched through polybar click or scroll events now run as if they were run through some application launcher and no longer crash or make polybar freeze up.

And finally, the xworkspaces module can now detect occupied workspaces and use label-occupied for them. The label was already available before, it was just never used.

Migration Guide

When updating from 3.4.X to 3.5.0 your configs should still work the same as before unless you are using a now forbidden character in one of your config section header or key names. You can see the list of forbidden characters here.

Because of the rework of the module action system, you should update your config and all your scripts that use the old action names. If you use the menu module, your config definitely uses old action names. Our documentation goes through how this works step-by-step.

Also look at the changelog for any config options that might have been deprecated.

Next Steps

With 3.5.0 we started using a new workflow to create releases. Hopefully this helps us publish releases more often by removing some of the overhead.

Have a look at our milestone for 3.6.0 for what we would like to do for the next release. All of this is subject to change of course, I am not going to make the same mistake again and promise lots of new things and then not deliver on the next release.

Stay safe everyone! — The Polybar Team

Comments