Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
ROFI-SCRIPT(5)		      File Formats Manual		ROFI-SCRIPT(5)

       rofi script mode	- Rofi format for scriptable modi.

       rofi supports modes that	use simple scripts in the background to	gener-
       ate a list and process the result from user actions.   This  provide  a
       simple interface	to make	simple extensions to rofi.

       To  specify  a  script  mode,  set  a  mode  with the following syntax:

       For example:

	      rofi -show fb -modi ""

       The name	should be unique.

       Rofi calls the executable without arguments on  startup.	  This	should
       generate	 a  list  of options, separated	by a newline (\n) (This	can be
       changed by the script).	If the user selects an option, rofi calls  the
       executable  with	the text of that option	as the first argument.	If the
       script returns no entries, rofi quits.

       A simple	script would be:

	      #!/usr/bin/env bash

	      if [ x"$@" = x"quit" ]
		  exit 0
	      echo "reload"
	      echo "quit"

       This shows two entries, reload and quit.	When the  quit	entry  is  se-
       lected, rofi closes.

       Rofi sets the following environment variable when executing the script:

       An integer number with the current state:

       o 0: Initial call of script.

       o 1: Selected an	entry.

       o 2: Selected a custom entry.

       o 10-28:	Custom keybinding 1-19

       Environment get set when	selected entry get set with the	property value
       of the 'info' row option, if set.

Passing	mode options
       Extra options, like setting the prompt, can be set by the script.   Ex-
       tra options are lines that start	with a NULL character (\0) followed by
       a key, separator	(\x1f) and value.

       For example to set the prompt:

		  echo -en "\0prompt\x1fChange prompt\n"

       The following extra options exists:

       o prompt:      Update the prompt	text.

       o message:     Update the message text.

       o markup-rows: If 'true'	renders	markup in the row.

       o urgent:      Mark rows	as urgent. (for	syntax see the	urgent	option
	 in dmenu mode)

       o active:       Mark  rows as active. (for syntax see the active	option
	 in dmenu mode)

       o delim:	      Set the delimiter	for for	next rows. Default is '\n' and
	 this  option should finish with this. Only call this on first call of
	 script, it is remembered for consecutive calls.

       o no-custom:   Only accept listed entries, ignore custom	input.

Parsing	row options
       Extra options for individual rows can be	set.  The extra	option can  be
       specified  following  the same syntax as	mode option, but following the

       For example:

		  echo -en "aap\0icon\x1ffolder\n"

       The following options are supported:

       o icon: Set the icon for	that row.

       o meta: Specify invisible search	terms.

       o nonselectable:	If true	the row	cannot activated.

       o info: Info that, on selection,	gets placed in the ROFI_INFO  environ-
	 ment variable.	This entry does	not get	searched.

       multiple	entries	can be passed using the	\x1f separator.

		  echo -en "aap\0icon\x1ffolder\x1finfo\x1ftest\n"

DASH shell
       If  you	use the	dash shell for your script, take special care with how
       dash handles escaped values for the separators.	 See  issue  #1201  on

       rofi(1),	    rofi-sensible-terminal(1),	   dmenu(1),	rofi-theme(5),

       Qball Cow <>

       Rasmus Steinke <>

       Quentin Glidic <>

       Original	code based on work by: Sean Pringle <>

       For a full list of authors, check the AUTHORS file.

				  rofi-script			ROFI-SCRIPT(5)

NAME | DESCRIPTION | USAGE | API | Environment | Passing mode options | Parsing row options | DASH shell | SEE ALSO | AUTHOR

Want to link to this manual page? Use this URL:

home | help