rofi-dmenu(5)
β¨ rofi-dmenu(5) β¨
okay so bestie, welcome to the File Formats Manual page for rofi-dmenu β this is the whole entire guide to rofi's dmenu emulation mode, and I promise it's gonna slay π
π NAME π
rofi dmenu mode β rofi dmenu emulation, aka the moment rofi puts on its dmenu costume and honestly? It eats. π
π¦ DESCRIPTION π¦
So here's the vibe: if you want to drop rofi into your scripts as a simple selection dialog, rofi has your back β it literally supports emulating dmenu(1) (which, for the record, is A dynamic menu for X11). Iconic of it. β¨
The website for dmenu can be found here (http://tools.suckless.org/dmenu/) β go look, iykyk.
Now, real talk: rofi does not aim to be 100% compatible with dmenu. There are simply too many flavors of dmenu, likeβ¦ there's a whole buffet of them π. The idea is that the basic usage command-line flags are obeyed, and theme-related flags are not. Besides that, rofi offers some extended features β think multi-select, highlighting, message bar, extra key bindings. main character energy fr fr π
πΈ BASIC CONCEPT πΈ
In dmenu mode, rofi reads data from standard in, splits them into separate entries, and displays them. Then if the user selects a row, that row is printed out to standard out β which lets your script process it further. Chef's kiss. π«Ά
By default, separation of rows is done on new lines, making it super easy to pipe the output of one application into rofi and the output of rofi into the next. A little pipeline romance, honestly. π
π§ USAGE π§
Launch rofi with the -dmenu flag and boom β it goes into dmenu emulation mode. That's it, that's the trick:
ls | rofi -dmenu
π DMENU DROP-IN REPLACEMENT π
If argv[0] (aka the calling command) is dmenu, rofi will start in dmenu mode. So you can genuinely use it as a drop-in replacement for dmenu β just copy or symlink rofi to dmenu in $PATH. Sneaky, brilliant, obsessed. π
ln -s /usr/bin/rofi /usr/bin/dmenu
π DMENU VS SCRIPT MODE π
Okay so don't confuse these two, bestie: script mode is used to extend rofi, and dmenu mode is used to extend a script. They actually do share much of the same input format. Please see the rofi-script(5) manpage for more info. π
β DMENU SPECIFIC COMMANDLINE FLAGS β
A lot of these options can also be modified by the script using special input β check the rofi-script(5) manpage for more about that syntax. But here's the full rundown, no skips, no skimps π₯
-sepseparator β Separator for dmenu. Example: to show a list ofatoewith|as a separator:
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
-pprompt β Specify the prompt to show in dmenu mode. For example, selectmonkey, a,b,c,d, or e.
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey"
Default: dmenu
-lnumber of lines to show β Maximum number of lines the menu may show before scrolling. So yeah, past that it's scroll city π
rofi -dmenu -l 25
Default: 15
-iβ Makes dmenu searches case-insensitive. tiny lowercase gremlin mode, love her π-aX β Active row, mark X as active. Where X is a comma-separated list ofpython(1)-style indices and ranges, e.g. indices start at 0,-1refers to the last row with-2preceding it, ranges are left-open and right-close, and so on. You can specify:- 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
- A single row:
-uX β Urgent row, mark X as urgent. See-aoption 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 vibes-based freeform typing here, sorry π-no-customβ Only return a selected item, do not allow custom entry. This mode returns directly when no entries given.-formatformat β Allows the output of dmenu to be customized (N is the total number of input entries):sselected stringiindex (0 - (N-1))dindex (1 - N)qquote stringpSelected string stripped from Pango markup (Needs to be a valid string)ffilter string (user input)Fquoted filter string (user input)
Default: s
-selectstring β Select first line that matches the given string. first come, first served bestie β¨-mesgstring β 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)-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-filtercommand. little peek behind the curtain π«£-inputfile β Reads from file instead of stdin.-passwordβ Hide the input text. > okay but seriously β this should not be considered secure! Do not trust it with your secrets, bestie, i'm begging π-markup-rowsβ Tell rofi that DMenu input is Pango markup encoded, and should be rendered. See here (https://docs.gtk.org/Pango/pango_markup.html) for details about Pango markup.-multi-selectβ Allow multiple lines to be selected. Adds a small selection indicator to the left of each entry. go off, select five things at once π-syncβ Force rofi mode to first read all data from stdin before showing the selection window. This is original dmenu behavior.
Note: the default asynchronous mode will also be automatically disabled if used with conflicting options, such as-dump,-only-matchor-auto-select.
-window-titletitle β Set name used for the window title. Will be shown asRofi - title-wwindowid β Position rofi over the window with the given X11 window ID.-keep-rightβ Set ellipsize mode tostart. So, the end of the string is visible. show me the end of the sentence, i need closure π€-display-columnsβ A comma seperated list of columns to show.-display-column-separatorβ The column separator. This is a regex.
default: β
-ballot-selected-strstring β When multi-select is enabled, prefix this string when element is selected.
default: βββ
-ballot-unselected-strstring β When multi-select is enabled, prefix this string when element is not selected.
default: βββ
-ellipsize-mode(start|middle|end)β Set ellipsize mode on the listview.
default βendβ
π PARSING ROW OPTIONS π
Extra options for individual rows can be also set! See the rofi-script(5) manpage for details β the syntax and supported features are identical. same energy, different page π
π RETURN VALUE π
0: Row has been selected accepted by user. π1: User cancelled the selection. π10-28: Row accepted by custom keybinding. β¨οΈ
π SEE ALSO π
rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-script(5), rofi-theme-selector(1), ascii(7) β go read them all, or at least the ones you need, no pressure bestie π¦
π AUTHOR π
- Qball Cow
<qball@gmpclient.org> - Rasmus Steinke
<rasi@xssn.at> - Morgane Glidic
<sardemff7+rofi@sardemff7.net> - Original code based on work by: Sean Pringle
<sean.pringle@gmail.com>
For a full list of authors, check the AUTHORS file. π
and that's the whole page, bestie!! this gorgeous thing ships as part of rofi, manual page rofi-dmenu(5) β that's the source and the page name all wrapped up in a bow π mwah, go pipe something into a menu πβ¨
π¦ where this page comes from
- alpine 3.24: rofi-doc 2.0.0-r0 Β· MIT
- ubuntu resolute: rofi 2.0.0-0.2 Β· MIT
- ubuntu stonking: rofi 2.0.0-0.2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms