Rofi: A window switcher, application launcher and dmenu replacement
Rofi 1.5.2 is another bug-fix release in the 1.5 series.
Issue: #792, #783
There turned out to be a bug in how borders are drawn. It would overlap parts of the border on corners, screwing up transparency.
This is now fixed.
Issue: #860
Several bugs around Icon handling have been fixed:
Because of all the changes to the sorting methods in rofi, the command-line options for it where very confusing. To fix this they have been changed.
The sort
option is now used to enable/disable sorting. (This can also be changed at run-time using the hotkey)
The sorting-method
allows you to set the sorting method. Currently it supports normal (levenshtein) and fzf.
Issue: #879, #867, #837, #831, #804
Thanks to all the people highlighting or providing fixes to the documentation.
Issue: #820
The original known hosts parser was very limited. The parser has been extended to a bit more robust.
For some reason I can never make a release without adding more features to it. (Feature creep?).
Issue: #877
The option to negate a query: foo -bar
e.g. search for all items matching foo
but not bar
caused a lot of
confusion. It seems people often use rofi to also add arguments to applications (that start with a -).
To help with this, the negate character (-
) can be changed, or disabled.
To disable:
rofi -matching-negate-char '\0'
Issue: #858
An often requested feature is the ability to change the display string for the drun modi.
The -drun-display-format
option is added that allows just this.
-drun-display-format
The format string for the drun dialog:
- name: the application's name
- generic: the application's generic name
- exec: the application's executable
- categories: the application's categories
- comment: the application comment
Default: {name} [({generic})]
Items between []
are only displayed when the field within is set. So in the above example, the ()
are omitted when
{generic}
is not set.
You can use environment variables as part of your theme/configuration file property value.
Environment variables start with $
and the name is surrounded by {}
.
So to query the environment FOO
you can do:
#window {
background: ${FOO};
}
The environment is then parsed as a normal value.
Bug-fix release:
Changelog: - Egor Zvorykin: Fix typos in theme manpage. (#760) - Ben: Fix README config file location. (#761) - [SSH] Reload when ssh entry is deleted. - Add support for randr 1.5 monitors. (#749) - Diki Anata: Fix border layout structure. - Remove duplicate tests. (#543) - Fix make test in libnkutils.
After the last release turned out to be fairly large we are hopefully back to more regular, smaller releases. This release focuses on squashing some bugs and hopefully improving the user experience. Nevertheless this release also includes some new features.
Big thanks to SardemFF7, without whose help and contributions this release would not have been possible.
What field rofi should match on the drun view has been a source of long discussions, which resulted in new options to specify, which fields rofi should match against in either drun or window mode.
-drun-match-fields
field1,field2,...
When using drun, match only with the specified Desktop entry fields. The different fields are:
name: the application's name
generic: the application's generic name
exec: the application's executable
categories: the application's categories
comment: the application comment
all: all of the above
Default: name,generic,exec,categories
-window-match-fields
field1,field2,...
When using window mode, match only with the specified fields. The different fields are:
Default: all
To further improve script mode, support for passing properties has been added.
You can now set the prompt
, a message
or use markup
and active
/urgent
colors from the script itself.
E.g. to set the prompt from a bash mode script:
echo -en "\x00prompt\x1ftesting\n"
Or to mark the first 4 rows urgent and add a message:
echo -en "\x00urgent\x1f0-3\n"
echo -en "\0message\x1fSpecial <b>bold</b> message\n"
The urgent
and active
syntax is identical to the dmenu command-line argument.
The matching engine has been extended. It’s now possible to negate parts of the query. Searching for deconz -sh
will list all
fields that match deconz
but do not contain sh
.
In themes the '#' prefix before the element name is now optional. As well as not being needed, it made the multi-selector look weird.
Example:
entry,prompt {
background-color: DarkRed;
text-color: White;
}
Mouse button and scroll bindings are now separated and naming has changed.
For the 3 base buttons:
Mouse1
is now MousePrimary
Mouse2
is now MouseMiddle
Mouse3
is now MouseSecondary
For the scroll wheel:
Mouse4
is now ScrollUp
Mouse5
is now ScrollDown
Mouse6
is now ScrollLeft
Mouse7
is now ScrollRight
For extra buttons:
Mouse8
is now MouseBack
Mouse9
is now MouseForward
MouseExtra<number>
(replace <number>
).This is a controversial one, abeing the cause of heated discussions in the past. The prompt string of rofi is now left unmodified. Themes, like the default theme, can re-add the colon if desired.
inputbar {
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
}
textbox-prompt-colon {
expand: false;
str: ":";
margin: 0px 0.3em 0em 0em ;
}
Results in:
By frequent request, you can now tweak the size of the history each modi keeps. While not recommended to change it as it can cause performance issues, this allows power users to tweak it to their liking.
rofi.max-history-size: 500
This release contains some major changes. One of them being a new theme engine. The migration from older versions to this version might not go flawless.
With more then 750 commits since the last version, this is one of the biggest releases so far. In this version we used the groundwork laid in v1.3.0 and went completely nuts with it. Hopefully this release should satisfy the die-hard desktop ricers with a brand new theme engine. Lot of different colors, border, multiple fonts everything is now possible.
Because of The great work done by SardemFF7 the code base is simplified and the key and mouse handling improved. The libraries provided by SardemFF7 also made it possible to add a often requested feature of icons (correctly using the icon-theme). A feature I never expected to be added. To top this off, SardemFF7 added support to build rofi using meson.
A last big addition and still in beta, is support for plugins. Allowing the addition of some weird/fancy features. Currently two plugins are available, blezz a quick launch menu with it own menu definition and top displaying running processes.
Beside these major changes, this release includes a lot of bug-fixes and small improvements. See the bottom of this release notes for a more complete list of changes.
The biggest new feature of this release is the theme engine. Building on the changes made in v1.3.0 we implemented a new theme engine and it has a completely new theme format. While the themes are a lot more verbose now, it does allow for a lot of extra customizations.
It is now possible to theme each widget in rofi independently:
You can now set the color on each widget independent in most of the CSS supported color formats (hsl, cmyk, rgb, etc.) and each color can have a transparency. There are three colors that can be set on each widget:
On every widget we can now configure a border for each of the four sides, the color of the border, the style of the border (solid or dashed) and the radius of the corners can be set.
This combined with (fake) transparency can make for a very nice looking, rounded rofi experience.
An often made request was support for different fonts for the entry box and the list. With the new theme, it is possible to change the font and size of all widgets.
Note that opening a fonts is one of the slowest operations during rofi startup; having multiple fonts could have a significant impact on startup times.
To top all these changes, as an advanced feature the whole layout of the window can be changed. Making it possible to mimic the original dmenu view, or make it appear as a minimal context menu.
The new theme parser will also be more verbose when encountering parsing errors, hopefully helping debugging and modifying themes.
For example when forgetting a trailing ';' will report where it failed, and what it expected (a ';').
The new theme parser also support importing and overriding. This allow you to
make make modifications to an existing theme, without having to completely copy
it. For example, I want to use the arthur
theme (shipped with rofi) but use
fake transparency, change the font off the result list and import a set of
overriding colors from mycolors
.
// Import the default arthur theme
@theme "arthur"
// Load in overriding of colors from mycolors.
@import "mycolors"
/* on the window widget, set transparency to use a screenshot of the screen. */
#window {
transparency: "screenshot";
}
/* Override the font on the listview elements */
#element {
font: "Ubuntu Mono 18";
}
Another often made request, I never expected to be implemented, was icon
support. With the help of SardemFF7 an implementation was possible that
correctly follows the XDG icon specification and does not negatively impact the
performance. Currently the drun and the window switcher can application icons.
To enable icons, set the show-icons
property to true
.
Thanks to another great work of SardemFF7 you can now configure how the mouse behave and bind modifier keys. It also improves on error messages. For example it will now detect duplicate bindings.
For example to select an entry on single click, instead of double click:
rofi -show run -me-select-entry '' -me-accept-entry 'Mouse1'
With thanks to Fangrui Song, the fuzzy
matcher will now use a ranking similar
to fzf
to sort the results. This should hopefully to improve the results,
something a lot of users will appreciate.
Without:
With:
This feature is still in beta stage.
It is now possible to add custom mode via C plugins. This is allows interactive
modi to be added to rofi. For example it is possible to have top
(display
linux processes) mode:
This mode allows sorting of the result on different keys (cpu usage, memory, etc.) to be selected, programs to be killed and refreshes the results every 2 seconds.
See here.
This feature is in alpha stage.
The new theme format can now (as an alpha) feature be used to set rofi's
configuration. In the future, when we add wayland support, we want to get rid of
the current Xresources (X11) based configuration format. You can see how this
would look using: rofi -dump-config
.
-no-custom
mode.A quick follow up release to resolve some issues with copyright notices in the shipped rofi themes. Below is the, modest, full list of changes.
This release mostly focussed on cleaning up and refactoring the internals. One of the big changes is that the gui is no longer based on hard-coded positions. We introduced a widget system with boxes, scrollbars, separators, listview and textboxes. The boxes (vertical and horizontal) allows us to nice structure the layout and have them resize according to rules when the window changes size.
This allowed us to make changes at run-time. In the future I hope we can use this to improve the theming (think css like themes). The cleanup and refactoring is not finished and will continue for the next release.
Beside this we still managed to get some new features in:
Enabled by the refactoring, rofi can now resize the window to fit the number of visible entries, so as you type and the list of options becomes small, so does the windows (this is disabled by default). Rofi will try to keep the text box at the same place so you don't have to move focus, this means that at the bottom of the screen the window layout is reversed so the textbox is at the bottom.
To make it easier to get a good looking rofi, we included a theme-selector script and ship rofi with a set of themes. The script allows you to preview themes, and make them the default theme.
It seems byzanz (to record the gif) changes the colors a bit. It looks better in real-life.
On many request, the fuzzy matcher has been re-added:
Rofi can read input data for dmenu asynchronous from displaying. So if you have something that takes a time to produce,
you can see the progress, start filtering and selecting entries before it finishes.
This can be very useful when searching through large data sets.
In the below screenshot it keeps feeding rofi the content of the directory. Rofi indicates it is still receiving data by
the loading...
text.
Async mode is not always possible, and will be disabled if not possible.
In this release rofi is more efficient in drawing its content to the X11 window. The basic redraw on expose has been speedup by a factor 1000. This was obtained by using a server side copy of the internal surface, instead of painting it with cairo each time. Especially for large (4k and higher) screens, in fullscreen mode, this reduces redrawing from +- 180ms to 0.1 ms. A second improvement was made by configuring X11 not repaint the window background when resized, this caused some flickering (it was painted black before being drawn). It now keeps the old content and tells rofi to repaint. This causes trailing, but overall looks nicer.
We also removed a deprecated option, -opacity
. Did option did full window opacity, basically it makes the whole window
and text transparent. A very ugly effect. The current argb colors in the theme allow a nice transparency, where only the
background of the window is transparent but not the text (you can still reproduce the old style in the new theme format,
by making all colors transparent).
Despite me saying after every release that it is mostly feature complete; new Rofi, new features. However these new features are mostly to improve current functionality and debugging. Below the 4 most important ones.
A new, hopefully welcome, addition is that Rofi now highlights the match in each row:
To accomplish this, now all matching is done using GRegex, as this returns the exact location in the string of each match. While I don't see a direct use, it is something a lot of other quick search tools provide, so Rofi could not stay behind.
While already existing in a very rudimentary form, we now improved the multi-line select in dmenu mode. It will allow you to select and unselect rows, selected rows are highlighted with a dot and a small counter indicated the amount of rows selected.
You can now specify what the window switcher will show. It allows for some markup to nicely line up the entries.
For example if the with of the window is specified in characters, this would right align the class name
rofi.window-format: {t:-16} ({c:10})
Rofi now keeps track of how configuration options are set. It will now display if it is the default value, set in Xresources, configuration file or commnadline.
This should help debugging recent bugs, where people had an invalid pid
path set in the configuration file.
Additionally if you dump the configuration, for using on another pc, it will comment the options that are set to their
default value. (So f.e. pidfile location won't be overriden).
As no tool is without bugs, and Rofi not being the exception, we did manage to squash a few.
#include
in config file.Control-u
behaviour to remove till begin of line. Control-w
now whipes the line.Control-k
keybinding, delete till end of line.