-
Notifications
You must be signed in to change notification settings - Fork 629
mode Specs
Apart from dmenu mode, rofi can be told to call a custom script.
If you start rofi -modi yourscript:yourscript.sh
-show yourscript, this happens:
- Rofi calls
yourscript.sh
without parameters. - Your script needs to write its choices to
stdout
, separated by line breaks (\n
). - Rofi shows these entries and allows the user to choose one.
- Your script is called again with the chosen entry as its parameter.
To further improve script mode, support for passing properties exists. You can now set the prompt, a message or use markup and active/urgent colors from the script itself.
It uses the following special ASCII values:
-
\0
indicates end of entry. -
\x1f
is the field separator. -
\n
is the entry separator.
E.g. to set the prompt from a bash mode script:
echo -en "\x00prompt\x1ftesting\n"
Or to mark the first 4 rows urgent and add a message:
echo -en "\x00urgent\x1f0-3\n"
echo -en "\0message\x1fSpecial <b>bold</b> message\n"
The urgent and active syntax is identical to the dmenu command-line argument.
The following commands are supported:
- message
- prompt
- markup-rows
- urgent
- active
You can get icon with a row in a similar way:
echo -en "aap\0icon\x1ffolder\n"
Currently only 'icon' is supported.
You can already let rofi
call your script with parameters, by starting it like this: `rofi -modi yourscript:"yourscript.sh first_parameter second_parameter".
They will also be included in the last call with the user's choice.