2021-12-17 05:13:29 -05:00
|
|
|
# ROFI-DMENU 5 rofi-dmenu
|
|
|
|
|
|
|
|
## NAME
|
|
|
|
|
|
|
|
**rofi dmenu mode** - Rofi dmenu emulation
|
|
|
|
|
|
|
|
## DESCRIPTION
|
|
|
|
|
|
|
|
To integrate **rofi** into scripts as simple selection dialogs,
|
|
|
|
**rofi** supports emulating **dmenu(1)** (A dynamic menu for X11).
|
|
|
|
|
|
|
|
The website for `dmenu` can be found [here](http://tools.suckless.org/dmenu/).
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
**rofi** does not aim to be 100% compatible with `dmenu`. There are simply too
|
|
|
|
many flavors of `dmenu`. The idea is that the basic usage command-line flags
|
|
|
|
are obeyed, theme-related flags are not. Besides, **rofi** offers some extended
|
|
|
|
features (like multi-select, highlighting, message bar, extra key bindings).
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
## BASIC CONCEPT
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
In `dmenu` mode, **rofi** reads data from standard in, splits them into
|
|
|
|
separate entries and displays them. If the user selects an row, this is printed
|
|
|
|
out to standard out, allow the script to process it further.
|
2021-12-17 05:13:29 -05:00
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
By default separation of rows is done on new lines, making it easy to pipe the
|
|
|
|
output a one application into **rofi** and the output of rofi into the next.
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
## USAGE
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
By launching **rofi** with the `-dmenu` flag it will go into dmenu emulation
|
|
|
|
mode.
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
```bash
|
|
|
|
ls | rofi -dmenu
|
|
|
|
```
|
|
|
|
|
|
|
|
### DMENU DROP-IN REPLACEMENT
|
|
|
|
|
|
|
|
If `argv[0]` (calling command) is dmenu, **rofi** will start in dmenu mode.
|
2023-03-27 12:45:44 -04:00
|
|
|
This way, it can be used as a drop-in replacement for dmenu. Just copy or
|
|
|
|
symlink **rofi** to dmenu in `$PATH`.
|
2021-12-17 05:13:29 -05:00
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
```bash
|
|
|
|
ln -s /usr/bin/rofi /usr/bin/dmenu
|
|
|
|
```
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
### DMENU VS SCRIPT MODE
|
|
|
|
|
|
|
|
Script mode is used to extend **rofi**, dmenu mode is used to extend a script.
|
2023-03-27 12:45:44 -04:00
|
|
|
The two do share much of the same input format. Please see the
|
|
|
|
**rofi-script(5)** manpage for more information.
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
### DMENU SPECIFIC COMMANDLINE FLAGS
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
A lot of these options can also be modified by the script using special input.
|
|
|
|
See the **rofi-script(5)** manpage for more information about this syntax.
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
`-sep` *separator*
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
Separator for `dmenu`. Example: To show a list of 'a' to 'e' with '|' as a
|
|
|
|
separator:
|
2021-12-17 05:13:29 -05:00
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
```bash
|
|
|
|
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
|
|
|
|
```
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
`-p` *prompt*
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
Specify the prompt to show in `dmenu` mode. For example, select 'monkey',
|
|
|
|
a,b,c,d, or e.
|
2021-12-17 05:13:29 -05:00
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
```bash
|
|
|
|
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey"
|
|
|
|
```
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
Default: *dmenu*
|
|
|
|
|
|
|
|
`-l` *number of lines to show*
|
|
|
|
|
|
|
|
Maximum number of lines the menu may show before scrolling.
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
```bash
|
|
|
|
rofi -dmenu -l 25
|
|
|
|
```
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
Default: *15*
|
|
|
|
|
|
|
|
`-i`
|
|
|
|
|
|
|
|
Makes `dmenu` searches case-insensitive
|
|
|
|
|
|
|
|
`-a` *X*
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
Active row, mark *X* as active. Where *X* is a comma-separated list of
|
|
|
|
python(1)-style indices and ranges, e.g. indices start at 0, -1 refers to the
|
|
|
|
last row with -2 preceding it, ranges are left-open and right-close, and so on.
|
|
|
|
You can specify:
|
2021-12-17 05:13:29 -05:00
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
- A single row: '5'
|
|
|
|
- A range of (last 3) rows: '-3:'
|
|
|
|
- 4 rows starting from row 7: '7:11' (or in legacy notation: '7-10')
|
|
|
|
- A set of rows: '2,0,-9'
|
|
|
|
- Or any combination: '5,-3:,7:11,2,0,-9'
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
`-u` *X*
|
|
|
|
|
|
|
|
Urgent row, mark *X* as urgent. See `-a` option for details.
|
|
|
|
|
|
|
|
`-only-match`
|
|
|
|
|
|
|
|
Only return a selected item, do not allow custom entry.
|
|
|
|
This mode always returns an entry. It will not return if no matching entry is
|
|
|
|
selected.
|
|
|
|
|
|
|
|
`-no-custom`
|
|
|
|
|
|
|
|
Only return a selected item, do not allow custom entry.
|
|
|
|
This mode returns directly when no entries given.
|
|
|
|
|
|
|
|
`-format` *format*
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
Allows the output of dmenu to be customized (N is the total number of input
|
|
|
|
entries):
|
2021-12-17 05:13:29 -05:00
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
- 's' selected string
|
|
|
|
- 'i' index (0 - (N-1))
|
|
|
|
- 'd' index (1 - N)
|
|
|
|
- 'q' quote string
|
|
|
|
- 'p' Selected string stripped from Pango markup (Needs to be a valid string)
|
|
|
|
- 'f' filter string (user input)
|
|
|
|
- 'F' quoted filter string (user input)
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
Default: 's'
|
|
|
|
|
|
|
|
`-select` *string*
|
|
|
|
|
|
|
|
Select first line that matches the given string
|
|
|
|
|
|
|
|
`-mesg` *string*
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
Add a message line below the filter entry box. Supports Pango markup. For more
|
|
|
|
information on supported markup, see
|
|
|
|
[here](https://docs.gtk.org/Pango/pango_markup.html)
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
`-dump`
|
|
|
|
|
|
|
|
Dump the filtered list to stdout and quit.
|
|
|
|
This can be used to get the list as **rofi** would filter it.
|
|
|
|
Use together with `-filter` command.
|
|
|
|
|
|
|
|
`-input` *file*
|
|
|
|
|
|
|
|
Reads from *file* instead of stdin.
|
|
|
|
|
|
|
|
`-password`
|
|
|
|
|
|
|
|
Hide the input text. This should not be considered secure!
|
|
|
|
|
|
|
|
`-markup-rows`
|
|
|
|
|
|
|
|
Tell **rofi** that DMenu input is Pango markup encoded, and should be rendered.
|
2023-03-27 12:45:44 -04:00
|
|
|
See [here](https://developer.gnome.org/pygtk/stable/pango-markup-language.html)
|
|
|
|
for details about Pango markup.
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
`-multi-select`
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
Allow multiple lines to be selected. Adds a small selection indicator to the
|
|
|
|
left of each entry.
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
`-sync`
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
Force **rofi** mode to first read all data from stdin before showing the
|
|
|
|
selection window. This is original dmenu behavior.
|
2021-12-17 05:13:29 -05:00
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
Note: the default asynchronous mode will also be automatically disabled if used
|
|
|
|
with conflicting options,
|
2021-12-17 05:13:29 -05:00
|
|
|
such as `-dump`, `-only-match` or `-auto-select`.
|
|
|
|
|
|
|
|
`-window-title` *title*
|
|
|
|
|
|
|
|
Set name used for the window title. Will be shown as Rofi - *title*
|
|
|
|
|
|
|
|
`-w` *windowid*
|
|
|
|
|
|
|
|
Position **rofi** over the window with the given X11 window ID.
|
|
|
|
|
|
|
|
`-keep-right`
|
|
|
|
|
|
|
|
Set ellipsize mode to start. So, the end of the string is visible.
|
|
|
|
|
2022-01-31 06:56:18 -05:00
|
|
|
`-display-columns`
|
|
|
|
|
|
|
|
A comma seperated list of columns to show.
|
|
|
|
|
|
|
|
`-display-column-separator`
|
|
|
|
|
|
|
|
The column separator. This is a regex.
|
|
|
|
|
|
|
|
*default*: '\t'
|
|
|
|
|
2022-07-23 14:21:00 -04:00
|
|
|
`-ballot-selected-str` *string*
|
|
|
|
|
|
|
|
When multi-select is enabled, prefix this string when element is selected.
|
|
|
|
|
|
|
|
*default*: "☑ "
|
|
|
|
|
|
|
|
`-ballot-unselected-str` *string*
|
|
|
|
|
|
|
|
When multi-select is enabled, prefix this string when element is not selected.
|
|
|
|
|
2022-08-07 03:47:22 -04:00
|
|
|
*default*: "☐ "
|
2021-12-17 05:13:29 -05:00
|
|
|
|
2022-11-19 15:03:22 -05:00
|
|
|
`-ellipsize-mode` (start|middle|end)
|
|
|
|
|
|
|
|
Set ellipsize mode on the listview.
|
|
|
|
|
|
|
|
*default* "end"
|
|
|
|
|
2022-10-25 13:14:25 -04:00
|
|
|
## PARSING ROW OPTIONS
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
Extra options for individual rows can be also set. See the **rofi-script(5)**
|
|
|
|
manpage for details; the syntax and supported features are identical.
|
2022-10-25 13:14:25 -04:00
|
|
|
|
2021-12-17 05:13:29 -05:00
|
|
|
## RETURN VALUE
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
- **0**: Row has been selected accepted by user.
|
|
|
|
- **1**: User cancelled the selection.
|
|
|
|
- **10-28**: Row accepted by custom keybinding.
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
## SEE ALSO
|
|
|
|
|
2023-03-27 12:45:44 -04:00
|
|
|
rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-script(5),
|
|
|
|
rofi-theme-selector(1), ascii(7)
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
## AUTHOR
|
|
|
|
|
|
|
|
Qball Cow <qball@gmpclient.org>
|
|
|
|
|
|
|
|
Rasmus Steinke <rasi@xssn.at>
|
|
|
|
|
2022-02-26 11:02:26 -05:00
|
|
|
Morgane Glidic <sardemff7+rofi@sardemff7.net>
|
2021-12-17 05:13:29 -05:00
|
|
|
|
|
|
|
Original code based on work by: Sean Pringle <sean.pringle@gmail.com>
|
|
|
|
|
|
|
|
For a full list of authors, check the AUTHORS file.
|