Home

Awesome

Codacy Badge Build Status codecov.io Issues Forks Stars Downloads Coverity Forum

A window switcher, Application launcher and dmenu replacement

Rofi started as a clone of simpleswitcher, written by Sean Pringle - a popup window switcher roughly based on superswitcher. Simpleswitcher laid the foundations, and therefore Sean Pringle deserves most of the credit for this tool. Rofi (renamed, as it lost the simple property) has been extended with extra features, like an application launcher and ssh-launcher, and can act as a drop-in dmenu replacement, making it a very versatile tool.

Rofi, like dmenu, will provide the user with a textual list of options where one or more can be selected. This can either be running an application, selecting a window, or options provided by an external script.

Its main features are:

Rofi has several built-in modes implementing common use cases and can be extended by scripts (either called from Rofi or calling Rofi).

Below is a list of the different modes:

Window Switcher

Window List

The window switcher shows the following informations in columns (can be customized):

  1. Desktop name
  2. Window class
  3. Window title

Window mode features:

Application launcher

run mode

The run mode allows users to quickly search for and launch a program.

Run mode features:

Desktop File Application launcher

The desktop run mode allows users to quickly search and launch an application from the freedesktop.org Desktop Entries. These are used by most Desktop Environments to populate launchers and menus. Drun mode features:

SSH launcher

SSH Launcher

Quickly ssh into remote machines. Parses ~/.ssh/config to find hosts.

Script mode

Loads external scripts to add modes to Rofi, for example a file-browser.

rofi  -show fb -modi fb:../Examples/rofi-file-browser.sh

COMBI mode

Combine multiple modes in one view. This is especially useful when merging the window and run mode into one view. Allowing to quickly switch to an application, either by switching to it when it is already running or starting it.

Example to combine Desktop run and the window switcher:

rofi -combi-modi window,drun -show combi -modi combi

dmenu replacement

DMENU replacement (running teiler)

Drop in dmenu replacement. (Screenshot shows rofi used by teiler ).

Rofi features several improvements over dmenu to improve usability. There is the option to add an extra message bar (-mesg), pre-entering of text (-filter), or selecting entries based on a pattern (-select). Also highlighting (-u and -a) options and modi to force user to select one provided option (-only-match). In addition to this, rofi's dmenu mode can select multiple lines and write them to stdout.

Usage

If used with -show [mode], rofi will immediately open in the specified [mode].

If used with -dmenu, rofi will use data from STDIN to let the user select an option.

For example, to show a run dialog:

rofi -show run

To show a ssh dialog:

rofi -show ssh

dmenu

If rofi is passed the -dmenu option, or run as dmenu (ie, /usr/bin/dmenu is symlinked to /usr/bin/rofi), it will use the data passed from STDIN.

~/scripts/my_script.sh | rofi -dmenu
echo -e "Option #1\nOption #2\nOption #3" | rofi -dmenu

In both cases, rofi will output the user's selection to STDOUT.

Switching Between Modi

Type Shift-/Left/Right to switch between active modi.

Key bindings

KeyAction
Ctrl-v, InsertPaste from clipboard
Ctrl-Shift-v, Shift-InsertPaste primary selection
Ctrl-wClear the line
Ctrl-uDelete till the start of line
Ctrl-aMove to beginning of line
Ctrl-eMove to end of line
Ctrl-f, RightMove forward one character
Alt-f, Ctrl-RightMove forward one word
Ctrl-b, LeftMove back one character
Alt-b, Ctrl-LeftMove back one word
Ctrl-d, DeleteDelete character
Ctrl-Alt-dDelete word
Ctrl-h, Backspace, Shift-BackspaceBackspace (delete previous character)
Ctrl-Alt-hDelete previous word
Ctrl-j,Ctrl-m,EnterAccept entry
Ctrl-n,DownSelect next entry
Ctrl-p,UpSelect previous entry
Page UpGo to the previous page
Page DownGo to the next page
Ctrl-Page UpGo to the previous column
Ctrl-Page DownGo to the next column
Ctrl-EnterUse entered text as a command (in ssh/run modi)
Shift-EnterLaunch the application in a terminal (in run mode)
Shift-EnterReturn the selected entry and move to the next item while keeping Rofi open. (in dmenu)
Shift-RightSwitch to the next modi. The list can be customized with the -modi option.
Shift-LeftSwitch to the previous modi. The list can be customized with the -modi option.
Ctrl-TabSwitch to the next modi. The list can be customized with the -modi option.
Ctrl-Shift-TabSwitch to the previous modi. The list can be customized with the -modi option.
Ctrl-spaceSet selected item as input text.
Shift-DelDelete entry from history.
graveToggle case sensitivity.
Alt-graveToggle levenshtein sort.
Alt-Shift-STake a screenshot and store it in the Pictures directory.

For the full list of key bindings, see: rofi -show keys or rofi -help.

Configuration

There are currently three methods of setting configuration options:

A distribution can ship defaults in /etc/rofi.conf.

The Xresources options and the command line options are aliased. To define option X set:

`rofi.X: value`

In the Xresources file. To set/override this from command line pass the same key prefixed with '-':

`rofi -X value`

To get a list of available options formatted as Xresources entries, run:

`rofi -dump-Xresources`

or in a more readable format:

`rofi -help`

The configuration system supports the following types:

The Boolean option has a non-default command line syntax, to enable option X you do:

`rofi -X`

to disable it:

`rofi -no-X`

Manpage

For more detailed information, please see the manpage, the wiki, or the forum.

Installation

Please see the installation guide for instructions on how to install Rofi.

What is rofi not?

Rofi is not: