-
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.
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 bold 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 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.
To enable pango markup, have your script print \x00markup-rows\x1ftrue\n
to stdout
before it writes the choices.
Similarly, you can change the prompt and the message, as well as the "urgent" and "active" flag.
However, custom keybindings and multi-selection are not possible as a mode.