2014-08-01 17:29:01 -04:00
# ROFI 1 rofi
2014-05-22 04:37:25 -04:00
2014-08-01 17:29:01 -04:00
## NAME
2014-05-22 04:37:25 -04:00
2021-06-08 16:02:29 -04:00
**rofi** - A window switcher, application launcher, ssh dialog, dmenu replacement and more
2014-05-22 04:37:25 -04:00
2014-08-01 17:29:01 -04:00
## SYNOPSIS
2014-05-22 04:37:25 -04:00
2017-07-22 15:11:46 -04:00
**rofi** [ -show *mode* ]|[ -dmenu ]|[ -e *msg* ] [ CONFIGURATION ]
2014-05-22 04:37:25 -04:00
2014-08-01 17:29:01 -04:00
## DESCRIPTION
2022-07-31 10:28:05 -04:00
**rofi** is an X11 pop-up window switcher, run dialog, dmenu replacement, and
more. It focuses on being fast to use and have minimal distraction. It supports
keyboard and mouse navigation, type to filter, tokenized search and more.
2014-05-22 04:37:25 -04:00
2014-08-01 17:29:01 -04:00
## USAGE
2014-05-22 04:37:25 -04:00
2022-04-14 14:45:37 -04:00
**rofi**'s main functionality is to assist in your workflow, allowing you to
quickly switch between windows, start applications or log into a remote machine
via `ssh` . There are different *modes* for different types of actions. **rofi**
is a standalone application and should not be integrated into scripts. For
integration into scripts it has a special mode that functions as a (drop-in)
replacement for **dmenu(1)** . See emulating dmenu below.
2016-12-14 03:26:12 -05:00
### Running rofi
2015-04-05 15:49:55 -04:00
2015-09-02 17:49:08 -04:00
To launch **rofi** directly in a certain mode, specify a mode with `rofi -show <mode>` .
2022-04-14 14:45:37 -04:00
To show the `drun` dialog:
```bash
rofi -show drun
```
A very useful setup in minimalistic window managers is to combine `drun` , `run`
with `window` mode:
```bash
rofi -show combi -modes combi -combi-modes "window,drun,run"
```
In this setup it first list all open applications, then all installed
applications. So if you type firefox and hit return, it will switch to the
running firefox, or launch it when it is not running.
2015-04-05 15:49:55 -04:00
2015-04-05 16:00:27 -04:00
### Emulating dmenu
2022-07-31 10:28:05 -04:00
**rofi** can emulate **dmenu(1)** (a dynamic menu for X11) when launched with
the `-dmenu` flag.
2015-04-05 16:00:27 -04:00
2021-12-17 05:13:29 -05:00
For more information see **rofi-dmenu(5)** .
2017-07-22 15:11:46 -04:00
### Display Error message
2017-08-13 13:19:19 -04:00
**rofi** error dialog can also be called from the command line.
2017-07-22 15:11:46 -04:00
rofi -e "my message"
Markup support can be enabled, see CONFIGURATION options.
2016-12-14 03:26:12 -05:00
## CONFIGURATION
2014-08-01 17:29:01 -04:00
2016-03-05 14:52:46 -05:00
There are currently three methods of setting configuration options (evaluated in order below):
2015-04-21 16:17:20 -04:00
2021-06-01 04:32:58 -04:00
* System configuration file (for example `/etc/rofi.rasi` ).
2021-08-26 16:42:39 -04:00
It first checks `XDG_CONFIG_DIRS` , and then `SYSCONFDIR` (that is passed at compile time).
2020-04-19 06:10:14 -04:00
It loads the first config file it finds, it does not merge multiple system configuration files.
2017-07-22 16:14:15 -04:00
* Rasi theme file: The new *theme* format can be used to set configuration values.
2015-04-25 11:40:01 -04:00
* Command-line options: Arguments passed to **rofi** .
2015-04-21 16:17:20 -04:00
2021-08-26 16:42:39 -04:00
To get a template config file, run: `rofi -dump-config > config.rasi`
2015-04-21 16:17:20 -04:00
2021-06-08 16:02:29 -04:00
This will contain (commented) all current configuration options, modified options are uncommented.
2015-04-21 16:17:20 -04:00
2022-03-31 11:24:50 -04:00
To get a template config file that sets the icon-theme run: `rofi -icon-theme hicolor -dump-config` .
It is **strongly** recommended to use this as a starting point for your configuration.
An empty configuration section in the config file looks like:
```css
configuration {
// set config options here
}
```
Most of the configuration options mentioned below (beside options like `-show` ,
`-dump-config` that apply to a single run) can be set here.
For example to set the dpi value to 72:
```css
configuration {
dpi: 72;
}
```
2015-04-21 16:17:20 -04:00
The configuration system supports the following types:
2017-08-13 13:19:19 -04:00
* string
* integer (signed and unsigned)
* char
2021-06-07 17:13:21 -04:00
* boolean
2021-05-04 14:08:54 -04:00
* lists
2015-04-21 16:17:20 -04:00
2021-08-26 16:42:39 -04:00
For the syntax of these options, see the **rofi-theme(5)** manpage.
2021-06-01 04:32:58 -04:00
2021-08-26 16:42:39 -04:00
For use on the command line, Boolean options have a non-default command-line
2021-06-01 04:32:58 -04:00
syntax. Example to enable option X:
2015-04-21 16:17:20 -04:00
2015-04-25 11:40:01 -04:00
-X
2015-04-21 16:17:20 -04:00
2016-12-14 03:26:12 -05:00
To disable option X:
2015-04-21 16:17:20 -04:00
2015-04-25 11:40:01 -04:00
-no-X
2015-04-21 16:17:20 -04:00
Below is a list of the most important options:
2015-05-24 01:48:04 -04:00
### General
2015-04-21 16:17:20 -04:00
2015-11-25 03:16:30 -05:00
`-help`
2022-07-31 10:28:05 -04:00
The help option shows the full list of command-line options and the current set
values. These include dynamic (run-time generated) options.
2015-11-25 03:16:30 -05:00
2020-05-10 09:44:29 -04:00
`-version`
Show the **rofi** version and exit.
`-dump-config`
Dump the current active configuration, in rasi format, to stdout and exit.
Information about the rasi format can be found in the **rofi-theme(5)** manpage.
`-dump-theme`
Dump the current active theme, in rasi format, to stdout and exit.
2021-01-26 11:27:32 -05:00
`-rasi-validate` *filename*
2021-08-14 07:03:16 -04:00
Try to parse the file and return 0 when successful, non-zero when failed.
2021-01-26 11:27:32 -05:00
2022-09-18 14:28:38 -04:00
`-list-keybindings`
List all known keybindings without trying to parse them. This can be used to
look for duplicate bindings.
2015-11-25 10:53:58 -05:00
`-threads` *num*
Specify the number of threads **rofi** should use:
* 0: Autodetect the number of supported hardware threads.
* 1: Disable threading
2021-08-26 16:42:39 -04:00
* 2..n: Specify the maximum number of threads to use in the thread pool.
2015-11-25 10:53:58 -05:00
2021-06-08 17:02:14 -04:00
Default: Autodetect
2020-05-10 09:44:29 -04:00
`-display` *display*
The X server to contact. Default is `$DISPLAY` .
2014-10-20 14:29:26 -04:00
`-dmenu`
2015-09-03 18:27:34 -04:00
Run **rofi** in dmenu mode. This allows for interactive scripts.
In `dmenu` mode, **rofi** reads from STDIN, and output to STDOUT.
2017-08-13 13:19:19 -04:00
A simple example, displaying three pre-defined options:
2015-04-07 21:50:57 -04:00
2015-09-03 18:27:34 -04:00
echo -e "Option #1 \nOption #2 \nOption #3 " | rofi -dmenu
2015-04-07 21:50:57 -04:00
2015-09-03 18:27:34 -04:00
Or get the options from a script:
2015-04-07 21:50:57 -04:00
2015-09-03 18:27:34 -04:00
~/my_script.sh | rofi -dmenu
2015-04-07 21:50:57 -04:00
2022-02-13 06:22:25 -05:00
See the **rofi-dmenu(5)** manpage for more information.
2014-10-20 14:29:26 -04:00
`-show` *mode*
2022-07-31 10:28:05 -04:00
Open **rofi** in a certain mode. Available modes are `window` , `run` , `drun` ,
`ssh` , `combi` . The special argument `keys` can be used to open a searchable
list of supported key bindings
(see the **rofi-keys(5)** manpage)
2017-01-09 14:32:31 -05:00
2015-09-03 18:27:34 -04:00
To show the run-dialog:
2014-10-20 14:29:26 -04:00
2015-09-03 18:27:34 -04:00
rofi -show run
2014-10-20 14:29:26 -04:00
2022-02-23 16:42:56 -05:00
If `-show` is the last option passed to rofi, the first enabled modes is shown.
2021-06-08 16:02:29 -04:00
2022-02-23 16:42:56 -05:00
`-modes` *mode1,mode2*
2014-10-20 14:29:26 -04:00
2017-08-13 13:19:19 -04:00
Specify an ordered, comma-separated list of modes to enable.
2020-05-10 09:44:29 -04:00
Enabled modes can be changed at runtime. Default key is `Ctrl+Tab` .
If no modes are specified, all configured modes will be enabled.
To only show the `run` and `ssh` launcher:
2014-10-20 14:29:26 -04:00
2022-02-23 16:42:56 -05:00
rofi -modes "run,ssh" -show run
2014-10-20 14:29:26 -04:00
2022-07-31 10:28:05 -04:00
Custom modes can be added using the internal `script` mode. Each such mode has
two parameters:
2014-10-20 14:29:26 -04:00
2015-09-03 18:27:34 -04:00
< name > :< script >
2014-10-20 14:29:26 -04:00
2020-05-10 09:44:29 -04:00
Example: Have a mode called 'Workspaces' using the `i3_switch_workspaces.sh` script:
2014-10-20 14:29:26 -04:00
2022-02-23 16:42:56 -05:00
rofi -modes "window,run,ssh,Workspaces:i3_switch_workspaces.sh" -show Workspaces
2014-10-20 14:29:26 -04:00
2022-07-31 10:28:05 -04:00
Notes: The i3 window manager dislikes commas in the command when specifying an
exec command. For that case, `#` can be used as a separator.
2017-03-31 09:27:13 -04:00
2021-06-08 16:02:29 -04:00
**TIP**: The name is allowed to contain spaces:
2022-02-23 16:42:56 -05:00
rofi -modes "My File Browser:fb.sh" -show "My File Browser"
2021-06-08 16:02:29 -04:00
2015-01-12 08:13:46 -05:00
`-case-sensitive`
2021-08-26 16:42:39 -04:00
Start in case-sensitive mode.
2016-12-14 03:26:12 -05:00
This option can be changed at run-time using the `-kb-toggle-case-sensitivity` key binding.
2014-10-20 14:29:26 -04:00
2016-05-25 14:40:23 -04:00
`-cycle`
2017-11-23 12:41:52 -05:00
Cycle through the result list. Default is 'true'.
2016-05-25 14:40:23 -04:00
2015-08-20 15:42:53 -04:00
`-filter` *filter*
2015-09-03 18:27:34 -04:00
Filter the list by setting text in input bar to *filter*
2015-08-20 15:42:53 -04:00
2016-01-03 07:30:43 -05:00
`-config` *filename*
2017-08-13 13:19:19 -04:00
Load an alternative configuration file.
2016-01-03 07:30:43 -05:00
2019-02-08 14:43:53 -05:00
`-cache-dir` *filename*
Directory that is used to place temporary files, like history.
2016-02-17 14:29:23 -05:00
`-scroll-method` *method*
Select the scrolling method. 0: Per page, 1: continuous.
2015-01-19 09:49:23 -05:00
2020-09-30 15:56:37 -04:00
`-normalize-match`
2021-08-26 16:42:39 -04:00
Normalize the string before matching, so `o` will match `ö` , and `é` matches `e` .
This is not a perfect implementation, but works. For now, it disables highlighting of the matched part.
2020-09-30 15:56:37 -04:00
2017-02-02 13:00:45 -05:00
`-no-lazy-grab`
2017-01-07 04:35:36 -05:00
2017-02-02 13:00:45 -05:00
Disables lazy grab, this forces the keyboard being grabbed before gui is shown.
2017-01-07 04:35:36 -05:00
2017-04-21 03:48:03 -04:00
`-no-plugins`
Disable plugin loading.
`-plugin-path` *directory*
2017-08-13 13:19:19 -04:00
Specify the directory where **rofi** should look for plugins.
2017-04-21 03:48:03 -04:00
2017-11-01 17:01:05 -04:00
`-show-icons`
2020-05-10 09:44:29 -04:00
Show application icons in `drun` and `window` modes.
2017-11-01 17:01:05 -04:00
2018-06-09 16:17:32 -04:00
`-icon-theme`
2017-11-01 17:01:05 -04:00
2018-06-09 16:17:32 -04:00
Specify icon theme to be used.
2017-11-01 17:01:05 -04:00
If not specified default theme from DE is used, *Adwaita* and *gnome* themes act as
fallback themes.
2020-05-10 09:44:29 -04:00
`-markup`
Use Pango markup to format output wherever possible.
`-normal-window`
Make **rofi** react like a normal application window. Useful for scripts like Clerk that are basically an application.
2021-04-13 05:35:34 -04:00
`-[no-]steal-focus`
2021-03-27 11:28:27 -04:00
2021-04-13 05:35:34 -04:00
Make rofi steal focus on launch and restore close to window that held it when launched.
2021-03-27 11:28:27 -04:00
2022-04-20 15:53:44 -04:00
`-refilter-timeout-limit`
2022-08-21 09:47:49 -04:00
The time (in ms) boundary filter may take before switch from instant to delayed filter mode.
2022-04-20 15:53:44 -04:00
2022-08-21 09:47:49 -04:00
Default: 300
2022-04-20 15:53:44 -04:00
2022-05-12 13:52:35 -04:00
A fallback icon can be specified for each mode:
```css
configuration {
< mode > {
fallback-icon: "< icon name > ";
}
}
```
Example
```css
configuration {
run,drun {
fallback-icon: "application-x-addon";
}
}
```
2017-03-18 10:54:35 -04:00
### Matching
2016-08-25 02:43:40 -04:00
`-matching` *method*
2015-10-25 05:53:22 -04:00
2016-08-25 02:43:40 -04:00
Specify the matching algorithm used.
2021-08-26 16:42:39 -04:00
Currently, the following methods are supported:
2015-11-25 03:16:30 -05:00
2017-08-13 13:19:19 -04:00
* **normal**: match the int string
* **regex**: match a regex input
* **glob**: match a glob pattern
* **fuzzy**: do a fuzzy match
2021-05-29 07:39:31 -04:00
* **prefix**: match prefix
2015-11-25 03:16:30 -05:00
2017-01-09 14:32:31 -05:00
Default: *normal*
2016-08-25 02:43:40 -04:00
2017-01-09 14:32:31 -05:00
Note: glob matching might be slow for larger lists
2015-10-25 05:53:22 -04:00
`-tokenize`
Tokenize the input.
2020-05-10 09:44:29 -04:00
`-drun-categories` *category1* ,*category2*
2019-08-09 13:33:23 -04:00
Only show desktop files that are present in the listed categories.
2017-10-21 05:18:52 -04:00
`-drun-match-fields` *field1* ,*field2*,...
2020-05-10 09:44:29 -04:00
When using `drun` , match only with the specified Desktop entry fields.
2017-10-21 05:18:52 -04:00
The different fields are:
* **name**: the application's name
* **generic**: the application's generic name
2018-10-17 17:02:50 -04:00
* **exec**: the application's executable
2017-10-21 05:18:52 -04:00
* **categories**: the application's categories
2017-12-31 08:13:48 -05:00
* **comment**: the application comment
2021-08-26 16:42:39 -04:00
* **all**: all the above
2017-10-21 05:18:52 -04:00
2020-02-21 09:32:52 -05:00
Default: *name,generic,exec,categories,keywords*
2017-10-21 05:18:52 -04:00
2018-10-17 17:02:50 -04:00
`-drun-display-format`
2020-05-10 09:44:29 -04:00
The format string for the `drun` dialog:
2018-10-17 17:02:50 -04:00
* **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
2019-01-11 09:03:24 -05:00
Pango markup can be used to formatting the output.
Default: {name} [< span weight = 'light' size = 'small' > < i > ({generic})< / i > < / span > ]
2018-10-17 17:02:50 -04:00
2019-01-11 15:56:31 -05:00
Note: Only fields enabled in `-drun-match-fields` can be used in the format string.
2018-07-28 05:12:11 -04:00
`-[no-]drun-show-actions`
Show actions present in the Desktop files.
Default: false
2017-10-21 05:18:52 -04:00
`-window-match-fields` *field1* ,*field2*,...
2018-10-17 17:02:50 -04:00
When using window mode, match only with the specified fields.
2017-10-21 05:18:52 -04:00
The different fields are:
* **title**: window's title
* **class**: window's class
2018-10-17 17:02:50 -04:00
* **role**: window's role
2017-10-21 05:18:52 -04:00
* **name**: window's name
* **desktop**: window's current desktop
2021-08-26 16:42:39 -04:00
* **all**: all the above
2017-10-21 05:18:52 -04:00
Default: *all*
2019-05-19 13:15:54 -04:00
`-matching-negate-char` *char*
2021-08-26 16:42:39 -04:00
Set the character used to negate the query (i.e. if it does **not** match the next keyword).
2019-05-19 13:15:54 -04:00
Set to '\x0' to disable.
Default: '-'
2017-10-21 05:18:52 -04:00
2021-06-09 16:21:39 -04:00
### Layout and Theming
2021-06-08 16:58:27 -04:00
2021-06-09 16:21:39 -04:00
**IMPORTANT:**
In newer **rofi** releases, all the theming options have been moved into the new theme format. They are no longer normal
2021-08-26 16:42:39 -04:00
**rofi** options that can be passed directly on the command line (there are too many).
Small snippets can be passed on the command line: `rofi -theme-str 'window {width: 50%;}'` to override a single
2021-06-09 16:21:39 -04:00
setting. They are merged into the current theme.
They can also be appended at the end of the **rofi** config file to override parts of the theme.
2014-10-20 14:29:26 -04:00
2017-03-18 10:54:35 -04:00
Most of the following options are **deprecated** and should not be used. Please use the new theme format to customize
2017-08-13 13:19:19 -04:00
**rofi**. More information about the new format can be found in the **rofi-theme(5)** manpage.
2017-03-18 10:54:35 -04:00
2014-07-24 14:38:21 -04:00
`-location`
2014-05-22 04:37:25 -04:00
2015-09-03 18:27:34 -04:00
Specify where the window should be located. The numbers map to the following locations on screen:
2014-05-22 04:37:25 -04:00
2014-08-01 17:29:01 -04:00
1 2 3
8 0 4
7 6 5
2014-05-22 04:37:25 -04:00
2015-09-03 18:27:34 -04:00
Default: *0*
2015-01-19 09:49:23 -05:00
2014-05-22 04:37:25 -04:00
`-fixed-num-lines`
2021-08-30 10:11:36 -04:00
Keep a fixed number of visible lines.
2014-05-22 04:37:25 -04:00
2014-11-09 07:10:24 -05:00
`-sidebar-mode`
2021-08-26 16:42:39 -04:00
Open in sidebar-mode. In this mode, a list of all enabled modes is shown at the bottom.
2022-02-23 16:42:56 -05:00
(See `-modes` option)
2017-08-13 13:19:19 -04:00
To show sidebar, use:
2014-11-09 07:10:24 -05:00
2021-08-30 10:11:36 -04:00
rofi -show run -sidebar-mode
2014-11-09 07:10:24 -05:00
2021-04-13 05:45:20 -04:00
`-hover-select`
Automatically select the entry the mouse is hovering over. This option is best combined with custom mouse bindings.
To utilize hover-select and accept an entry in a single click, use:
rofi -show run -hover-select -me-select-entry '' -me-accept-entry MousePrimary
2020-03-31 12:07:43 -04:00
`-eh` *number*
Set row height (in chars)
Default: *1*
2015-02-24 11:34:25 -05:00
`-auto-select`
2015-09-03 18:27:34 -04:00
When one entry is left, automatically select it.
2015-02-24 11:34:25 -05:00
2015-08-02 09:45:52 -04:00
`-m` *num*
2016-08-19 04:46:38 -04:00
`-m` *name*
2015-08-02 09:45:52 -04:00
`-monitor` *num*
2016-08-19 04:46:38 -04:00
`-monitor` *name*
2016-08-20 05:22:18 -04:00
Select monitor to display **rofi** on.
2017-08-13 13:19:19 -04:00
It accepts as input: *primary* (if primary output is set), the *xrandr* output name, or integer number (in order of
detection). Negative numbers are handled differently:
2016-03-13 15:35:11 -04:00
* ** -1**: the currently focused monitor.
2017-08-13 13:19:19 -04:00
* ** -2**: the currently focused window (that is, **rofi** will be displayed on top of the focused window).
2021-08-26 16:42:39 -04:00
* ** -3**: Position of mouse (overrides the location setting to get normal context menu
2017-08-13 13:19:19 -04:00
behavior.)
2016-04-29 15:42:31 -04:00
* ** -4**: the monitor with the focused window.
* ** -5**: the monitor that shows the mouse pointer.
2015-08-17 12:32:17 -04:00
2016-08-19 12:01:26 -04:00
Default: *-5*
2015-08-02 09:45:52 -04:00
2017-08-13 13:19:19 -04:00
See `rofi -h` output for the detected monitors, their position, and size.
2016-08-19 04:46:38 -04:00
2017-01-18 12:12:54 -05:00
`-theme` *filename*
Path to the new theme file format. This overrides the old theme settings.
`-theme-str` *string*
2017-08-13 13:19:19 -04:00
Allow theme parts to be specified on the command line as an override.
2017-01-18 12:12:54 -05:00
2017-08-13 13:19:19 -04:00
For example:
2017-01-18 12:12:54 -05:00
rofi -theme-str '#window { fullscreen: true; }'
This option can be specified multiple times.
2021-08-26 16:42:39 -04:00
This is now the method to tweak the theme via the command line.
2017-01-18 12:12:54 -05:00
2017-01-21 06:58:52 -05:00
`-dpi` *number*
Override the default DPI setting.
2020-05-10 09:44:29 -04:00
* If set to `0` , it tries to auto-detect based on X11 screen size (similar to i3 and GTK).
* If set to `1` , it tries to auto-detect based on the size of the monitor that **rofi** is displayed on (similar to latest Qt 5).
2017-01-21 06:58:52 -05:00
2020-03-29 06:58:28 -04:00
`-selected-row` *selected row*
Select a certain row.
Default: *0*
2015-01-19 09:49:23 -05:00
### PATTERN setting
2014-05-22 04:37:25 -04:00
2014-10-20 14:29:26 -04:00
`-terminal`
2014-05-22 04:37:25 -04:00
2017-08-13 13:19:19 -04:00
Specify which terminal to start.
2014-08-01 17:29:01 -04:00
2015-09-03 18:27:34 -04:00
rofi -terminal xterm
2014-08-01 17:29:01 -04:00
2015-09-03 18:27:34 -04:00
Pattern: *{terminal}*
2020-05-10 09:44:29 -04:00
2015-09-03 18:27:34 -04:00
Default: *x-terminal-emulator*
2014-10-20 14:29:26 -04:00
2015-01-19 09:49:23 -05:00
`-ssh-client` *client*
2014-10-20 14:29:26 -04:00
2020-05-10 09:44:29 -04:00
Override the used `ssh` client.
2014-05-22 15:56:57 -04:00
2015-09-03 18:27:34 -04:00
Pattern: *{ssh-client}*
2020-05-10 09:44:29 -04:00
2015-09-03 18:27:34 -04:00
Default: *ssh*
2014-05-22 04:37:25 -04:00
2015-01-19 09:49:23 -05:00
### SSH settings
2014-09-03 07:07:26 -04:00
`-ssh-command` *cmd*
2021-08-26 16:42:39 -04:00
Set the command to execute when starting an ssh session.
2015-09-03 18:27:34 -04:00
The pattern *{host}* is replaced by the selected ssh entry.
2015-01-19 09:49:23 -05:00
2016-12-14 03:26:12 -05:00
Pattern: *{ssh-client}*
2020-05-10 09:44:29 -04:00
2015-09-03 18:27:34 -04:00
Default: *{terminal} -e {ssh-client} {host}*
2014-09-03 07:07:26 -04:00
2015-03-29 06:27:00 -04:00
`-parse-hosts`
2015-09-03 18:27:34 -04:00
Parse the `/etc/hosts` file for entries.
2015-03-29 06:27:00 -04:00
2015-10-31 12:26:13 -04:00
Default: *disabled*
`-parse-known-hosts`
`-no-parse-known-hosts`
Parse the `~/.ssh/known_hosts` file for entries.
Default: *enabled*
2014-10-20 14:29:26 -04:00
### Run settings
2014-09-03 07:07:26 -04:00
`-run-command` *cmd*
2015-09-03 18:27:34 -04:00
Set command (*{cmd}*) to execute when running an application.
See *PATTERN* .
2014-09-03 07:07:26 -04:00
2015-09-03 18:27:34 -04:00
Default: *{cmd}*
2015-01-19 09:49:23 -05:00
2022-11-21 11:20:11 -05:00
Example to run applications in a dedicated cgroup with systemd. Requires a shell to escape and interpolate the unit name correctly.
```
"bash -c 'systemd-run --user --unit=app-rofi-\$(systemd-escape {cmd})-\$RANDOM {cmd}'"
```
2014-09-03 07:07:26 -04:00
`-run-shell-command` *cmd*
2015-09-03 18:27:34 -04:00
Set command to execute when running an application in a shell.
See *PATTERN* .
2014-09-03 07:07:26 -04:00
2015-09-03 18:27:34 -04:00
Default: *{terminal} -e {cmd}*
2015-01-19 09:49:23 -05:00
2015-01-05 15:53:50 -05:00
`-run-list-command` *cmd*
2021-08-26 16:42:39 -04:00
If set, use an external tool to generate a list of executable commands. Uses `run-command` .
2015-01-05 15:53:50 -05:00
2017-08-13 13:19:19 -04:00
Default: *{cmd}*
2015-01-19 09:49:23 -05:00
2017-01-09 14:32:31 -05:00
### Window switcher settings
`-window-format` *format*
Format what is being displayed for windows.
*format*: {field[:len]}
*field*:
2017-08-13 13:19:19 -04:00
* **w**: desktop name
* **t**: title of window
* **n**: name
* **r**: role
* **c**: class
2017-01-09 14:32:31 -05:00
2022-10-03 13:13:22 -04:00
*len*: maximum field length (0 for auto-size). If length is negative, the entry will be unchanged.
2021-08-26 16:42:39 -04:00
If length is positive, the entry will be truncated or padded to fill that length.
2017-01-09 14:32:31 -05:00
default: {w} {c} {t}
2016-05-12 05:31:06 -04:00
`-window-command` *cmd*
2021-08-26 16:42:39 -04:00
Set command to execute on selected window for an alt action (`-kb-accept-alt`).
2016-05-12 05:31:06 -04:00
See *PATTERN* .
2019-01-21 12:08:11 -05:00
Default: *"wmctrl -i -R {window}"*
2016-05-12 05:31:06 -04:00
2020-04-29 06:59:49 -04:00
`-window-thumbnail`
Show window thumbnail (if available) as icon in the window switcher.
2021-08-17 12:23:35 -04:00
You can stop rofi from exiting when closing a window (allowing multiple to be closed in a row).
2021-08-17 12:16:25 -04:00
```css
configuration {
window {
close-on-delete: false;
}
}
```
2022-07-23 18:52:13 -04:00
You can hide the currently active window with the 'hide-active-window' setting:
```css
configuration {
window {
hide-active-window: true;
}
}
```
or pass `-window-hide-active-window true` on command line.
2022-10-22 05:03:11 -04:00
You can prefer the icon theme above the window set icon with the 'prefer-icon-theme' setting:
```css
configuration {
window {
prefer-icon-theme: true;
}
}
```
or pass `-window-prefer-icon-theme true` on command line.
2021-08-17 12:16:25 -04:00
2015-04-01 08:49:27 -04:00
### Combi settings
2022-02-23 16:42:56 -05:00
`-combi-modes ` *mode1* ,*mode2*
2015-04-01 08:49:27 -04:00
2022-02-23 16:42:56 -05:00
The modes to combine in combi mode.
For syntax to `-combi-modes` , see `-modes` .
2017-08-13 13:19:19 -04:00
To get one merge view, of `window` ,`run`, and `ssh` :
2015-04-01 08:49:27 -04:00
2022-02-23 16:42:56 -05:00
rofi -show combi -combi-modes "window,run,ssh" -modes combi
2015-04-01 08:49:27 -04:00
2021-08-26 16:42:39 -04:00
**NOTE**: The i3 window manager dislikes commas in the command when specifying an exec command.
For that case, `#` can be used as a separator.
2017-03-31 09:27:13 -04:00
2022-01-22 16:03:10 -05:00
`-combi-display-format`
The format string for entries in the `combi` dialog:
* **mode**: the mode display name
* **text**: the entry text
Pango markup can be used to formatting the output.
Default: {mode} {text}
2022-04-27 04:46:18 -04:00
Note: This setting is ignored if `combi-hide-mode-prefix` is enabled.
2022-01-22 16:03:10 -05:00
2014-10-20 14:29:26 -04:00
### History and Sorting
2014-09-03 07:07:26 -04:00
2014-06-05 15:55:47 -04:00
`-disable-history`
2015-04-19 07:19:20 -04:00
`-no-disable-history` (re-enable history)
2014-06-05 15:55:47 -04:00
2015-09-03 18:27:34 -04:00
Disable history
2014-06-05 15:55:47 -04:00
2017-10-03 13:51:27 -04:00
`-sort` to enable
`-no-sort` to disable
Enable, disable sorting.
This setting can be changed at runtime (see `-kb-toggle-sort` ).
2020-05-10 09:44:29 -04:00
`-sorting-method` 'method' to specify the sorting method.
2014-07-16 02:42:42 -04:00
2021-08-26 16:42:39 -04:00
There are 2 sorting methods:
2018-06-13 05:57:23 -04:00
* levenshtein (Default)
* fzf sorting.
2017-10-03 13:51:27 -04:00
2021-02-01 15:34:49 -05:00
`-max-history-size` *number*
2021-07-29 14:46:23 -04:00
Maximum number of entries to store in history. Defaults to 25. (WARNING: can cause slowdowns when set too high)
2014-07-16 02:42:42 -04:00
2020-04-16 17:31:43 -04:00
2014-10-20 12:11:10 -04:00
### Message dialog
`-e` *message*
2017-08-13 13:19:19 -04:00
Pops up a message dialog (used internally for showing errors) with *message* .
2015-09-03 18:27:34 -04:00
Message can be multi-line.
2014-10-19 13:42:02 -04:00
2021-06-05 08:22:48 -04:00
### File browser settings
2021-06-27 03:28:21 -04:00
File browser behavior can be controlled via the following options:
```css
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";
2021-07-10 17:58:27 -04:00
/** Group directories before files. */
directories-first: true;
2022-10-11 10:04:18 -04:00
/** Show hidden files. */
show-hidden: false;
2021-06-27 03:28:21 -04:00
}
}
```
2021-06-05 08:22:48 -04:00
2022-10-31 16:28:17 -04:00
The `show-hidden` can also be triggered with the `kb-delete-entry` keybinding.
2015-01-31 12:23:17 -05:00
### Other
2020-01-26 06:47:04 -05:00
`-drun-use-desktop-cache`
2020-05-10 09:44:29 -04:00
Build and use a cache with the content of desktop files. Usable for systems with slow hard drives.
2020-01-26 06:47:04 -05:00
`-drun-reload-desktop-cache`
2020-05-10 09:44:29 -04:00
If `drun-use-desktop-cache` is enabled, rebuild a cache with the content of desktop files.
2020-01-26 06:47:04 -05:00
2021-06-08 14:25:05 -04:00
`-drun-url-launcher` *command*
Command to open a Desktop Entry that is a Link.
2016-12-21 03:52:55 -05:00
`-pid` *path*
2015-01-31 12:23:17 -05:00
2017-08-13 13:19:19 -04:00
Make **rofi** create a pid file and check this on startup. The pid file prevents multiple **rofi** instances from running simultaneously. This is useful when running **rofi** from a key-binding daemon.
2015-01-31 12:23:17 -05:00
2021-12-22 15:03:54 -05:00
`-replace`
If rofi is already running, based on pid file, try to kill that instance.
2016-08-22 02:04:20 -04:00
`-display-{mode}` *string*
Set the name to use for mode. This is used as prompt and in combi-browser.
2021-08-14 07:03:16 -04:00
It is now preferred to use the configuration file:
2021-06-15 08:04:34 -04:00
```css
configuration {
{mode} {
display-name: *string* ;
}
}
```
2016-09-08 16:42:41 -04:00
`-click-to-exit`
`-no-click-to-exit`
2021-08-26 16:42:39 -04:00
Click the mouse outside the **rofi** window to exit.
2016-09-08 16:42:41 -04:00
Default: *enabled*
2022-07-19 09:44:29 -04:00
`-xserver-i300-workaround`
Workaround for bug in Xserver. See issue #611 and #1642 on the rofi issue tracker.
Default: *disabled*
2015-01-19 09:49:23 -05:00
## PATTERN
2014-09-03 07:07:26 -04:00
2017-08-13 13:19:19 -04:00
To launch commands (for example, when using the ssh launcher), the user can enter the used command-line. The following keys can be used that will be replaced at runtime:
2014-09-03 07:07:26 -04:00
2017-08-13 13:19:19 -04:00
* `{host}` : the host to connect to
2021-12-30 08:08:39 -05:00
* `{terminal}` : the configured terminal (see -terminal)
2017-08-13 13:19:19 -04:00
* `{ssh-client}` : the configured ssh client (see -ssh-client)
* `{cmd}` : the command to execute
* `{window}` : the window ID of the selected window (in `window-command` )
2014-05-22 04:37:25 -04:00
2014-11-05 04:27:46 -05:00
2015-04-22 15:03:02 -04:00
## THEMING
2015-04-06 16:17:05 -04:00
2021-06-09 16:21:39 -04:00
Please see **rofi-theme(5)** manpage for more information on theming.
2016-12-14 03:26:12 -05:00
2017-08-13 13:19:19 -04:00
## KEY BINDINGS
2014-05-22 04:37:25 -04:00
2022-02-13 06:22:25 -05:00
Please see the **rofi-keys(5)** manpage for the keybindings and how to set them up.
The keybinding can also be used for actions, when the action is executed the
mentioned keystroke is inserted:
2021-09-02 03:55:31 -04:00
### Timeout
You can 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.
```css
configuration {
timeout {
delay: 15;
action: "kb-cancel";
}
}
```
### Input change
When the input of the textbox changes:
```css
configuration {
inputchange {
action: "kb-row-first";
}
}
```
2022-02-23 16:42:56 -05:00
## Available Modes
2015-11-25 03:16:30 -05:00
2020-05-10 09:44:29 -04:00
### window
2015-11-25 03:16:30 -05:00
Show a list of all the windows and allow switching between them.
2016-12-14 03:26:12 -05:00
Pressing the `delete-entry` binding (`shift-delete`) will close the window.
2016-05-12 05:31:06 -04:00
Pressing the `accept-custom` binding (`control-enter` or `shift-enter` ) will run a command on the window.
2016-12-14 03:26:12 -05:00
(See option `window-command` );
2015-11-25 03:16:30 -05:00
2021-06-07 17:13:21 -04:00
If there is no match, it will try to launch the input.
2020-05-10 09:44:29 -04:00
### windowcd
2015-11-25 03:16:30 -05:00
Shows a list of the windows on the current desktop and allows switching between them.
2016-05-12 05:25:18 -04:00
Pressing the `delete-entry` binding (`shift-delete`) will kill the window.
2016-05-12 05:31:06 -04:00
Pressing the `accept-custom` binding (`control-enter` or `shift-enter` ) will run a command on the window.
2016-12-14 03:26:12 -05:00
(See option `window-command` );
2015-11-25 03:16:30 -05:00
2020-09-13 15:56:25 -04:00
If there is no match, it will try to launch the input.
2020-05-10 09:44:29 -04:00
### run
2015-11-25 03:16:30 -05:00
2020-05-10 09:44:29 -04:00
Shows a list of executables in `$PATH` and can launch them (optional in a terminal).
2016-12-14 03:26:12 -05:00
Pressing the `delete-entry` binding (`shift-delete`) will remove this entry from the run history.
2021-07-05 10:47:24 -04:00
Pressing the `accept-custom` binding (`control-enter`) will run the command as entered in the entry box.
Pressing the `accept-alt` binding (`shift-enter`) will run the command in a terminal.
2015-11-25 03:16:30 -05:00
2021-06-07 17:13:21 -04:00
When pressing the `mode-complete` binding (`Control-l`), you can use the File Browser mode to launch the application
with a file as the first argument.
2020-05-10 09:44:29 -04:00
### drun
2015-11-25 03:16:30 -05:00
Same as the **run** launches, but the list is created from the installed desktop files. It automatically launches them
in a terminal if specified in the Desktop File.
2016-12-14 03:26:12 -05:00
Pressing the `delete-entry` binding (`shift-delete`) will remove this entry from the run history.
2021-07-05 10:47:24 -04:00
Pressing the `accept-custom` binding (`control-enter`) will run the command as entered in the entry box.
Pressing the `accept-alt` binding (`shift-enter`) will run the command in a terminal.
2015-11-25 03:16:30 -05:00
2021-06-08 13:35:51 -04:00
When pressing the `mode-complete` binding (`Control-l`), you can use the File Browser mode to launch the application
passing a file as argument if specified in the desktop file.
2021-08-26 16:42:39 -04:00
The DRUN mode tries to follow the [XDG Desktop Entry
2021-06-07 17:13:21 -04:00
Specification](https://freedesktop.org/wiki/Specifications/desktop-entry-spec/) and should be compatible with
2021-08-26 16:42:39 -04:00
applications using this standard. Some applications create invalid desktop files, **rofi** will discard these entries.
See the debugging section for more info on DRUN mode, this will print why desktop files are
2021-06-07 17:13:21 -04:00
discarded.
2021-06-15 10:19:57 -04:00
There are two advanced options to tweak the behaviour:
```css
configuration {
drun {
/** Parse user desktop files. */
parse-user: true;
/** Parse system desktop files. */
parse-system: false;
}
}
```
2020-05-10 09:44:29 -04:00
### ssh
2015-11-25 03:16:30 -05:00
2020-05-10 09:44:29 -04:00
Shows a list of SSH targets based on your `ssh` config file, and allows to quickly `ssh` into them.
2015-11-25 03:16:30 -05:00
2020-05-10 09:44:29 -04:00
### keys
2016-10-20 16:56:17 -04:00
Shows a searchable list of key bindings.
2020-05-10 09:44:29 -04:00
### script
2015-11-25 03:16:30 -05:00
2022-02-23 16:42:56 -05:00
Allows custom scripted Modes to be added, see the **rofi-script(5)** manpage for more information.
2015-11-25 03:16:30 -05:00
2020-05-12 15:12:45 -04:00
### combi
2022-02-23 16:42:56 -05:00
Combines multiple modes in one list. Specify which modes are included with the `-combi-modes` option.
2020-05-12 15:12:45 -04:00
2022-02-23 16:42:56 -05:00
When using the combi mode, a *!bang* can be used to filter the results by modes.
All modes that match the bang as a prefix are included.
For example, say you have specified `-combi-modes run,window,windowcd` . If your
2020-05-12 15:12:45 -04:00
query begins with the bang `!w` , only results from the `window` and `windowcd`
2022-02-23 16:42:56 -05:00
modes are shown, even if the rest of the input text would match results from `run` .
2020-05-12 15:12:45 -04:00
2022-02-23 16:42:56 -05:00
If no match, the input is handled by the first combined modes.
2020-09-13 15:56:25 -04:00
2014-11-08 07:51:41 -05:00
## FAQ
2020-05-10 09:44:29 -04:00
### The text in the window switcher is not nicely aligned.
2014-11-08 07:51:41 -05:00
2022-07-31 10:28:05 -04:00
Try using a mono-space font or tabs + the tab-stops setting..
2014-11-08 07:51:41 -05:00
2016-11-04 14:41:52 -04:00
### The window is completely black.
2014-12-07 10:04:22 -05:00
2020-05-10 09:44:29 -04:00
Check quotes used on the command-line: you might have used `“` ("smart quotes") instead of `"` ("machine quotes").
2014-12-07 10:04:22 -05:00
2016-11-04 14:41:52 -04:00
### What does the icon in the top right show?
2015-12-14 15:02:36 -05:00
2016-04-03 08:56:23 -04:00
The indicator shows:
` ` Case insensitive and no sorting.
`-` Case sensitivity enabled, no sorting.
`+` Case insensitive and Sorting enabled
`±` Sorting and Case sensitivity enabled"
2015-12-14 15:02:36 -05:00
2022-01-22 08:20:16 -05:00
### Why do I see different icons for run,drun and window mode
Each of these modes uses different methods of resolving the icon:
* Window: It first uses the icon that the application exposes via the X11
Server, if none is set it does a lookup of the window Class name in the icon theme.
* drun: It uses the icon set in the desktop file.
* run: It does a lookup using the executable name.
2016-12-21 03:42:04 -05:00
## EXAMPLES
Some basic usage examples of **rofi** :
Show the run dialog:
2022-02-23 16:42:56 -05:00
rofi -modes run -show run
2016-12-21 03:42:04 -05:00
2020-05-10 09:44:29 -04:00
Show the run dialog, and allow switching to Desktop File run dialog (`drun`):
2016-12-21 03:42:04 -05:00
2022-02-23 16:42:56 -05:00
rofi -modes run,drun -show run
2016-12-21 03:42:04 -05:00
2020-05-10 09:44:29 -04:00
Combine the run and Desktop File run dialog (`drun`):
2016-12-21 03:42:04 -05:00
2022-02-23 16:42:56 -05:00
rofi -modes combi -show combi -combi-modes run,drun
2016-12-21 03:42:04 -05:00
2020-05-10 09:44:29 -04:00
Combine the run and Desktop File run dialog (`drun`), and allow switching to window switcher:
2016-12-21 03:42:04 -05:00
2022-02-23 16:42:56 -05:00
rofi -modes combi,window -show combi -combi-modes run,drun
2016-12-21 03:42:04 -05:00
2017-08-13 13:19:19 -04:00
Pop up a text message claiming that this is the end:
2016-12-21 03:42:04 -05:00
rofi -e "This is the end"
2017-08-13 13:19:19 -04:00
Pop up a text message in red, bold font claiming that this is still the end:
2016-12-21 03:42:04 -05:00
2017-11-18 06:40:05 -05:00
rofi -e "< span color = 'red' > < b > This is still the end< / b > < / span > " -markup
2016-12-21 03:42:04 -05:00
2017-08-13 13:19:19 -04:00
Show all key bindings:
2016-12-21 03:42:04 -05:00
rofi -show keys
2017-08-13 13:19:19 -04:00
## i3
2017-01-07 04:35:36 -05:00
2017-08-13 13:19:19 -04:00
In [i3 ](http://i3wm.org/ ) you want to bind **rofi** to be launched on key release. Otherwise, it cannot grab the keyboard.
See also the i3 [manual ](http://i3wm.org/docs/userguide.html ):
2017-01-07 04:35:36 -05:00
2020-05-10 09:44:29 -04:00
Some tools (such as `import` or `xdotool` ) might be unable to run upon a KeyPress event, because the keyboard/pointer is
2017-08-13 13:19:19 -04:00
still grabbed. For these situations, the `--release` flag can be used, as it will execute the command after the keys have
2017-01-07 04:35:36 -05:00
been released.
2015-04-22 15:03:02 -04:00
## LICENSE
2015-04-25 11:40:01 -04:00
MIT/X11
2015-05-24 01:48:04 -04:00
2015-04-25 11:40:01 -04:00
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
2015-05-24 01:48:04 -04:00
2015-04-25 11:40:01 -04:00
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
2015-05-24 01:48:04 -04:00
2015-04-25 11:40:01 -04:00
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2015-04-22 15:03:02 -04:00
2014-08-05 14:09:39 -04:00
## WEBSITE
2022-07-31 10:28:05 -04:00
**rofi** website can be found [here ](https://github.com/davatorium/rofi/ )
2014-08-03 15:51:31 -04:00
2016-12-23 04:31:52 -05:00
## SUPPORT
2014-09-06 08:57:30 -04:00
2021-06-07 17:13:21 -04:00
**rofi** support can be obtained:
2022-12-31 07:15:01 -05:00
2021-06-07 17:13:21 -04:00
* [GitHub Discussions ](https://github.com/davatorium/rofi/discussions )
* [IRC ](irc://irc.libera.chat:6697/#rofi ) (#rofi on irc.libera.chat),
2016-11-13 12:39:21 -05:00
2016-12-23 04:31:52 -05:00
## DEBUGGING
2022-04-11 05:19:34 -04:00
For more information see **rofi-debugging(5)** manpage.
2016-12-23 04:31:52 -05:00
## ISSUE TRACKER
2022-07-31 10:28:05 -04:00
The **rofi** issue tracker can be found [here ](https://github.com/davatorium/rofi/issues )
Before creating an issue, consider posting a question on the [discussion forum ](https://github.com/davatorium/rofi/discussions ) first.
When creating an issue, please read [this ](https://github.com/davatorium/rofi/blob/master/.github/CONTRIBUTING.md )
2016-12-23 04:31:52 -05:00
first.
2016-11-13 12:39:21 -05:00
## SEE ALSO
2022-07-04 02:29:39 -04:00
**rofi-sensible-terminal(1)**, **dmenu(1)** , **rofi-debugging(5)** , **rofi-theme(5)** , **rofi-script(5)** , **rofi-keys(5)** ,**rofi-theme-selector(1)**,**rofi-dmenu(5)**
2016-06-06 16:21:58 -04:00
2014-08-01 17:29:01 -04:00
## AUTHOR
2014-05-22 04:37:25 -04:00
2021-06-08 16:02:29 -04:00
* Qball Cow < qball @ blame . services >
2020-05-10 09:44:29 -04:00
* Rasmus Steinke < rasi @ xssn . at >
2022-02-26 11:02:26 -05:00
* Morgane Glidic < sardemff7 + rofi @ sardemff7 . net >
2016-06-06 16:21:58 -04:00
2021-06-08 16:02:29 -04:00
Original code based on work by: [Sean Pringle ](https://github.com/seanpringle/simpleswitcher ) < sean.pringle @ gmail . com >
2015-04-25 11:40:01 -04:00
2020-05-10 09:44:29 -04:00
For a full list of authors, check the `AUTHORS` file.