Rofi: A window switcher, application launcher and dmenu replacement
A quick bug-fix release to fix 3 small issues.
This makes it clear we need more people testing the development version to catch these bugs. I only use a very limited set of features myself and do not have the time nor energy to write and maintain a good automated test setup. There was one in the past that tested some basic features by running rofi, inputting user input and validating output. But it was not reliable and difficult to keep running.
Big thanks to everybody reporting issues. Special thanks goes to:
Apologies if I mistyped or missed anybody.
Another maintenance and small features expansion release. A lot of small annoyances have been fixed and ignored errors are now more visually flagged to the user. In the past typos in the theme could result into broken themes without any warning to the user (except in debug mode), if an unknown link is found it will now throw an error. To help the user find the right documentation, the manpages are further split up into sub-pages and are expanded
We now have:
Another improvement made that can have huge impact on the user-experience is a significant speedup in the async input reading of dmenu. It turned out glib's GInputStream async methods are very slow. On large input sets where it was supposed to improve the user experience, it made it unusable. To resolve this a custom implementation has been made. Background loading is now close to the same speed as loading at start before displaying. A million item list is now near instant. On very large lists, the instant filtering automatically changes to be postponed until the user stops typing. This severely reduces system load and interface blocking.
A few long standing feature requests and bug reports have been implemented or fixed:
for i in {1..90}; do echo $i; done | rofi -dmenu -no-config -theme-str 'listview { columns: 3; flow: vertical; }'
for i in {1..90}; do echo $i; done | rofi -dmenu -no-config -theme-str 'listview { columns: 3; flow: horizontal; }'
configuration {
run,drun {
fallback-icon: "application-x-addon";
}
}
echo -en "\0theme\x1felement-text { background-color: red;}\n"
$XDG_CONFIG_HOME/rofi/scripts
directory
are automatically available in rofi.rofi -h
<snip>
Detected user scripts:
• hc (/home/qball/.config/rofi/scripts/hc.sh)
</snip>
This script can now by shows by running rofi -show hc
.
echo -en "testing\0icon\x1f<span color='green'>Test</span>" | rofi -dmenu
listview {
require-input: true;
}
You can now add a separate icon or textbox widget to the UI that displays the
current selected item. As an example see the included sidebar-v2
.
A bug was fixed that caused problems with newer xkeyboard-config versions and different keyboard layouts.
Below is a more complete list of changes:
-config
to -help
output. (#1665)new-selection
(#1064).-dump-config
in config. (#1609)display-columns
and display-column-separator
option.enabled
that supports an environment variable.Big thanks to everybody reporting issues. Special thanks goes to:
Apologies if I mistyped or missed anybody.
A small intermediate release with a few fixes, mostly in documentation and two great additions by Jakub Jiruta:
v1.7.3:
Big thanks to everybody reporting issues. Special thanks goes to:
Apologies if I mistyped or missed anybody.
A quick in between release, a bug got fixed that (after fixing) caused configurations not working any more in theme files. While this is the desired behaviour, this release reverts it to avoid breaking to many setups.
v1.7.2:
Big thanks to everybody reporting issues. Special thanks goes to:
Apologies if I mistyped or missed anybody.
This release focusses on fixing bugs found in 1.7.0. The most important ones are fixing sizing bug, fix nested media statements and broken close-on-delete. There are a few new features to help themeing: We now support env(ENV,default) statement and when dumping a theme theme-names are resolved (f.e. green, lightblue, etc.).
Thanks to everybody reporting bugs, providing patches that made this release possible.
Because of an earlier bug that allowed unintended behavior that got fixed there are two things that might need to be fixed in the config file. Apologies, it was not intended to break previous working configurations.
Themes should affect theming, not configuration. A configuration {}
block in the theme is not allowed. Please move this into your config.rasi.
This:
configuration {
theme: "mytheme";
}
should be
configuration {
}
@theme "mytheme"
Make sure there is no trailing ;
at the end of the @theme
line.
For a more complete list of changes see below.
[Theme] Fix highlight with only theme.
Updated documentation and landing page (Thanks to RaZ0rr-Two)
[Combi] Fix nesting combi modi (#1510)
[DMenu] Fix crash dmenu mode when no entry is available. (#1504)
[Run|Drun] Only initialize file-completer on first use.
[FileBrowser] Reduce number of re-allocs.
[Readme] Remove generating readme.html for dist.
[Dmenu] Fix uninitialized memory (non-selectable)
[FileBrowser] Try to convert invalid encoded text. (#1471)
[FileBrowser] Don't crash on invalid file filenames. (#1471)
[Theme] print known colors as its color name.
[CMD] If failed to convert commandline to new option, do not stop. (#1425)
[Theme] Fix parsing of nested media blocks. (#1442)
[Widgets] Fix sizing logic widgets. (#1437)
[Window] Try to fix auto-sizing of desktop names for non-i3 desktops. (#1439)
[Window] Fix broken close-on-delete. (#1421)
[Listview] Correctly check if selected item is highlighted. (#1423)
[Entry] Allow action to be taken on input change. (#1405)
[Theme] Don't truncate double values. (#1419)
[Grammar] Add support for env(ENV,default).
[Documentation] documentation fixes.
[Theme] fix dmenu theme ( #1396).
Thanks
Big thanks to everybody reporting issues. Special thanks goes to:
Iggy
RaZ0rr-Two
Quentin Glidic
Danny Colin
Tuure Piitulainen
Apologies if I mistyped or missed anybody.
Rofi 1.7.0 is another bug-fix release that also removes a lot of deprecated features. One of the biggest changes is the removal of the (deprecated) xresources based configuration setup. With this removal, also a lot of hack-ish code has been removed that tried to patch old config setups. While the deprecation might be frustrating for people who have not yet converted to the new format, I hope for some understanding. Even though this move might not be popular, the deprecation in previous releases and consequential removal of these options is needed for two reasons. The most important one is to keep rofi maintainable and secondary to open possibility to overhaul the config system in the future and with that fixing some long standing bugs and add new options that where hindered by the almost 10 year old system, the new system has been around for more than 4 years.
Beside mostly bug-fixes and removal of deprecated options, we also improved the theming and added features to help in some of the more 'off-script' use of rofi.
This release was made possible by many contributors, see below for a full list. Big thanks again to SardemFF7 and TonCherAmi.
In older version of rofi the default theme was (almost) always loaded based on some unclear rules, sometimes some random patch code was loaded and sometimes no theme was loaded before loading another theme.
The current version of rofi this is hopefully more logic. It loads the default
theme by default using the default configuration. (Can be disabled by -no-default-config
).
Using -theme
, or @theme
primitive will discard the theme completely.
So the below css completely removes the default theme, and loads iggy
.
configuration {
}
@theme "iggy"
element {
children: [element-icon, element-text];
}
TonCherAmi made several very nice usability improvements to the file-browser. His changes allow you to define sorting and ordering of the entries and changing the default start directory.
These options can be set using the new 'nested' configuration format that we are testing in rofi:
configuration {
filebrowser {
/** Directory the file browser starts in. */
directory: "/some/directory";
/**
* Sorting method. Can be set to:
* - "name"
* - "mtime" (modification time)
* - "atime" (access time)
* - "ctime" (change time)
*/
sorting-method: "name";
/** Group directories before files. */
directories-first: true;
}
}
In rofi 1.7.0 a long awaited patch I wrote many years ago landed into the rofi.
This patch adds some basic completion support by chaining modi. Currently it
only supports chaining the FileBrowser mode. This allows you to launch an
application with a file as argument. This is currently supported in the Run
and the DRun modi by pressing the Control-l
keybinding. For the Run mode it
will add it as first argument, in DRun it only works if the Desktop file
indicates support for this.
This is not the final implementation, but a first investigation in how to add/extend this feature. Ideally you can have multiple completers (including custom ones) you can choose from.
You can now configure an action to be taken when rofi has not been interacted with for a certain amount of seconds. You can specify a keybinding to trigger after X seconds.
This option can be set using the new 'nested' configuration format that we are testing in rofi:
configuration {
timeout {
delay: 15;
action: "kb-cancel";
}
}
This setting will close rofi after 15 seconds of no interaction.
configuration {
timeout {
delay: 5;
action: "kb-accept";
}
}
This setting will accept the current selection after 5 seconds of no interaction.
To improve theming the background-image
property was added with support for
setting images url()
or a gradient linear-gradient()
.
window {
background-image: url("/tmp/i3.png", both);
}
element {
children: [element-icon, element-text];
background-image: linear-gradient(to bottom, black/20%, white/20%, black/10%);
}
The below screenshot shows both background image and gradients.
Or a more subtle change is the gradient on the tabs here:
icon-paste {
expand: false;
filename: "gtk-paste";
size: 24;
vertical-align: 0.5;
action: "kb-primary-paste";
}
button-paste {
expand: false;
content: "My Clickable Message";
vertical-align: 0.5;
action: "kb-primary-paste";
}
The screenshot below shows a non-squared image and clickable buttons (the close icon in the top right)
Explicitly steal focus from from the current window and restore it on closing. Enabling this might break the window switching mode.
Allow for nested configuration options, this allows for options to be grouped.
configuration {
timeout {
delay: 15;
action: "kb-cancel";
}
combi {
display-name: "Combi";
}
}
A quick work-around for handling old-style dynamic options. This should be resolved when all options are converted to the new (internal) config system.
configuration {
application_fallback_icon: "my-icon";
}
If you have an icon widget you can specify an image that exists in the theme directory.
window {
background-image: url("iggy.jpg", width);
}
See above.
Support KDE service desktop files.
See above.
This matching method matches each entered word to start of words in the target entry.
By default all icons are squared, this can now be disabled. The icon will occupy the actual space the image occupies.
See above.
This combines the custom and alt keybinding. Allowing a custom command to be launched in terminal.
Automatically select the entry under the mouse cursor.
See above.
Force markup on text widgets.
-rasi-validate
)Add support for setting the mouse cursor on widgets. For example the entry cursor on the textbox, or click hand cursor on the entry.
element,element-text,element-icon, button {
cursor: pointer;
}
Allows you to scale the background-image
on width, height and both.
See above example.
See above.
Allows you to use pango-markup in the window format option.
configuration {
window {
close-on-delete: false;
}
}
Given how the lexer and the grammar parser interact, the reset did not happen at the right point in the parsing process, causing unexpected behaviour.
Broken desktop files could cause a rofi crash.
Fix opening files with special characters that needs to be escaped.
Fixes theming of element-index
.
The quick switch between modi was broken when on a script mode. This now by default works, unless the mode overrides this.
This should fix themes that mix differently sized fonts.
An old pre-1.6.1 rasi theme should work with the following section added:
element-text {
background-color: inherit;
text-color: inherit;
}
This fixes the long broken feature of dashed borders.
message {
padding: 1px ;
border-color: var(separatorcolor);
border: 2px dash 0px 0px ;
}
FIX: [Build] Fix CI.
FIX: [Theme] Discard old theme, when explicitly passing one on command line.
In previous version there was a bug when passing -theme
on commandline did not discard old theme.
This caused problems loading themes (as it merged two themes instead of loading them).
To get old behaviour on commandline do:
rofi -theme-str '@import "mytheme"' -show drun
Big thanks to:
Apologies if I mistyped or missed anybody.
Rofi 1.6.1 is another bug-fix release in the 1.6 series. This release fixes a few issues with 1.6.0, most important the crash with drun-cache and resolving some issues that the default theme had on some systems. There are a few minor new features introduced.
To make themes more adoptable to different setups, @media
statements can now be nested and support for min/max
operation in calc()
has been added.
The file-browser plugin is now integrated in rofi.
More then 2 years after the 1.5.0 release and a year after 1.5.4, we present rofi 1.6.0. This release is again focusses bug-fixing and improving the experience for themers and script developers. The script mode has been extended with many small requested tweaks to get it more on par with dmenu mode. For themers the listview has been made more flexible, allowing more fancy themes, for examples mimicking Gnomes application launcher or albert.
Big thanks to SardemFF7 and all the other contributors, without their support and contributions this release would not have been possible.
Rofi now communicates some information back to the script using environment variables.
The most important one, is ROFI_RETV
, this is equal to the return value in dmenu mode.
It can have the following values:
To fully read up on all features of script mode, there is now a rofi-script(5)
manpage.
Some of the new features are:
To test some of the features:
#!/usr/bin/env bash
if [ -z "${ROFI_OUTSIDE}" ]
then
echo "run this script in rofi".
exit
fi
echo -en "\x00no-custom\x1ftrue\n"
echo -en "${ROFI_RETV}\x00icon\x1ffirefox\x1finfo\x1ftest\n"
if [ -n "${ROFI_INFO}" ]
then
echo "my info: ${ROFI_INFO} "
fi
There have been a set of tweaks to the theme format, making it more flexible and hopefully more themer-friendly.
This is one of the biggest change, instead of the listview having a hacked textbox as elements. It now re-uses existing widgets like box, icon and textbox. This way you can re-structure how it looks. For example put the icon above the text.
With theme:
element {
orientation: vertical;
}
This will make the box element
put element-icon
and element-text
in a vertical list.
or change the ordering to show icon on the right:
element {
children: [element-text, element-icon];
}
This causes a breaking change for themes, to modify the highlighting, this should be set to element-text
.
Or inherited. element-text { highlight: inherit; }
.
If you override the build in theme, you might want to set icon size:
element-icon {
size: 1.2em ;
}
Rofi adds CSS like calculations in the CSS format for distances. You can now set the width of the window to the screen width minus a 10 pixels.
window {
width: calc(100% - 10px);
}
It supports: -
, +
, /
, *
and %
operators and they should be surrounded by whitespace.
This is a very initial implementation of CSS like @media
support. This allows you to modify the theme
based on screen size or ratio.
We currently support: minimum width, minimum height, maximum width, maximum height, monitor id, minimum acpect ratio or maximum acpect ratio.
For example, go to fullscreen mode on screens smaller then full HD:
@media (max-width: 1920 ) {
window {
fullscreen: true;
}
}
themes/
directory in the users rofi config directory to the theme search path. (#1001)ROFI_PLUGIN_PATH
variable.XDG_CONFIG_DIRS
(#1133)-keep-right
flag. (#1089)ROFI_INFO
environment.calc()
support. (#1105)Quick bug-fix release to fix a crasher in SSH dialog.
Rofi 1.5.3 is another bug-fix release in the 1.5 series.
There is one breaking change in the theme naming and there are a few small new features (tweaks) in this release.
The selection buttons to select between the different modi was still called sidebar
a remnant from the past.
This has now been renamed to mode-switcher
.
Just like in window,drun and script modi you can add icons to the list in dmenu mode.
The syntax is similar to the script modi:
echo -en "Firefox\0icon\x1ffirefox\ngimp\0icon\x1fgimp" | rofi -dmenu -no-config -show-icons
The entries are separated by a \n
newline (normal dmenu behaviour).
The extra parameters can be added after a \0
null character, the key and value are separated by a \x1f
unit
separator character.
If you have very long entries in your view that get ellipsized (cut off at the end indicated by ...) you can now select, at runtime, where they are cut off (start, middle or end).
You cycle through the options with the the alt+.
keybinding.
Start:
Middle:
End:
The full list of fixes and updates: