2023-03-26 18:09:25 -04:00
|
|
|
> This page does not describe all of **ROFI**'s configuration options, just the
|
|
|
|
> most common usecase. For the full configuration options, check the manpages.
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
<br />
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
## Where does the configuration live
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
Rofi's configurations, custom themes live in `${XDG_CONFIG_HOME}/rofi/`, on
|
|
|
|
most systems this is `~/.config/rofi/`.
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
The name of the main configuration file is `config.rasi`. (`~/.config/rofi/config.rasi`).
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
## Create an empty configuration file
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
Open `~/.config/rofi/config.rasi` in your favorite text editor and add the
|
|
|
|
following block:
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
```css
|
|
|
|
configuration {
|
|
|
|
|
|
|
|
}
|
|
|
|
```
|
|
|
|
You can now set the options in the `configuration` block.
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
## Create a configuration file from current setup
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
If you do not want to start from scratch, or want to migrate from older
|
|
|
|
configuration format, you can get tell rofi to dumps it configuration:
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
```bash
|
|
|
|
rofi -dump-config > ~/.config/rofi/config.rasi
|
|
|
|
```
|
|
|
|
|
|
|
|
This will have all the possible settings and their current value.
|
|
|
|
If a value is the default value, the entry will be commented.
|
|
|
|
|
|
|
|
For example:
|
|
|
|
```css
|
|
|
|
configuration {
|
2022-02-23 16:42:56 -05:00
|
|
|
/* modes: "window,run,ssh,drun";*/
|
2021-10-29 08:00:22 -04:00
|
|
|
/* font: "mono 12";*/
|
|
|
|
/* location: 0;*/
|
|
|
|
/* yoffset: 0;*/
|
|
|
|
/* xoffset: 0;*/
|
|
|
|
/* fixed-num-lines: true;*/
|
|
|
|
... cut ...
|
|
|
|
/* ml-row-down: "ScrollDown";*/
|
|
|
|
/* me-select-entry: "MousePrimary";*/
|
|
|
|
/* me-accept-entry: "MouseDPrimary";*/
|
|
|
|
/* me-accept-custom: "Control+MouseDPrimary";*/
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2022-12-31 07:15:01 -05:00
|
|
|
To create a copy of the current theme, you can run:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
rofi -dump-theme > ~/.config/rofi/current.rasi
|
|
|
|
```
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
## Configuration file format
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
### Encoding
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
The encoding of the file is utf-8. Both Unix (`\n`) and windows (`\r\n`)
|
|
|
|
newlines format are supported. But Unix is preferred.
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
### Comments
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
C and C++ file comments are supported.
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
- Anything after `// ` and before a newline is considered a comment.
|
|
|
|
- Everything between `/*` and `*/` is a comment.
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
Comments can be nested and the C comments can be inline.
|
|
|
|
|
|
|
|
The following is valid:
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
```css
|
2021-10-29 08:00:22 -04:00
|
|
|
// Magic comment.
|
|
|
|
property: /* comment */ value;
|
|
|
|
```
|
|
|
|
|
|
|
|
However, this is not:
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
```css
|
2021-10-29 08:00:22 -04:00
|
|
|
prop/*comment*/erty: value;
|
|
|
|
```
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
### White space
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
White space and newlines, like comments, are ignored by the parser.
|
|
|
|
|
|
|
|
This:
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
```css
|
2021-10-29 08:00:22 -04:00
|
|
|
property: name;
|
|
|
|
```
|
|
|
|
|
|
|
|
Is identical to:
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
```css
|
2021-10-29 08:00:22 -04:00
|
|
|
property :
|
|
|
|
name
|
|
|
|
|
|
|
|
;
|
|
|
|
```
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
### Data types
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
**ROFI**'s configuration supports several data formats:
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
#### String
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
A string is always surrounded by double quotes (`"`). Between the quotes there
|
|
|
|
can be any printable character.
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
```css
|
|
|
|
|
|
|
|
ml-row-down: "ScrollDown";
|
|
|
|
```
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
#### Number
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
An integer may contain any full number.
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
```css
|
2021-10-29 08:00:22 -04:00
|
|
|
eh: 2;
|
|
|
|
```
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
#### Boolean
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
Boolean value is either `true` or `false`. This is case-sensitive.
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
```css
|
|
|
|
show-icons: true;
|
|
|
|
```
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
This is equal to the `-show-icons` option on the commandline, and `show-icons:
|
|
|
|
false;` is equal to `-no-show-icons`.
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
#### Character
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
Character value is always surrounded by single quotes (') and should contain a
|
|
|
|
single character. It supports escaping.
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
```css
|
|
|
|
matching-negate-char: '-';
|
|
|
|
```
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
#### List
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
This is not supported by the old configuration system, but can be used in the
|
|
|
|
**rasi** format.
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
A list starts with a '[' and ends with a ']'. The entries in the list are
|
|
|
|
comma-separated. The entry in the list single ASCII words.
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
```css
|
2022-02-23 16:42:56 -05:00
|
|
|
combi-modes: [window,drun];
|
2021-10-29 08:00:22 -04:00
|
|
|
```
|
|
|
|
For older versions you have :
|
|
|
|
|
|
|
|
```css
|
2022-02-23 16:42:56 -05:00
|
|
|
combi-modes: "window,drun";
|
2021-10-29 08:00:22 -04:00
|
|
|
```
|
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
## Get a list of all possible options
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
There are 2 ways to get a list of all options:
|
|
|
|
|
|
|
|
1. Dump the configuration file explained above. (`rofi -dump-config`)
|
2023-03-26 18:09:25 -04:00
|
|
|
1. Look at output of `rofi -h`.
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
To see what values an option support check the manpage, it describes most of
|
|
|
|
them.
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
NOTE: not all options might be in the manpage, as options can be added at
|
|
|
|
run-time. (f.e. by plugins).
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
## Splitting configuration over multiple files
|
2021-10-29 08:00:22 -04:00
|
|
|
|
2023-03-26 18:09:25 -04:00
|
|
|
It is possible to split configuration over multiple files using imports. For
|
|
|
|
example in `~/.config/rofi/config.rasi`
|
2021-10-29 08:00:22 -04:00
|
|
|
|
|
|
|
```css
|
|
|
|
configuration {
|
|
|
|
}
|
|
|
|
@import "myConfig"
|
|
|
|
@theme "MyTheme"
|
|
|
|
|
|
|
|
```
|
|
|
|
|
2022-12-31 07:15:01 -05:00
|
|
|
Rofi will first parse the config block in `~/.config/rofi/config.rasi`, then
|
|
|
|
parse `~/.config/rofi/myConfig.rasi` and then load the theme `myTheme`. More
|
|
|
|
information can be obtained from the **rofi-theme(5)** manpage. Imports can be
|
|
|
|
nested.
|