Rofi 0.15.2 Release

Another months, another Rofi release. This release cycle the focus lay on improving maintainability and bug fixes. The downside of this release is broke some configuration and command-line settings. So please read the manpage before updating.

Maintainability

Configuration parser

To improve maintainability, the command-line parser and the Xresource parser are now merged . They use the same definition set for the configuration options. This will make adding options easier, and guarantees that the options are consistent. This change should not impact the user directly.

Launching modi

Since July there been duplicate code to launch a modi, there was the ‘-now’ or ‘-rnow’ and the ‘-show modi’ option. The first ones have been removed. While changing this, also the keybinding options have been changed. Instead of having hard-coded options for window,run and ssh you can now set a binding for any modi. --key-<modi> *key*.

Example to launch run dialog:

    rofi -show run

Example to start Rofi in daemon mode and set ssh launcher keybinding:

    rofi -key-ssh alt-F3

This now also works for custom mode:

    rofi -key-calc alt-F1 --modi "calc:qcalc"

This fixes bug 128.

Code restructuring

The internal code has been split out and restructured over multiple files. All the code for the different modi, i3-support and more have been separated. This biggest file now only has 1266 lines of code. Every mode has it own file, and the same goes for shared functionality (like X11 wrappers, history, etc.).

Some statistics (at the time of writing):

     Code    Comment  Comment %      Blank      Total  File
---------  ---------  ---------  ---------  ---------
      309         77      19.9%         60        446  x11-helper.c
      101         39      27.9%         18        158  i3-support.c
      522         80      13.3%         83        685  textbox.c
      179         66      26.9%         27        272  history.c
      314         92      22.7%         32        438  helper.c
      152         58      27.6%         30        240  ssh-dialog.c
      207         57      21.6%         45        309  run-dialog.c
      119         30      20.1%         22        171  script-dialog.c
       67         31      31.6%         14        112  dmenu-dialog.c
      310         94      23.3%         67        471  window-dialog.c
     1266        367      22.5%        162       1795  rofi.c
      270         40      12.9%         38        348  xrmoptions.c
       19        112      85.5%         14        145  helper.h
        9         46      83.6%          8         63  history.h
        6         21      77.8%          5         32  i3-support.h
       79        118      59.9%         16        213  rofi.h
       67        144      68.2%         31        242  textbox.h
       47         67      58.8%         21        135  x11-helper.h
       18         36      66.7%          7         61  xrmoptions.h
        6         10      62.5%          4         20  dmenu-dialog.h
        4          8      66.7%          2         14  run-dialog.h
       11         26      70.3%          5         42  script-dialog.h
        4          8      66.7%          2         14  ssh-dialog.h
        4          0       0.0%          2          6  window-dialog.h

Having only a little over 4000 lines of code is not bad for a project like this.

Bug Fixes

Because nobody is perfect, and this goes double for me, there have been a few bug-fixes as well.

Word movement/deletion

This was a long open issues from when work was done on keybindings. After another bug report came up for this it was time to fix. The fix is not perfect (this is suspiciously hard to do right when you read the UTF-8 specs.) but it seems to be working good enough ™.

This fixes bug 125.

Documentation updates

With big thanks to several contributers, several documentation bugs have been resolved.

This fixes bug: 123, 116, 124, etc.

Slow start-up issues

Here a multiple of things are fixed. There was a problem with Rofi sometimes missing a key-entry, when it was slow to respond (mostly appearing on start-up). This has been fixed. A second issue that arose was a (small) delay grabbing the keyboard when launching. This delay was around 100-500ms and once you notice it, very annoying. This has now been ‘hidden’ by making the grabbing happen non-blocking, so Rofi can continue drawing the window.

Duplicate instances

Rofi now uses a PID-file with file-locking to avoid running multiple instances of itself. In the past it was very easy to launch two instances simultaneous, they would both compete for the keyboard and mouse, once one had successfully grabbed it, the other would give up and quit after 1 second. This was not ideal, but most people did not notice. With the previous fix, this actually became a more serious issue. This PID file should solve this.

Auto select mode

This re-introduces the previously removed zeltak mode. If enabled when filtering one item remains it is automatically selected.

Removed features

HMode

This was a lot of ugly if-statements for code that did not reliably work and most of the time gave an ugly result. After nursing it for a while and people trying and failing to fix it, I decided to remove it.

Download

As always, the release can be found on the Rofi website or on github.

Contributers

Big thanks to all contributers who made this release possible:

Logo

I am still looking for an application icon/logo for Rofi.