2014-08-01 21:29:01 +00:00
# ROFI 1 rofi
2014-05-22 08:37:25 +00:00
2014-08-01 21:29:01 +00:00
## NAME
2014-05-22 08:37:25 +00:00
2021-06-08 20:02:29 +00:00
**rofi** - A window switcher, application launcher, ssh dialog, dmenu replacement and more
2014-05-22 08:37:25 +00:00
2014-08-01 21:29:01 +00:00
## SYNOPSIS
2014-05-22 08:37:25 +00:00
2017-07-22 19:11:46 +00:00
**rofi** [ -show *mode* ]|[ -dmenu ]|[ -e *msg* ] [ CONFIGURATION ]
2014-05-22 08:37:25 +00:00
2014-08-01 21:29:01 +00:00
## DESCRIPTION
2017-08-13 17:19:19 +00:00
**rofi** is an X11 pop-up window switcher, run dialog, dmenu replacement, and more. It focuses on
2015-01-19 14:49:23 +00:00
being fast to use and have minimal distraction. It supports keyboard and mouse navigation, type to
filter, tokenized search and more.
2014-05-22 08:37:25 +00:00
2014-08-01 21:29:01 +00:00
## USAGE
2014-05-22 08:37:25 +00:00
2022-04-14 18:45:37 +00: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 08:26:12 +00:00
### Running rofi
2015-04-05 19:49:55 +00:00
2015-09-02 21:49:08 +00:00
To launch **rofi** directly in a certain mode, specify a mode with `rofi -show <mode>` .
2022-04-14 18:45:37 +00: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 19:49:55 +00:00
2015-04-05 20:00:27 +00:00
### Emulating dmenu
2021-06-01 08:32:58 +00:00
**rofi** can emulate **dmenu(1)** (a dynamic menu for X11) when launched with the `-dmenu` flag.
2015-04-05 20:00:27 +00:00
2021-12-17 10:13:29 +00:00
For more information see **rofi-dmenu(5)** .
2017-07-22 19:11:46 +00:00
### Display Error message
2017-08-13 17:19:19 +00:00
**rofi** error dialog can also be called from the command line.
2017-07-22 19:11:46 +00:00
rofi -e "my message"
Markup support can be enabled, see CONFIGURATION options.
2016-12-14 08:26:12 +00:00
## CONFIGURATION
2014-08-01 21:29:01 +00:00
2016-03-05 19:52:46 +00:00
There are currently three methods of setting configuration options (evaluated in order below):
2015-04-21 20:17:20 +00:00
2021-06-01 08:32:58 +00:00
* System configuration file (for example `/etc/rofi.rasi` ).
2021-08-26 20:42:39 +00:00
It first checks `XDG_CONFIG_DIRS` , and then `SYSCONFDIR` (that is passed at compile time).
2020-04-19 10:10:14 +00:00
It loads the first config file it finds, it does not merge multiple system configuration files.
2017-07-22 20:14:15 +00:00
* Rasi theme file: The new *theme* format can be used to set configuration values.
2015-04-25 15:40:01 +00:00
* Command-line options: Arguments passed to **rofi** .
2015-04-21 20:17:20 +00:00
2021-08-26 20:42:39 +00:00
To get a template config file, run: `rofi -dump-config > config.rasi`
2015-04-21 20:17:20 +00:00
2021-06-08 20:02:29 +00:00
This will contain (commented) all current configuration options, modified options are uncommented.
2015-04-21 20:17:20 +00:00
2022-03-31 15:24:50 +00: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 20:17:20 +00:00
The configuration system supports the following types:
2017-08-13 17:19:19 +00:00
* string
* integer (signed and unsigned)
* char
2021-06-07 21:13:21 +00:00
* boolean
2021-05-04 18:08:54 +00:00
* lists
2015-04-21 20:17:20 +00:00
2021-08-26 20:42:39 +00:00
For the syntax of these options, see the **rofi-theme(5)** manpage.
2021-06-01 08:32:58 +00:00
2021-08-26 20:42:39 +00:00
For use on the command line, Boolean options have a non-default command-line
2021-06-01 08:32:58 +00:00
syntax. Example to enable option X:
2015-04-21 20:17:20 +00:00
2015-04-25 15:40:01 +00:00
-X
2015-04-21 20:17:20 +00:00
2016-12-14 08:26:12 +00:00
To disable option X:
2015-04-21 20:17:20 +00:00
2015-04-25 15:40:01 +00:00
-no-X
2015-04-21 20:17:20 +00:00
Below is a list of the most important options:
2015-05-24 05:48:04 +00:00
### General
2015-04-21 20:17:20 +00:00
2015-11-25 08:16:30 +00:00
`-help`
2020-05-10 13:44:29 +00:00
The help option shows the full list of command-line options and the current set values.
2016-12-14 08:26:12 +00:00
These include dynamic (run-time generated) options.
2015-11-25 08:16:30 +00:00
2020-05-10 13:44:29 +00: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 16:27:32 +00:00
`-rasi-validate` *filename*
2021-08-14 11:03:16 +00:00
Try to parse the file and return 0 when successful, non-zero when failed.
2021-01-26 16:27:32 +00:00
2015-11-25 15:53:58 +00: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 20:42:39 +00:00
* 2..n: Specify the maximum number of threads to use in the thread pool.
2015-11-25 15:53:58 +00:00
2021-06-08 21:02:14 +00:00
Default: Autodetect
2020-05-10 13:44:29 +00:00
`-display` *display*
The X server to contact. Default is `$DISPLAY` .
2014-10-20 18:29:26 +00:00
`-dmenu`
2015-09-03 22:27:34 +00: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 17:19:19 +00:00
A simple example, displaying three pre-defined options:
2015-04-08 01:50:57 +00:00
2015-09-03 22:27:34 +00:00
echo -e "Option #1 \nOption #2 \nOption #3 " | rofi -dmenu
2015-04-08 01:50:57 +00:00
2015-09-03 22:27:34 +00:00
Or get the options from a script:
2015-04-08 01:50:57 +00:00
2015-09-03 22:27:34 +00:00
~/my_script.sh | rofi -dmenu
2015-04-08 01:50:57 +00:00
2022-02-13 11:22:25 +00:00
See the **rofi-dmenu(5)** manpage for more information.
2014-10-20 18:29:26 +00:00
`-show` *mode*
2017-01-09 19:32:31 +00:00
Open **rofi** in a certain mode. Available modes are `window` , `run` , `drun` , `ssh` , `combi` .
2017-08-13 17:19:19 +00:00
The special argument `keys` can be used to open a searchable list of supported key bindings
(see *KEY BINDINGS* )
2017-01-09 19:32:31 +00:00
2015-09-03 22:27:34 +00:00
To show the run-dialog:
2014-10-20 18:29:26 +00:00
2015-09-03 22:27:34 +00:00
rofi -show run
2014-10-20 18:29:26 +00:00
2022-02-23 21:42:56 +00:00
If `-show` is the last option passed to rofi, the first enabled modes is shown.
2021-06-08 20:02:29 +00:00
2022-02-23 21:42:56 +00:00
`-modes` *mode1,mode2*
2014-10-20 18:29:26 +00:00
2017-08-13 17:19:19 +00:00
Specify an ordered, comma-separated list of modes to enable.
2020-05-10 13:44:29 +00: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 18:29:26 +00:00
2022-02-23 21:42:56 +00:00
rofi -modes "run,ssh" -show run
2014-10-20 18:29:26 +00:00
2020-05-10 13:44:29 +00:00
Custom modes can be added using the internal `script` mode. Each such mode has two parameters:
2014-10-20 18:29:26 +00:00
2015-09-03 22:27:34 +00:00
< name > :< script >
2014-10-20 18:29:26 +00:00
2020-05-10 13:44:29 +00:00
Example: Have a mode called 'Workspaces' using the `i3_switch_workspaces.sh` script:
2014-10-20 18:29:26 +00:00
2022-02-23 21:42:56 +00:00
rofi -modes "window,run,ssh,Workspaces:i3_switch_workspaces.sh" -show Workspaces
2014-10-20 18:29:26 +00:00
2021-08-26 20:42:39 +00: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 13:27:13 +00:00
2021-06-08 20:02:29 +00:00
**TIP**: The name is allowed to contain spaces:
2022-02-23 21:42:56 +00:00
rofi -modes "My File Browser:fb.sh" -show "My File Browser"
2021-06-08 20:02:29 +00:00
2015-01-12 13:13:46 +00:00
`-case-sensitive`
2021-08-26 20:42:39 +00:00
Start in case-sensitive mode.
2016-12-14 08:26:12 +00:00
This option can be changed at run-time using the `-kb-toggle-case-sensitivity` key binding.
2014-10-20 18:29:26 +00:00
2016-05-25 18:40:23 +00:00
`-cycle`
2017-11-23 17:41:52 +00:00
Cycle through the result list. Default is 'true'.
2016-05-25 18:40:23 +00:00
2015-08-20 19:42:53 +00:00
`-filter` *filter*
2015-09-03 22:27:34 +00:00
Filter the list by setting text in input bar to *filter*
2015-08-20 19:42:53 +00:00
2016-01-03 12:30:43 +00:00
`-config` *filename*
2017-08-13 17:19:19 +00:00
Load an alternative configuration file.
2016-01-03 12:30:43 +00:00
2019-02-08 19:43:53 +00:00
`-cache-dir` *filename*
Directory that is used to place temporary files, like history.
2016-02-17 19:29:23 +00:00
`-scroll-method` *method*
Select the scrolling method. 0: Per page, 1: continuous.
2015-01-19 14:49:23 +00:00
2020-09-30 19:56:37 +00:00
`-normalize-match`
2021-08-26 20:42:39 +00: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 19:56:37 +00:00
2017-02-02 18:00:45 +00:00
`-no-lazy-grab`
2017-01-07 09:35:36 +00:00
2017-02-02 18:00:45 +00:00
Disables lazy grab, this forces the keyboard being grabbed before gui is shown.
2017-01-07 09:35:36 +00:00
2017-04-21 07:48:03 +00:00
`-no-plugins`
Disable plugin loading.
`-plugin-path` *directory*
2017-08-13 17:19:19 +00:00
Specify the directory where **rofi** should look for plugins.
2017-04-21 07:48:03 +00:00
2017-11-01 21:01:05 +00:00
`-show-icons`
2020-05-10 13:44:29 +00:00
Show application icons in `drun` and `window` modes.
2017-11-01 21:01:05 +00:00
2018-06-09 20:17:32 +00:00
`-icon-theme`
2017-11-01 21:01:05 +00:00
2018-06-09 20:17:32 +00:00
Specify icon theme to be used.
2017-11-01 21:01:05 +00:00
If not specified default theme from DE is used, *Adwaita* and *gnome* themes act as
fallback themes.
2020-05-10 13:44:29 +00: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 09:35:34 +00:00
`-[no-]steal-focus`
2021-03-27 15:28:27 +00:00
2021-04-13 09:35:34 +00:00
Make rofi steal focus on launch and restore close to window that held it when launched.
2021-03-27 15:28:27 +00:00
2022-04-20 19:53:44 +00:00
`-refilter-timeout-limit`
The limit of elements that is used to switch from instant to delayed filter mode.
Default: 8192
2022-05-12 17:52:35 +00: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 14:54:35 +00:00
### Matching
2016-08-25 06:43:40 +00:00
`-matching` *method*
2015-10-25 09:53:22 +00:00
2016-08-25 06:43:40 +00:00
Specify the matching algorithm used.
2021-08-26 20:42:39 +00:00
Currently, the following methods are supported:
2015-11-25 08:16:30 +00:00
2017-08-13 17:19:19 +00:00
* **normal**: match the int string
* **regex**: match a regex input
* **glob**: match a glob pattern
* **fuzzy**: do a fuzzy match
2021-05-29 11:39:31 +00:00
* **prefix**: match prefix
2015-11-25 08:16:30 +00:00
2017-01-09 19:32:31 +00:00
Default: *normal*
2016-08-25 06:43:40 +00:00
2017-01-09 19:32:31 +00:00
Note: glob matching might be slow for larger lists
2015-10-25 09:53:22 +00:00
`-tokenize`
Tokenize the input.
2020-05-10 13:44:29 +00:00
`-drun-categories` *category1* ,*category2*
2019-08-09 17:33:23 +00:00
Only show desktop files that are present in the listed categories.
2017-10-21 09:18:52 +00:00
`-drun-match-fields` *field1* ,*field2*,...
2020-05-10 13:44:29 +00:00
When using `drun` , match only with the specified Desktop entry fields.
2017-10-21 09:18:52 +00:00
The different fields are:
* **name**: the application's name
* **generic**: the application's generic name
2018-10-17 21:02:50 +00:00
* **exec**: the application's executable
2017-10-21 09:18:52 +00:00
* **categories**: the application's categories
2017-12-31 13:13:48 +00:00
* **comment**: the application comment
2021-08-26 20:42:39 +00:00
* **all**: all the above
2017-10-21 09:18:52 +00:00
2020-02-21 14:32:52 +00:00
Default: *name,generic,exec,categories,keywords*
2017-10-21 09:18:52 +00:00
2018-10-17 21:02:50 +00:00
`-drun-display-format`
2020-05-10 13:44:29 +00:00
The format string for the `drun` dialog:
2018-10-17 21:02:50 +00: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 14:03:24 +00:00
Pango markup can be used to formatting the output.
Default: {name} [< span weight = 'light' size = 'small' > < i > ({generic})< / i > < / span > ]
2018-10-17 21:02:50 +00:00
2019-01-11 20:56:31 +00:00
Note: Only fields enabled in `-drun-match-fields` can be used in the format string.
2018-07-28 09:12:11 +00:00
`-[no-]drun-show-actions`
Show actions present in the Desktop files.
Default: false
2017-10-21 09:18:52 +00:00
`-window-match-fields` *field1* ,*field2*,...
2018-10-17 21:02:50 +00:00
When using window mode, match only with the specified fields.
2017-10-21 09:18:52 +00:00
The different fields are:
* **title**: window's title
* **class**: window's class
2018-10-17 21:02:50 +00:00
* **role**: window's role
2017-10-21 09:18:52 +00:00
* **name**: window's name
* **desktop**: window's current desktop
2021-08-26 20:42:39 +00:00
* **all**: all the above
2017-10-21 09:18:52 +00:00
Default: *all*
2019-05-19 17:15:54 +00:00
`-matching-negate-char` *char*
2021-08-26 20:42:39 +00:00
Set the character used to negate the query (i.e. if it does **not** match the next keyword).
2019-05-19 17:15:54 +00:00
Set to '\x0' to disable.
Default: '-'
2017-10-21 09:18:52 +00:00
2021-06-09 20:21:39 +00:00
### Layout and Theming
2021-06-08 20:58:27 +00:00
2021-06-09 20:21:39 +00: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 20:42:39 +00: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 20:21:39 +00: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 18:29:26 +00:00
2017-03-18 14:54:35 +00:00
Most of the following options are **deprecated** and should not be used. Please use the new theme format to customize
2017-08-13 17:19:19 +00:00
**rofi**. More information about the new format can be found in the **rofi-theme(5)** manpage.
2017-03-18 14:54:35 +00:00
2014-07-24 18:38:21 +00:00
`-location`
2014-05-22 08:37:25 +00:00
2015-09-03 22:27:34 +00:00
Specify where the window should be located. The numbers map to the following locations on screen:
2014-05-22 08:37:25 +00:00
2014-08-01 21:29:01 +00:00
1 2 3
8 0 4
7 6 5
2014-05-22 08:37:25 +00:00
2015-09-03 22:27:34 +00:00
Default: *0*
2015-01-19 14:49:23 +00:00
2014-05-22 08:37:25 +00:00
`-fixed-num-lines`
2021-08-30 14:11:36 +00:00
Keep a fixed number of visible lines.
2014-05-22 08:37:25 +00:00
2014-11-09 12:10:24 +00:00
`-sidebar-mode`
2021-08-26 20:42:39 +00:00
Open in sidebar-mode. In this mode, a list of all enabled modes is shown at the bottom.
2022-02-23 21:42:56 +00:00
(See `-modes` option)
2017-08-13 17:19:19 +00:00
To show sidebar, use:
2014-11-09 12:10:24 +00:00
2021-08-30 14:11:36 +00:00
rofi -show run -sidebar-mode
2014-11-09 12:10:24 +00:00
2021-04-13 09:45:20 +00: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 16:07:43 +00:00
`-eh` *number*
Set row height (in chars)
Default: *1*
2015-02-24 16:34:25 +00:00
`-auto-select`
2015-09-03 22:27:34 +00:00
When one entry is left, automatically select it.
2015-02-24 16:34:25 +00:00
2015-08-02 13:45:52 +00:00
`-m` *num*
2016-08-19 08:46:38 +00:00
`-m` *name*
2015-08-02 13:45:52 +00:00
`-monitor` *num*
2016-08-19 08:46:38 +00:00
`-monitor` *name*
2016-08-20 09:22:18 +00:00
Select monitor to display **rofi** on.
2017-08-13 17:19:19 +00: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 19:35:11 +00:00
* ** -1**: the currently focused monitor.
2017-08-13 17:19:19 +00:00
* ** -2**: the currently focused window (that is, **rofi** will be displayed on top of the focused window).
2021-08-26 20:42:39 +00:00
* ** -3**: Position of mouse (overrides the location setting to get normal context menu
2017-08-13 17:19:19 +00:00
behavior.)
2016-04-29 19:42:31 +00:00
* ** -4**: the monitor with the focused window.
* ** -5**: the monitor that shows the mouse pointer.
2015-08-17 16:32:17 +00:00
2016-08-19 16:01:26 +00:00
Default: *-5*
2015-08-02 13:45:52 +00:00
2017-08-13 17:19:19 +00:00
See `rofi -h` output for the detected monitors, their position, and size.
2016-08-19 08:46:38 +00:00
2017-01-18 17:12:54 +00:00
`-theme` *filename*
Path to the new theme file format. This overrides the old theme settings.
`-theme-str` *string*
2017-08-13 17:19:19 +00:00
Allow theme parts to be specified on the command line as an override.
2017-01-18 17:12:54 +00:00
2017-08-13 17:19:19 +00:00
For example:
2017-01-18 17:12:54 +00:00
rofi -theme-str '#window { fullscreen: true; }'
This option can be specified multiple times.
2021-08-26 20:42:39 +00:00
This is now the method to tweak the theme via the command line.
2017-01-18 17:12:54 +00:00
2017-01-21 11:58:52 +00:00
`-dpi` *number*
Override the default DPI setting.
2020-05-10 13:44:29 +00: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 11:58:52 +00:00
2020-03-29 10:58:28 +00:00
`-selected-row` *selected row*
Select a certain row.
Default: *0*
2015-01-19 14:49:23 +00:00
### PATTERN setting
2014-05-22 08:37:25 +00:00
2014-10-20 18:29:26 +00:00
`-terminal`
2014-05-22 08:37:25 +00:00
2017-08-13 17:19:19 +00:00
Specify which terminal to start.
2014-08-01 21:29:01 +00:00
2015-09-03 22:27:34 +00:00
rofi -terminal xterm
2014-08-01 21:29:01 +00:00
2015-09-03 22:27:34 +00:00
Pattern: *{terminal}*
2020-05-10 13:44:29 +00:00
2015-09-03 22:27:34 +00:00
Default: *x-terminal-emulator*
2014-10-20 18:29:26 +00:00
2015-01-19 14:49:23 +00:00
`-ssh-client` *client*
2014-10-20 18:29:26 +00:00
2020-05-10 13:44:29 +00:00
Override the used `ssh` client.
2014-05-22 19:56:57 +00:00
2015-09-03 22:27:34 +00:00
Pattern: *{ssh-client}*
2020-05-10 13:44:29 +00:00
2015-09-03 22:27:34 +00:00
Default: *ssh*
2014-05-22 08:37:25 +00:00
2015-01-19 14:49:23 +00:00
### SSH settings
2014-09-03 11:07:26 +00:00
`-ssh-command` *cmd*
2021-08-26 20:42:39 +00:00
Set the command to execute when starting an ssh session.
2015-09-03 22:27:34 +00:00
The pattern *{host}* is replaced by the selected ssh entry.
2015-01-19 14:49:23 +00:00
2016-12-14 08:26:12 +00:00
Pattern: *{ssh-client}*
2020-05-10 13:44:29 +00:00
2015-09-03 22:27:34 +00:00
Default: *{terminal} -e {ssh-client} {host}*
2014-09-03 11:07:26 +00:00
2015-03-29 10:27:00 +00:00
`-parse-hosts`
2015-09-03 22:27:34 +00:00
Parse the `/etc/hosts` file for entries.
2015-03-29 10:27:00 +00:00
2015-10-31 16:26:13 +00:00
Default: *disabled*
`-parse-known-hosts`
`-no-parse-known-hosts`
Parse the `~/.ssh/known_hosts` file for entries.
Default: *enabled*
2014-10-20 18:29:26 +00:00
### Run settings
2014-09-03 11:07:26 +00:00
`-run-command` *cmd*
2015-09-03 22:27:34 +00:00
Set command (*{cmd}*) to execute when running an application.
See *PATTERN* .
2014-09-03 11:07:26 +00:00
2015-09-03 22:27:34 +00:00
Default: *{cmd}*
2015-01-19 14:49:23 +00:00
2014-09-03 11:07:26 +00:00
`-run-shell-command` *cmd*
2015-09-03 22:27:34 +00:00
Set command to execute when running an application in a shell.
See *PATTERN* .
2014-09-03 11:07:26 +00:00
2015-09-03 22:27:34 +00:00
Default: *{terminal} -e {cmd}*
2015-01-19 14:49:23 +00:00
2015-01-05 20:53:50 +00:00
`-run-list-command` *cmd*
2021-08-26 20:42:39 +00:00
If set, use an external tool to generate a list of executable commands. Uses `run-command` .
2015-01-05 20:53:50 +00:00
2017-08-13 17:19:19 +00:00
Default: *{cmd}*
2015-01-19 14:49:23 +00:00
2017-01-09 19:32:31 +00:00
### Window switcher settings
`-window-format` *format*
Format what is being displayed for windows.
*format*: {field[:len]}
*field*:
2017-08-13 17:19:19 +00:00
* **w**: desktop name
* **t**: title of window
* **n**: name
* **r**: role
* **c**: class
2017-01-09 19:32:31 +00:00
2021-08-26 20:42:39 +00:00
*len*: maximum field length (0 for auto-size). If length and window *width* are negative, field length is *width - len* .
If length is positive, the entry will be truncated or padded to fill that length.
2017-01-09 19:32:31 +00:00
default: {w} {c} {t}
2016-05-12 09:31:06 +00:00
`-window-command` *cmd*
2021-08-26 20:42:39 +00:00
Set command to execute on selected window for an alt action (`-kb-accept-alt`).
2016-05-12 09:31:06 +00:00
See *PATTERN* .
2019-01-21 17:08:11 +00:00
Default: *"wmctrl -i -R {window}"*
2016-05-12 09:31:06 +00:00
2020-04-29 10:59:49 +00:00
`-window-thumbnail`
Show window thumbnail (if available) as icon in the window switcher.
2021-08-17 16:23:35 +00:00
You can stop rofi from exiting when closing a window (allowing multiple to be closed in a row).
2021-08-17 16:16:25 +00:00
```css
configuration {
window {
close-on-delete: false;
}
}
```
2022-07-23 22:52:13 +00: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.
2021-08-17 16:16:25 +00:00
2015-04-01 12:49:27 +00:00
### Combi settings
2022-02-23 21:42:56 +00:00
`-combi-modes ` *mode1* ,*mode2*
2015-04-01 12:49:27 +00:00
2022-02-23 21:42:56 +00:00
The modes to combine in combi mode.
For syntax to `-combi-modes` , see `-modes` .
2017-08-13 17:19:19 +00:00
To get one merge view, of `window` ,`run`, and `ssh` :
2015-04-01 12:49:27 +00:00
2022-02-23 21:42:56 +00:00
rofi -show combi -combi-modes "window,run,ssh" -modes combi
2015-04-01 12:49:27 +00:00
2021-08-26 20:42:39 +00: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 13:27:13 +00:00
2022-01-22 21:03:10 +00: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 08:46:18 +00:00
Note: This setting is ignored if `combi-hide-mode-prefix` is enabled.
2022-01-22 21:03:10 +00:00
2014-10-20 18:29:26 +00:00
### History and Sorting
2014-09-03 11:07:26 +00:00
2014-06-05 19:55:47 +00:00
`-disable-history`
2015-04-19 11:19:20 +00:00
`-no-disable-history` (re-enable history)
2014-06-05 19:55:47 +00:00
2015-09-03 22:27:34 +00:00
Disable history
2014-06-05 19:55:47 +00:00
2017-10-03 17:51:27 +00: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 13:44:29 +00:00
`-sorting-method` 'method' to specify the sorting method.
2014-07-16 06:42:42 +00:00
2021-08-26 20:42:39 +00:00
There are 2 sorting methods:
2018-06-13 09:57:23 +00:00
* levenshtein (Default)
* fzf sorting.
2017-10-03 17:51:27 +00:00
2021-02-01 20:34:49 +00:00
`-max-history-size` *number*
2021-07-29 18:46:23 +00:00
Maximum number of entries to store in history. Defaults to 25. (WARNING: can cause slowdowns when set too high)
2014-07-16 06:42:42 +00:00
2020-04-16 21:31:43 +00:00
2014-10-20 16:11:10 +00:00
### Message dialog
`-e` *message*
2017-08-13 17:19:19 +00:00
Pops up a message dialog (used internally for showing errors) with *message* .
2015-09-03 22:27:34 +00:00
Message can be multi-line.
2014-10-19 17:42:02 +00:00
2021-06-05 12:22:48 +00:00
### File browser settings
2021-06-27 07:28:21 +00: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 21:58:27 +00:00
/** Group directories before files. */
directories-first: true;
2021-06-27 07:28:21 +00:00
}
}
```
2021-06-05 12:22:48 +00:00
2015-01-31 17:23:17 +00:00
### Other
2020-01-26 11:47:04 +00:00
`-drun-use-desktop-cache`
2020-05-10 13:44:29 +00:00
Build and use a cache with the content of desktop files. Usable for systems with slow hard drives.
2020-01-26 11:47:04 +00:00
`-drun-reload-desktop-cache`
2020-05-10 13:44:29 +00:00
If `drun-use-desktop-cache` is enabled, rebuild a cache with the content of desktop files.
2020-01-26 11:47:04 +00:00
2021-06-08 18:25:05 +00:00
`-drun-url-launcher` *command*
Command to open a Desktop Entry that is a Link.
2016-12-21 08:52:55 +00:00
`-pid` *path*
2015-01-31 17:23:17 +00:00
2017-08-13 17:19:19 +00: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 17:23:17 +00:00
2021-12-22 20:03:54 +00:00
`-replace`
If rofi is already running, based on pid file, try to kill that instance.
2016-08-22 06:04:20 +00:00
`-display-{mode}` *string*
Set the name to use for mode. This is used as prompt and in combi-browser.
2021-08-14 11:03:16 +00:00
It is now preferred to use the configuration file:
2021-06-15 12:04:34 +00:00
```css
configuration {
{mode} {
display-name: *string* ;
}
}
```
2016-09-08 20:42:41 +00:00
`-click-to-exit`
`-no-click-to-exit`
2021-08-26 20:42:39 +00:00
Click the mouse outside the **rofi** window to exit.
2016-09-08 20:42:41 +00:00
Default: *enabled*
2022-07-19 13:44:29 +00:00
`-xserver-i300-workaround`
Workaround for bug in Xserver. See issue #611 and #1642 on the rofi issue tracker.
Default: *disabled*
2015-01-19 14:49:23 +00:00
## PATTERN
2014-09-03 11:07:26 +00:00
2017-08-13 17:19:19 +00: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 11:07:26 +00:00
2017-08-13 17:19:19 +00:00
* `{host}` : the host to connect to
2021-12-30 13:08:39 +00:00
* `{terminal}` : the configured terminal (see -terminal)
2017-08-13 17:19:19 +00: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 08:37:25 +00:00
2014-11-05 09:27:46 +00:00
2015-04-22 19:03:02 +00:00
## THEMING
2015-04-06 20:17:05 +00:00
2021-06-09 20:21:39 +00:00
Please see **rofi-theme(5)** manpage for more information on theming.
2016-12-14 08:26:12 +00:00
2017-08-13 17:19:19 +00:00
## KEY BINDINGS
2014-05-22 08:37:25 +00:00
2022-02-13 11:22:25 +00: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 07:55:31 +00: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 21:42:56 +00:00
## Available Modes
2015-11-25 08:16:30 +00:00
2020-05-10 13:44:29 +00:00
### window
2015-11-25 08:16:30 +00:00
Show a list of all the windows and allow switching between them.
2016-12-14 08:26:12 +00:00
Pressing the `delete-entry` binding (`shift-delete`) will close the window.
2016-05-12 09:31:06 +00:00
Pressing the `accept-custom` binding (`control-enter` or `shift-enter` ) will run a command on the window.
2016-12-14 08:26:12 +00:00
(See option `window-command` );
2015-11-25 08:16:30 +00:00
2021-06-07 21:13:21 +00:00
If there is no match, it will try to launch the input.
2020-05-10 13:44:29 +00:00
### windowcd
2015-11-25 08:16:30 +00:00
Shows a list of the windows on the current desktop and allows switching between them.
2016-05-12 09:25:18 +00:00
Pressing the `delete-entry` binding (`shift-delete`) will kill the window.
2016-05-12 09:31:06 +00:00
Pressing the `accept-custom` binding (`control-enter` or `shift-enter` ) will run a command on the window.
2016-12-14 08:26:12 +00:00
(See option `window-command` );
2015-11-25 08:16:30 +00:00
2020-09-13 19:56:25 +00:00
If there is no match, it will try to launch the input.
2020-05-10 13:44:29 +00:00
### run
2015-11-25 08:16:30 +00:00
2020-05-10 13:44:29 +00:00
Shows a list of executables in `$PATH` and can launch them (optional in a terminal).
2016-12-14 08:26:12 +00:00
Pressing the `delete-entry` binding (`shift-delete`) will remove this entry from the run history.
2021-07-05 14:47:24 +00: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 08:16:30 +00:00
2021-06-07 21:13:21 +00: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 13:44:29 +00:00
### drun
2015-11-25 08:16:30 +00: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 08:26:12 +00:00
Pressing the `delete-entry` binding (`shift-delete`) will remove this entry from the run history.
2021-07-05 14:47:24 +00: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 08:16:30 +00:00
2021-06-08 17:35:51 +00: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 20:42:39 +00:00
The DRUN mode tries to follow the [XDG Desktop Entry
2021-06-07 21:13:21 +00:00
Specification](https://freedesktop.org/wiki/Specifications/desktop-entry-spec/) and should be compatible with
2021-08-26 20:42:39 +00: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 21:13:21 +00:00
discarded.
2021-06-15 14:19:57 +00: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 13:44:29 +00:00
### ssh
2015-11-25 08:16:30 +00:00
2020-05-10 13:44:29 +00:00
Shows a list of SSH targets based on your `ssh` config file, and allows to quickly `ssh` into them.
2015-11-25 08:16:30 +00:00
2020-05-10 13:44:29 +00:00
### keys
2016-10-20 20:56:17 +00:00
Shows a searchable list of key bindings.
2020-05-10 13:44:29 +00:00
### script
2015-11-25 08:16:30 +00:00
2022-02-23 21:42:56 +00:00
Allows custom scripted Modes to be added, see the **rofi-script(5)** manpage for more information.
2015-11-25 08:16:30 +00:00
2020-05-12 19:12:45 +00:00
### combi
2022-02-23 21:42:56 +00:00
Combines multiple modes in one list. Specify which modes are included with the `-combi-modes` option.
2020-05-12 19:12:45 +00:00
2022-02-23 21:42:56 +00: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 19:12:45 +00:00
query begins with the bang `!w` , only results from the `window` and `windowcd`
2022-02-23 21:42:56 +00:00
modes are shown, even if the rest of the input text would match results from `run` .
2020-05-12 19:12:45 +00:00
2022-02-23 21:42:56 +00:00
If no match, the input is handled by the first combined modes.
2020-09-13 19:56:25 +00:00
2014-11-08 12:51:41 +00:00
## FAQ
2020-05-10 13:44:29 +00:00
### The text in the window switcher is not nicely aligned.
2014-11-08 12:51:41 +00:00
2016-04-03 12:56:23 +00:00
Try using a mono-space font.
2014-11-08 12:51:41 +00:00
2016-11-04 18:41:52 +00:00
### The window is completely black.
2014-12-07 15:04:22 +00:00
2020-05-10 13:44:29 +00:00
Check quotes used on the command-line: you might have used `“` ("smart quotes") instead of `"` ("machine quotes").
2014-12-07 15:04:22 +00:00
2016-11-04 18:41:52 +00:00
### What does the icon in the top right show?
2015-12-14 20:02:36 +00:00
2016-04-03 12:56:23 +00: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 20:02:36 +00:00
2022-01-22 13:20:16 +00: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 08:42:04 +00:00
## EXAMPLES
Some basic usage examples of **rofi** :
Show the run dialog:
2022-02-23 21:42:56 +00:00
rofi -modes run -show run
2016-12-21 08:42:04 +00:00
2020-05-10 13:44:29 +00:00
Show the run dialog, and allow switching to Desktop File run dialog (`drun`):
2016-12-21 08:42:04 +00:00
2022-02-23 21:42:56 +00:00
rofi -modes run,drun -show run
2016-12-21 08:42:04 +00:00
2020-05-10 13:44:29 +00:00
Combine the run and Desktop File run dialog (`drun`):
2016-12-21 08:42:04 +00:00
2022-02-23 21:42:56 +00:00
rofi -modes combi -show combi -combi-modes run,drun
2016-12-21 08:42:04 +00:00
2020-05-10 13:44:29 +00:00
Combine the run and Desktop File run dialog (`drun`), and allow switching to window switcher:
2016-12-21 08:42:04 +00:00
2022-02-23 21:42:56 +00:00
rofi -modes combi,window -show combi -combi-modes run,drun
2016-12-21 08:42:04 +00:00
2017-08-13 17:19:19 +00:00
Pop up a text message claiming that this is the end:
2016-12-21 08:42:04 +00:00
rofi -e "This is the end"
2017-08-13 17:19:19 +00:00
Pop up a text message in red, bold font claiming that this is still the end:
2016-12-21 08:42:04 +00:00
2017-11-18 11:40:05 +00:00
rofi -e "< span color = 'red' > < b > This is still the end< / b > < / span > " -markup
2016-12-21 08:42:04 +00:00
2017-08-13 17:19:19 +00:00
Show all key bindings:
2016-12-21 08:42:04 +00:00
rofi -show keys
2017-08-13 17:19:19 +00:00
## i3
2017-01-07 09:35:36 +00:00
2017-08-13 17:19:19 +00: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 09:35:36 +00:00
2020-05-10 13:44:29 +00: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 17:19:19 +00: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 09:35:36 +00:00
been released.
2015-04-22 19:03:02 +00:00
## LICENSE
2015-04-25 15:40:01 +00:00
MIT/X11
2015-05-24 05:48:04 +00:00
2015-04-25 15:40:01 +00: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 05:48:04 +00:00
2015-04-25 15:40:01 +00:00
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
2015-05-24 05:48:04 +00:00
2015-04-25 15:40:01 +00: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 19:03:02 +00:00
2014-08-05 18:09:39 +00:00
## WEBSITE
2017-08-13 17:19:19 +00:00
**rofi** website can be found [here ](https://davedavenport.github.io/rofi/ )
2014-08-03 19:51:31 +00:00
2016-12-23 09:31:52 +00:00
## SUPPORT
2014-09-06 12:57:30 +00:00
2021-06-07 21:13:21 +00:00
**rofi** support can be obtained:
* [GitHub Discussions ](https://github.com/davatorium/rofi/discussions )
2021-08-26 20:42:39 +00:00
* [Forum (Reddit) ](https://reddit.com/r/qtools// )
2021-06-07 21:13:21 +00:00
* [IRC ](irc://irc.libera.chat:6697/#rofi ) (#rofi on irc.libera.chat),
2016-11-13 17:39:21 +00:00
2016-12-23 09:31:52 +00:00
## DEBUGGING
2022-04-11 09:19:34 +00:00
For more information see **rofi-debugging(5)** manpage.
2016-12-23 09:31:52 +00:00
## ISSUE TRACKER
2020-05-10 13:44:29 +00:00
The **rofi** issue tracker can be found [here ](https://github.com/DaveDavenport/rofi/issues )
2016-12-23 09:31:52 +00:00
When creating an issue, please read [this ](https://github.com/DaveDavenport/rofi/blob/master/.github/CONTRIBUTING.md )
first.
2016-11-13 17:39:21 +00:00
## SEE ALSO
2022-07-04 06:29:39 +00: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 20:21:58 +00:00
2014-08-01 21:29:01 +00:00
## AUTHOR
2014-05-22 08:37:25 +00:00
2021-06-08 20:02:29 +00:00
* Qball Cow < qball @ blame . services >
2020-05-10 13:44:29 +00:00
* Rasmus Steinke < rasi @ xssn . at >
2022-02-26 16:02:26 +00:00
* Morgane Glidic < sardemff7 + rofi @ sardemff7 . net >
2016-06-06 20:21:58 +00:00
2021-06-08 20:02:29 +00:00
Original code based on work by: [Sean Pringle ](https://github.com/seanpringle/simpleswitcher ) < sean.pringle @ gmail . com >
2015-04-25 15:40:01 +00:00
2020-05-10 13:44:29 +00:00
For a full list of authors, check the `AUTHORS` file.