commit f0e5ec59994f167b1594ee477e4946eb18b09b1a Author: DaveDavenport Date: Mon Apr 15 10:56:39 2024 +0000 Deployed 4f098751 with MkDocs version: 1.4.2 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/1.7.0/rofi-script.5/index.html b/1.7.0/rofi-script.5/index.html new file mode 100644 index 00000000..1ac29d79 --- /dev/null +++ b/1.7.0/rofi-script.5/index.html @@ -0,0 +1,1485 @@ + + + + + + + + + + + + + + + + + + + + Script - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-SCRIPT 5 rofi-script

+

NAME

+

rofi script mode - Rofi format for scriptable modi.

+

DESCRIPTION

+

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

+

USAGE

+

To specify a script mode, set a mode with the following syntax: "{name}:{executable}"

+

For example:

+
rofi -show fb -modi "fb:file_browser.sh"
+
+

The name should be unique.

+

API

+

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" ]
+then
+    exit 0
+fi
+echo "reload"
+echo "quit"
+
+
+

This shows two entries, reload and quit. When the quit entry is selected, rofi closes.

+

Environment

+

Rofi sets the following environment variable when executing the script:

+

ROFI_RETV

+

An integer number with the current state:

+
    +
  • 0: Initial call of script.
  • +
  • 1: Selected an entry.
  • +
  • 2: Selected a custom entry.
  • +
  • 10-28: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
  • +
+

ROFI_INFO

+

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. +Extra 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:

+
    +
  • prompt: Update the prompt text.
  • +
  • message: Update the message text.
  • +
  • markup-rows: If 'true' renders markup in the row.
  • +
  • urgent: Mark rows as urgent. (for syntax see the urgent option in dmenu mode)
  • +
  • active: Mark rows as active. (for syntax see the active option in dmenu mode)
  • +
  • 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.
  • +
  • no-custom: If set to 'true'; only accept listed entries, ignore custom input.
  • +
  • use-hot-keys: If set to true, it enabled the Custom keybindings for script. Warning this breaks the normal rofi flow.
  • +
+

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 entry.

+

For example:

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

The following options are supported:

+
    +
  • icon: Set the icon for that row.
  • +
  • meta: Specify invisible search terms.
  • +
  • nonselectable: If true the row cannot activated.
  • +
  • info: Info that, on selection, gets placed in the ROFI_INFO environment variable. This entry does not get searched.
  • +
+

multiple entries can be passed using the \x1f separator.

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

Executing external program

+

If you want to launch an external program from the script, you need to make sure it is launched in the background. +If not rofi will wait for its output (to display).

+

In bash the best way to do this is using coproc.

+
 coproc ( myApp  > /dev/null  2>&1 )
+
+

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 github.

+

SEE ALSO

+

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

+

AUTHOR

+

Qball Cow qball@gmpclient.org

+

Rasmus Steinke rasi@xssn.at

+

Quentin 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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.0/rofi-theme.5/index.html b/1.7.0/rofi-theme.5/index.html new file mode 100644 index 00000000..ffa249a9 --- /dev/null +++ b/1.7.0/rofi-theme.5/index.html @@ -0,0 +1,3034 @@ + + + + + + + + + + + + + + + + + + + + + + Themes - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-THEME 5 rofi-theme

+

NAME

+

rofi-theme - Rofi theme format files

+

DESCRIPTION

+

The need for a new theme format was motivated by the fact that the way rofi handled widgets has changed. From a very +static drawing of lines and text to a nice structured form of packing widgets. This change made it possible to provide a +more flexible theme framework. The old theme format and config file are not flexible enough to expose these options in a +user-friendly way. Therefore, a new file format has been created, replacing the old one.

+

FORMAT SPECIFICATION

+

Encoding

+

The encoding of the file is utf-8. Both unix (\n) and windows (\r\n) newlines format are supported. But unix is +preferred.

+

Comments

+

C and C++ file comments are supported.

+
    +
  • Anything after // and before a newline is considered a comment.
  • +
  • Everything between /* and */ is a comment.
  • +
+

Comments can be nested and the C comments can be inline.

+

The following is valid:

+
// Magic comment.
+property: /* comment */ value;
+
+

However, this is not:

+
prop/*comment*/erty: value;
+
+

White space

+

White space and newlines, like comments, are ignored by the parser.

+

This:

+
property: name;
+
+

Is identical to:

+
     property             :
+name
+
+;
+
+

File extension

+

The preferred file extension for the new theme format is rasi. This is an +abbreviation for rofi advanced style information.

+

Basic Structure

+

Each element has a section with defined properties. Global properties can be defined in section * { }. +Sub-section names begin with a hash symbol #.

+

It is advised to define the global properties section on top of the file to +make inheritance of properties clearer.

+
/* Global properties section */
+* {
+    // list of properties
+}
+
+/* Element theme section. */
+{element path} {
+    // list of properties
+}
+{elements... } {
+    // list of properties
+}
+
+

If there are multiple sections with the same name, they are merged. Duplicate properties are overwritten and the last +parsed entry kept.

+

Global properties section

+

A theme can have one or more global properties sections. If there is more than one, +they will be merged.

+

The global properties section denotes the defaults for each element. +Each property of this section can be referenced with @{identifier} +(See Properties section)

+

A global properties section is indicated with a * as element path.

+

Element theme section

+

A theme can have multiple element theme sections.

+

The element path can consist of multiple names separated by whitespace or dots. +Each element may contain any number of letters, numbers and -'s. +The first element in the element path should always start with a #. +Multiple elements can be specified by a ,.

+

This is a valid element name:

+
element normal.normal {
+    background-color: blue;
+}
+button {
+    background-color: blue;
+}
+
+

And is identical to:

+
element normal normal, button {
+    background-color: blue;
+}
+
+

Each section inherits the global properties. Properties can be explicitly inherited from their parent with the +inherit keyword. +In the following example:

+
window {
+ a: 1;
+ b: 2;
+ children: [ mainbox ];
+}
+mainbox {
+    a: inherit;
+    b: 4;
+    c: 8;
+}
+
+

The element mainbox will have the following set of properties (if mainbox is a child of window):

+
a: 1;
+b: 4;
+c: 8;
+
+

If multiple sections are defined with the same name, they are merged by the +parser. If multiple properties with the same name are defined in one section, +the last encountered property is used.

+

Properties Format

+

The properties in a section consist of:

+
{identifier}: {value};
+
+

Both fields are mandatory for a property.

+

The identifier names the specified property. Identifiers can consist of any +combination of numbers, letters and '-'. It must not contain any whitespace. +The structure of the value defines the type of the property. The current +parser does not define or enforce a certain type of a particular identifier. +When used, values with the wrong type that cannot be converted are ignored.

+

The current theme format supports different types:

+
    +
  • a string
  • +
  • an integer number
  • +
  • a fractional number
  • +
  • a boolean value
  • +
  • a color
  • +
  • image
  • +
  • text style
  • +
  • line style
  • +
  • a distance
  • +
  • a padding
  • +
  • a border
  • +
  • a position
  • +
  • a reference
  • +
  • an orientation
  • +
  • a cursor
  • +
  • a list of keywords
  • +
  • an environment variable
  • +
  • Inherit
  • +
+

Some of these types are a combination of other types.

+

String

+
    +
  • Format: "[:print:]+"
  • +
+

A string is always surrounded by double quotes ("). Between the quotes there can be any printable character.

+

For example:

+
font: "Awasome 12";
+
+

The string must be valid UTF-8.

+

Integer

+
    +
  • Format: [-+]?[:digit:]+
  • +
+

An integer may contain any number.

+

For examples:

+
lines: 12;
+
+

Real

+
    +
  • Format: [-+]?[:digit:]+(\.[:digit:]+)?
  • +
+

A real is an integer with an optional fraction.

+

For example:

+
real: 3.4;
+
+

The following is not valid: .3, 3. or scientific notation: 3.4e-3.

+

Boolean

+
    +
  • Format: (true|false)
  • +
+

Boolean value is either true or false. This is case-sensitive.

+

For example:

+
dynamic: false;
+
+

Image

+

rofi support a limited set of background-image formats.

+
    +
  • Format: url("path to image");
  • +
  • Format: url("path to image", scale); + where scale is: none, both, width, height
  • +
  • Format: linear-gradient(stop color,stop1, color, stop2 color, ...);
  • +
  • Format: linear-gradient(to direction, stop color,stop1, color, stop2 color, ...); + where direction is: top,left,right,bottom.
  • +
  • Format: linear-gradient(angle, stop color,stop1, color, stop2 color, ...); + Angle in deg,rad,grad (as used in color).
  • +
+

Where the path is a string, and stop color is of type color.

+

Color

+

rofi supports the color formats as specified in the CSS standard (1,2,3 and some of CSS 4)

+
    +
  • Format: #{HEX}{3} (rgb)
  • +
  • Format: #{HEX}{4} (rgba)
  • +
  • Format: #{HEX}{6} (rrggbb)
  • +
  • Format: #{HEX}{8} (rrggbbaa)
  • +
  • Format: rgb[a]({INTEGER},{INTEGER},{INTEGER}[, {PERCENTAGE}])
  • +
  • Format: rgb[a]({INTEGER}%,{INTEGER}%,{INTEGER}%[, {PERCENTAGE}])
  • +
  • Format: hsl[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])
  • +
  • Format: hwb[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])
  • +
  • Format: cmyk( {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE} ])
  • +
  • Format: {named-color} [ / {PERCENTAGE} ]
  • +
+

The white-space format proposed in CSS4 is also supported.

+

The different values are:

+
    +
  • {HEX} is a hexadecimal number ('0-9a-f' case insensitive).
  • +
  • {INTEGER} value can be between 0 and 255 or 0-100 when representing percentage.
  • +
  • {ANGLE} is the angle on the color wheel, can be in deg, rad, grad or turn. When no unit is specified, degrees is assumed.
  • +
  • {PERCENTAGE} can be between 0-1.0, or 0%-100%
  • +
  • +

    {named-color} is one of the following colors:

    +

    AliceBlue, AntiqueWhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet, Brown, +BurlyWood, CadetBlue, Chartreuse, Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, DarkCyan, +DarkGoldenRod, DarkGray, DarkGrey, DarkGreen, DarkKhaki, DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, +DarkSalmon, DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkSlateGrey, DarkTurquoise, DarkViolet, DeepPink, DeepSkyBlue, +DimGray, DimGrey, DodgerBlue, FireBrick, FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, GoldenRod, +Gray, Grey, Green, GreenYellow, HoneyDew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, +LemonChiffon, LightBlue, LightCoral, LightCyan, LightGoldenRodYellow, LightGray, LightGrey, LightGreen, LightPink, +LightSalmon, LightSeaGreen, LightSkyBlue, LightSlateGray, LightSlateGrey, LightSteelBlue, LightYellow, Lime, LimeGreen, +Linen, Magenta, Maroon, MediumAquaMarine, MediumBlue, MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, +MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, MintCream, MistyRose, Moccasin, NavajoWhite, Navy, +OldLace, Olive, OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenRod, PaleGreen, PaleTurquoise, PaleVioletRed, +PapayaWhip, PeachPuff, Peru, Pink, Plum, PowderBlue, Purple, RebeccaPurple, Red, RosyBrown, RoyalBlue, SaddleBrown, +Salmon, SandyBrown, SeaGreen, SeaShell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray, SlateGrey, Snow, SpringGreen, +SteelBlue, Tan, Teal, Thistle, Tomato, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, YellowGreen,transparent

    +
  • +
+

For example:

+
background-color: #FF0000;
+border-color: rgba(0,0,1, 0.5);
+text-color: SeaGreen;
+
+

or

+
background-color: transparent;
+text-color: Black;
+
+

Text style

+
    +
  • Format: (bold|italic|underline|strikethrough|none)
  • +
+

Text style indicates how the highlighted text is emphasized. None indicates that no emphasis +should be applied.

+
    +
  • bold: make the text thicker then the surrounding text.
  • +
  • italic: put the highlighted text in script type (slanted).
  • +
  • underline: put a line under the highlighted text.
  • +
  • strikethrough: put a line through the highlighted text.
  • +
+

Line style

+
    +
  • Format: (dash|solid)
  • +
+

Indicates how a line should be drawn. +It currently supports: + * dash: a dashed line, where the gap is the same width as the dash + * solid: a solid line

+

Distance

+
    +
  • Format: {Integer}px
  • +
  • Format: {Real}em
  • +
  • Format: {Real}ch
  • +
  • Format: {Real}%
  • +
  • Format: {Integer}mm
  • +
+

A distance can be specified in 3 different units:

+
    +
  • px: Screen pixels.
  • +
  • em: Relative to text height.
  • +
  • ch: Relative to width of a single number.
  • +
  • mm: Actual size in millimeters (based on dpi).
  • +
  • %: Percentage of the monitor size.
  • +
+

Distances used in the horizontal direction use the monitor width. Distances in +the vertical direction use the monitor height. +For example:

+
   padding: 10%;
+
+

On a full-HD (1920x1080) monitor, it defines a padding of 192 pixels on the left +and right side and 108 pixels on the top and bottom.

+

Calculating sizes

+

Rofi supports some maths in calculating sizes. For this it uses the CSS syntax:

+
width: calc( 100% - 37px );
+
+

It supports the following operations:

+
    +
  • + : Add
  • +
  • - : Subtract
  • +
  • / : Divide
  • +
  • * : Multiply
  • +
  • % : Multiply
  • +
  • min : Minimum of l or rvalue;
  • +
  • max : Maximum of l or rvalue;
  • +
+

It uses the C precedence ordering.

+

Padding

+
    +
  • Format: {Integer}
  • +
  • Format: {Distance}
  • +
  • Format: {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance} {Distance}
  • +
+

If no unit is specified, pixels are assumed.

+

The different number of fields in the formats are parsed like:

+
    +
  • 1 field: all
  • +
  • 2 fields: top&bottom left&right
  • +
  • 3 fields: top, left&right, bottom
  • +
  • 4 fields: top, right, bottom, left
  • +
+

Border

+
    +
  • Format: {Integer}
  • +
  • Format: {Distance}
  • +
  • Format: {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style} {Distance} {Line style}
  • +
+

Borders are identical to padding, except that each distance field has a line +style property.

+
+

When no unit is specified, pixels are assumed.

+
+

Position

+

Indicate a place on the window/monitor.

+
    +
  • Format: (center|east|north|west|south|north east|north west|south west|south east)
  • +
+

+north west   |    north    |  north east
+-------------|-------------|------------
+      west   |   center    |  east
+-------------|-------------|------------
+south west   |    south    |  south east
+
+

Visibility

+

It is possible to hide widgets:

+

inputbar { + enabled: false; +}

+

Reference

+
    +
  • Format: @{PROPERTY NAME}
  • +
+

A reference can point to another reference. Currently, the maximum number of redirects is 20. +A property always refers to another property. It cannot be used for a subpart of the property. +For example, this is not valid:

+
highlight: bold @pink;
+
+

But this is:

+
* {
+    myhigh: bold #FAA;
+}
+
+window {
+    highlight: @myhigh;
+}
+
+

Orientation

+
    +
  • Format: (horizontal|vertical)
  • +
+

Specify the orientation of the widget.

+

Cursor

+
    +
  • Format: (default|pointer|text)
  • +
+

Specify the type of mouse cursor that is set when the mouse pointer is over the widget.

+

List of keywords

+
    +
  • Format: [ keyword, keyword ]
  • +
+

A list starts with a '[' and ends with a ']'. The entries in the list are comma-separated. +The keyword in the list refers to an widget name.

+

Environment variable

+
    +
  • Format: ${:alnum:}
  • +
+

This will parse the environment variable as the property value. (that then can be any of the above types). +The environment variable should be an alphanumeric string without white-space.

+
* {
+    background-color: ${BG};
+}
+
+

Inherit

+
    +
  • Format: inherit
  • +
+

Inherits the property from its parent widget.

+
mainbox {
+    border-color: inherit;
+}
+
+

ELEMENTS PATHS

+

Element paths exists of two parts, the first part refers to the actual widget by name. +Some widgets have an extra state.

+

For example:

+
element selected {
+}
+
+

Here element selected is the name of the widget, selected is the state of the widget.

+

The difference between dots and spaces is purely cosmetic. These are all the same:

+
element .selected {
+
+element.selected {
+}
+element selected {
+}
+
+

SUPPORTED ELEMENT PATH

+

Name

+

The current widgets available in rofi:

+
    +
  • window
  • +
  • overlay: the overlay widget.
  • +
  • mainbox: The mainbox box.
      +
    • inputbar: The input bar box.
    • +
    • box: the horizontal @box packing the widgets
    • +
    • case-indicator: the case/sort indicator @textbox
    • +
    • prompt: the prompt @textbox
    • +
    • entry: the main entry @textbox
    • +
    • num-rows: Shows the total number of rows.
    • +
    • num-filtered-rows: Shows the total number of rows after filtering.
    • +
    • listview: The listview.
    • +
    • scrollbar: the listview scrollbar
    • +
    • element: a box in the listview holding the entries
        +
      • element-icon: the widget in the listview's entry showing the (optional) icon
      • +
      • element-index: the widget in the listview's entry keybindable index (1,2,3..0)
      • +
      • element-text: the widget in the listview's entry showing the text.
      • +
      +
    • +
    • mode-switcher: the main horizontal @box packing the buttons.
    • +
    • button: the buttons @textbox for each mode
    • +
    • message: The container holding the textbox.
    • +
    • textbox: the message textbox
    • +
    +
  • +
+

Note that these path names match the default theme. Themes that provide a custom layout will have different +elements, and structure.

+

State

+

State: State of widget

+

Optional flag(s) indicating state of the widget, used for theming.

+

These are appended after the name or class of the widget.

+

Example:

+

button selected.normal { }

+

element selected.urgent { }

+

Currently only the entrybox and scrollbar have states:

+

Entrybox:

+

{visible modifier}.{state}

+

Where visible modifier can be: + * normal: no modification + * selected: the entry is selected/highlighted by user + * alternate: the entry is at an alternating row (uneven row)

+

Where state is: + * normal: no modification + * urgent: this entry is marked urgent + * active: this entry is marked active

+

These can be mixed.

+

Example:

+
nametotextbox selected.active {
+    background-color: #003642;
+    text-color: #008ed4;
+}
+
+

Sets all selected textboxes marked active to the given text and background color. +Note that a state modifies the original element, it therefore contains all the properties of that element.

+

Scrollbar

+

The scrollbar uses the handle state when drawing the small scrollbar handle. +This allows the colors used for drawing the handle to be set independently.

+

SUPPORTED PROPERTIES

+

The following properties are currently supported:

+

all widgets:

+
    +
  • enabled: enable/disable the widget
  • +
  • padding: padding + Padding on the inside of the widget
  • +
  • margin: padding + Margin on the outside of the widget
  • +
  • border: border + Border around the widget (between padding and margin)/
  • +
  • border-radius: padding + Sets a radius on the corners of the borders.
  • +
  • background-color: color + Background color
  • +
  • background-image: image + Background image
  • +
  • border-color: color + Color of the border
  • +
  • cursor: cursor + Type of mouse cursor that is set when the mouse pointer is hovered over the widget.
  • +
+

window:

+
    +
  • +

    font: string + The font used in the window

    +
  • +
  • +

    transparency: string + Indicating if transparency should be used and what type: + real - True transparency. Only works with a compositor. + background - Take a screenshot of the background image and use that. + screenshot - Take a screenshot of the screen and use that. + Path to png file - Use an image.

    +
  • +
  • +

    location: position + The place of the anchor on the monitor

    +
  • +
  • anchor: anchor + The anchor position on the window
  • +
  • fullscreen: boolean + Window is fullscreen.
  • +
  • width: distance + The width of the window
  • +
  • x-offset: distance
  • +
  • y-offset: distance + The offset of the window to the anchor point, allowing you to push the window left/right/up/down
  • +
+

scrollbar:

+
    +
  • background-color: color
  • +
  • handle-width: distance
  • +
  • handle-color: color
  • +
  • border-color: color
  • +
+

box:

+
    +
  • orientation: orientation + Set the direction the elements are packed.
  • +
  • spacing: distance + Distance between the packed elements.
  • +
+

textbox:

+
    +
  • background-color: color
  • +
  • border-color: the color used for the border around the widget.
  • +
  • font: the font used by this textbox (string).
  • +
  • str: the string to display by this textbox (string).
  • +
  • vertical-align: Vertical alignment of the text. A number between 0 (top) and 1 (bottom).
  • +
  • horizontal-align: Horizontal alignment of the text. A number between 0 (left) and 1 (right).
  • +
  • text-color: the text color to use.
  • +
  • highlight: text style {color}. + color is optional, multiple highlight styles can be added like: bold underline italic #000000; + This option is only available on the element-text widget.
  • +
  • width: override the desired width for the textbox.
  • +
  • content: Set the displayed text (String).
  • +
  • placeholder: Set the displayed text (String) when nothing is entered.
  • +
  • placeholder-color: Color of the placeholder text.
  • +
  • blink: Enable/Disable blinking on an input textbox (Boolean).
  • +
  • markup: Force markup on, beware that only valid pango markup strings are shown.
  • +
+

listview:

+
    +
  • columns: integer + Number of columns to show (at least 1)
  • +
  • fixed-height: boolean + Always show lines rows, even if fewer elements are available.
  • +
  • dynamic: boolean + True if the size should change when filtering the list, False if it should keep the original height.
  • +
  • scrollbar: boolean + If the scrollbar should be enabled/disabled.
  • +
  • scrollbar-width: distance + Width of the scrollbar
  • +
  • cycle: boolean + When navigating, it should wrap around
  • +
  • spacing: distance + Spacing between the elements (both vertical and horizontal)
  • +
  • lines: integer + Number of rows to show in the list view.
  • +
  • layout: orientation + Indicate how elements are stacked. Horizontal implements the dmenu style.
  • +
  • reverse: boolean + Reverse the ordering (top down to bottom up).
  • +
  • fixed-columns: boolean + Do not reduce the number of columns shown when number of visible elements is not enough to fill them all.
  • +
+

Each element is a box called element. Each element can contain an element-icon and element-text.

+

listview text highlight:

+

The element-text widget in the listview is the one used to show the text. +On this widget set the highlight property (only place this property is used) to change +the style of highlighting. +The highlight property consist of the text-style property and a color.

+

To disable highlighting:

+
  element-text {
+    highlight: None;
+  }
+
+

To set to red underlined:

+
  element-text {
+    highlight: underline red;
+  }
+
+

Layout

+

The new format allows the layout of the rofi window to be tweaked extensively. +For each widget, the themer can specify padding, margin, border, font, and more. +It even allows, as an advanced feature, to pack widgets in a custom structure.

+

Basic structure

+

The whole view is made out of boxes that pack other boxes or widgets. +The box can be vertical or horizontal. This is loosely inspired by GTK.

+

The current layout of rofi is structured as follows:

+
|------------------------------------------------------------------------------------|
+| window {BOX:vertical}                                                              |
+| |-------------------------------------------------------------------------------|  |
+| | mainbox  {BOX:vertical}                                                       |  |
+| | |---------------------------------------------------------------------------| |  |
+| | | inputbar {BOX:horizontal}                                                 | |  |
+| | | |---------| |-| |---------------------------------|---| |---| |---| |---| | |  |
+| | | | prompt  | |:| | entry                           |#fr| | / | |#ns| |ci | | |  |
+| | | |---------| |_| |---------------------------------|---| |---| |---| |---| | |  |
+| | |---------------------------------------------------------------------------| |  |
+| |                                                                               |  |
+| | |---------------------------------------------------------------------------| |  |
+| | | message                                                                   | |  |
+| | | |-----------------------------------------------------------------------| | |  |
+| | | | textbox                                                               | | |  |
+| | | |-----------------------------------------------------------------------| | |  |
+| | |---------------------------------------------------------------------------| |  |
+| |                                                                               |  |
+| | |-----------------------------------------------------------------------------|  |
+| | | listview                                                                    |  |
+| | |-----------------------------------------------------------------------------|  |
+| |                                                                               |  |
+| | |---------------------------------------------------------------------------| |  |
+| | |  mode-switcher {BOX:horizontal}                                           | |  |
+| | | |---------------|   |---------------|  |--------------| |---------------| | |  |
+| | | | Button        |   | Button        |  | Button       | | Button        | | |  |
+| | | |---------------|   |---------------|  |--------------| |---------------| | |  |
+| | |---------------------------------------------------------------------------| |  |
+| |-------------------------------------------------------------------------------|  |
+|------------------------------------------------------------------------------------|
+
+
+
+
+
    +
  • ci is the case-indicator
  • +
  • fr is the num-filtered-rows
  • +
  • ns is the num-rows
  • +
+
+

Error message structure

+
|-----------------------------------------------------------------------------------|
+| window {BOX:vertical}                                                             |
+| |------------------------------------------------------------------------------|  |
+| | error-message {BOX:vertical}                                                 |  |
+| | |-------------------------------------------------------------------------|  |  |
+| | | textbox                                                                 |  |  |
+| | | |-----------------| |-------------------------------------------------| |  |  |
+| | | |element-icon     | |element-text                                     | |  |  |
+| | | |-----------------| |-------------------------------------------------| |  |  |
+| | |-------------------------------------------------------------------------|  |  |
+| |------------------------------------------------------------------------------|  |
+|-----------------------------------------------------------------------------------|
+
+
+
+

Advanced layout

+

The layout of rofi can be tweaked by packing the 'fixed' widgets in a custom structure.

+

The following widgets are fixed, as they provide core rofi functionality:

+
    +
  • prompt
  • +
  • entry
  • +
  • overlay
  • +
  • case-indicator
  • +
  • message
  • +
  • listview
  • +
  • mode-switcher
  • +
  • num-rows
  • +
  • num-filtered-rows
  • +
+

The following keywords are defined and can be used to automatically pack a subset of the widgets. +These are used in the default theme as depicted in the figure above.

+
    +
  • mainbox + Packs: inputbar, message, listview, mode-switcher
  • +
  • inputbar + Packs: prompt,entry,case-indicator
  • +
+

Any widget name starting with textbox is a textbox widget, others are box widgets and can pack other widgets.

+

There are several special widgets that can be used by prefixing the name of the widget:

+

textbox

+

This is a read-only textbox widget. The displayed string can be set with content.

+

Example:

+
textbox-custom {
+  expand: false;
+  content: "My Message";
+}
+
+

Icon

+

This is an icon widget. The displayed icon can be set with filename and size with size. +If the property action is set, it acts as a button. +action can be set to a keybinding name and completes that action. (see rofi -show keys for a list).

+

If the squared property is set to false the widget height and width are not forced to be equal.

+

Example:

+
icon-paste {
+    expand: false;
+    filename: "gtk-paste";
+    size: 24;
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

button

+

This is a textbox widget that can have a 'clickable' action. +The action can be set to: +keybinding: accepts a keybinding name and completes that action. (see rofi -show keys for a list).

+
button-paste {
+    expand: false;
+    content: "My Clickable Message";
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

Children

+

To specify children, set the children +property (this always happens on the box child, see example below):

+
inputbar {
+  children: [prompt,entry,overlay,case-indicator];
+}
+
+

The theme needs to be updated to match the hierarchy specified.

+

Below is an example of a theme emulating dmenu:

+
* {
+    background-color:      Black;
+    text-color:            White;
+    border-color:          White;
+    font:            "Times New Roman 12";
+}
+
+window {
+    anchor:     north;
+    location:   north;
+    width:      100%;
+    padding:    4px;
+    children:   [ horibox ];
+}
+
+horibox {
+    orientation: horizontal;
+    children:   [ prompt, entry, listview ];
+}
+
+listview {
+    layout:     horizontal;
+    spacing:    5px;
+    lines:      10;
+}
+
+entry {
+    expand:     false;
+    width:      10em;
+}
+
+element {
+    padding: 0px 2px;
+}
+element selected {
+    background-color: SteelBlue;
+}
+
+

Padding and margin

+

Just like CSS, rofi uses the box model for each widget.

+
|-------------------------------------------------------------------|
+| margin                                                            |
+|  |-------------------------------------------------------------|  |
+|  | border                                                      |  |
+|  | |---------------------------------------------------------| |  |
+|  | | padding                                                 | |  |
+|  | | |-----------------------------------------------------| | |  |
+|  | | | content                                             | | |  |
+|  | | |-----------------------------------------------------| | |  |
+|  | |---------------------------------------------------------| |  |
+|  |-------------------------------------------------------------|  |
+|-------------------------------------------------------------------|
+
+

Explanation of the different parts:

+
    +
  • Content - The content of the widget.
  • +
  • Padding - Clears an area around the widget. + The padding shows the background color of the widget.
  • +
  • Border - A border that goes around the padding and content. + The border use the border-color of the widget.
  • +
  • Margin - Clears an area outside the border. + The margin is transparent.
  • +
+

The box model allows us to add a border around elements, and to define space between elements.

+

The size of each margin, border, and padding can be set. +For the border, a linestyle and radius can be set.

+

Spacing

+

Widgets that can pack more then one child widget (currently box and listview) have the spacing property. +This property sets the distance between the packed widgets (both horizontally and vertically).

+
|---------------------------------------|
+|  |--------| s |--------| s |-------|  |
+|  | child  | p | child  | p | child |  |
+|  |        | a |        | a |       |  |
+|  |        | c |        | c |       |  |
+|  |        | i |        | i |       |  |
+|  |        | n |        | n |       |  |
+|  |--------| g |--------| g |-------|  |
+|---------------------------------------|
+
+

Advanced box packing

+

More dynamic spacing can be achieved by adding dummy widgets, for example to make one widget centered:

+
|--------------------------------------------|
+|  |-----------|  |--------|  |-----------|  |
+|  | dummy     |  | child  |  | dummy     |  |
+|  | expand: y |  |        |  | expand: y |  |
+|  |           |  |        |  |           |  |
+|  |           |  |        |  |           |  |
+|  |           |  |        |  |           |  |
+|  |-----------|  |--------|  |-----------|  |
+|--------------------------------------------|
+
+

If both dummy widgets are set to expand, child will be centered. Depending on the expand flag of child the +remaining space will be equally divided between both dummy and child widget (expand enabled), or both dummy widgets +(expand disabled).

+

DEBUGGING

+

To get debug information from the parser, run rofi like:

+
G_MESSAGES_DEBUG=Parser rofi -show run
+
+

Syntax errors are shown in a popup and printed out to command line with the above command.

+

To see the elements queried during running, run:

+
G_MESSAGES_DEBUG=Theme rofi -show run
+
+

To test minor changes, part of the theme can be passed on the command line, for example to set it to full-screen:

+
rofi -theme-str 'window { fullscreen:true;}' -show run
+
+

To print the current theme, run:

+
rofi -dump-theme
+
+

Media support

+

Parts of the theme can be conditionally loaded, like the CSS @media option.

+
@media ( min-width: 120 ) {
+
+}
+
+

It supports the following keys as constraint:

+
    +
  • min-width: load when width is bigger or equal then value.
  • +
  • max-width: load when width is smaller then value.
  • +
  • min-height: load when height is bigger or equal then value.
  • +
  • max-height: load when height is smaller then value.
  • +
  • min-aspect-ratio load when aspect ratio is over value.
  • +
  • max-aspect-ratio: load when aspect ratio is under value.
  • +
  • monitor-id: The monitor id, see rofi -help for id's.
  • +
+

@media takes an integer number or a fraction, for integer number px can be added.

+
@media ( min-width: 120 px ) {
+
+}
+
+

Font Parsing

+

Rofi uses pango for font rendering. The font should be specified in a format that pango +understands. +This normally is the font name followed by the font size. For example:

+
mono 18
+
+

Or

+
FontAwesome 22
+
+

Multiple file handling

+

The rasi file format offers two methods of including other files. +This can be used to modify existing themes, or have multiple variations on a theme.

+
    +
  • import: Import and parse a second file.
  • +
  • theme: Discard theme, and load file as a fresh theme.
  • +
+

Syntax:

+
@import "myfile"
+@theme "mytheme"
+
+

The specified file can either by name, filename,full path.

+

If a filename is provided, it will try to resolve it in the following order:

+
    +
  • ${XDG_CONFIG_HOME}/rofi/themes/
  • +
  • ${XDG_CONFIG_HOME}/rofi/
  • +
  • ${XDG_DATA_HOME}/rofi/themes/
  • +
  • ${INSTALL PREFIX}/share/rofi/themes/
  • +
+

A name is resolved as a filename by appending the .rasi extension.

+

EXAMPLES

+

Several examples are installed together with rofi. These can be found in {datadir}/rofi/themes/, where +{datadir} is the install path of rofi data. When installed using a package manager, this is usually: /usr/share/.

+

SEE ALSO

+

rofi(1), rofi-script(5), rofi-theme-selector(1)

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.0/rofi.1/index.html b/1.7.0/rofi.1/index.html new file mode 100644 index 00000000..09374d83 --- /dev/null +++ b/1.7.0/rofi.1/index.html @@ -0,0 +1,2650 @@ + + + + + + + + + + + + + + + + + + + + + + Rofi - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

ROFI 1 rofi

+

NAME

+

rofi - A window switcher, application launcher, ssh dialog, dmenu replacement and more

+

SYNOPSIS

+

rofi [ -show mode ]|[ -dmenu ]|[ -e msg ] [ CONFIGURATION ]

+

DESCRIPTION

+

rofi is an X11 pop-up window switcher, run dialog, dmenu replacement, and more. It focuses on +being fast to use and have minimal distraction. It supports keyboard and mouse navigation, type to +filter, tokenized search and more.

+

USAGE

+

rofi's main functionality is to assist in your workflow, allowing you to quickly switch +between windows, start applications or log into a remote machine via ssh. +There are different modi for different types of actions.

+

rofi can also function as (drop-in) replacement for dmenu(1).

+

Running rofi

+

To launch rofi directly in a certain mode, specify a mode with rofi -show <mode>. +To show the run dialog:

+
rofi -show run
+
+

Emulating dmenu

+

rofi can emulate dmenu(1) (a dynamic menu for X11) when launched with the -dmenu flag.

+

The website for dmenu can be found here.

+

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).

+

Display Error message

+

rofi error dialog can also be called from the command line.

+
rofi -e "my message"
+
+

Markup support can be enabled, see CONFIGURATION options.

+

CONFIGURATION

+

There are currently three methods of setting configuration options (evaluated in order below):

+
    +
  • System configuration file (for example /etc/rofi.rasi). + It first checks XDG_CONFIG_DIRS, and then SYSCONFDIR (that is passed at compile time). + It loads the first config file it finds, it does not merge multiple system configuration files.
  • +
  • Rasi theme file: The new theme format can be used to set configuration values.
  • +
  • Command-line options: Arguments passed to rofi.
  • +
+

To get a template config file, run: rofi -dump-config > config.rasi

+

This will contain (commented) all current configuration options, modified options are uncommented.

+

The configuration system supports the following types:

+
    +
  • string
  • +
  • integer (signed and unsigned)
  • +
  • char
  • +
  • boolean
  • +
  • lists
  • +
+

For the syntax of these options, see the rofi-theme(5) manpage.

+

For use on the command line, Boolean options have a non-default command-line +syntax. Example to enable option X:

+
-X
+
+

To disable option X:

+
-no-X
+
+

Below is a list of the most important options:

+

General

+

-help

+

The help option shows the full list of command-line options and the current set values. +These include dynamic (run-time generated) options.

+

-version

+

Show the rofi version and exit.

+

-dump-config

+

Dump the current active configuration, in rasi format, to stdout and exit. +Information about the rasi format can be found in the rofi-theme(5) manpage.

+

-dump-theme

+

Dump the current active theme, in rasi format, to stdout and exit.

+

-rasi-validate filename

+

Try to parse the file and return 0 when successful, non-zero when failed.

+

-threads num

+

Specify the number of threads rofi should use:

+
    +
  • 0: Autodetect the number of supported hardware threads.
  • +
  • 1: Disable threading
  • +
  • +

    2..n: Specify the maximum number of threads to use in the thread pool.

    +

    Default: Autodetect

    +
  • +
+

-display display

+

The X server to contact. Default is $DISPLAY.

+

-dmenu

+

Run rofi in dmenu mode. This allows for interactive scripts. +In dmenu mode, rofi reads from STDIN, and output to STDOUT. +A simple example, displaying three pre-defined options:

+
echo -e "Option #1\nOption #2\nOption #3" | rofi -dmenu
+
+

Or get the options from a script:

+
~/my_script.sh | rofi -dmenu
+
+

-show mode

+

Open rofi in a certain mode. Available modes are window, run, drun, ssh, combi. +The special argument keys can be used to open a searchable list of supported key bindings +(see KEY BINDINGS)

+

To show the run-dialog:

+
rofi -show run
+
+

If -show is the last option passed to rofi, the first enabled modi is shown.

+

-modi mode1,mode2

+

Specify an ordered, comma-separated list of modes to enable. +Enabled modes can be changed at runtime. Default key is Ctrl+Tab. +If no modes are specified, all configured modes will be enabled. +To only show the run and ssh launcher:

+
rofi -modi "run,ssh" -show run
+
+

Custom modes can be added using the internal script mode. Each such mode has two parameters:

+
<name>:<script>
+
+

Example: Have a mode called 'Workspaces' using the i3_switch_workspaces.sh script:

+
rofi -modi "window,run,ssh,Workspaces:i3_switch_workspaces.sh" -show Workspaces
+
+

Notes: The i3 window manager dislikes commas in the command when specifying an exec command. +For that case, # can be used as a separator.

+

TIP: The name is allowed to contain spaces:

+
rofi -modi "My File Browser:fb.sh" -show "My File Browser"
+
+

-case-sensitive

+

Start in case-sensitive mode. +This option can be changed at run-time using the -kb-toggle-case-sensitivity key binding.

+

-cycle

+

Cycle through the result list. Default is 'true'.

+

-filter filter

+

Filter the list by setting text in input bar to filter

+

-config filename

+

Load an alternative configuration file.

+

-cache-dir filename

+

Directory that is used to place temporary files, like history.

+

-scroll-method method

+

Select the scrolling method. 0: Per page, 1: continuous.

+

-normalize-match

+

Normalize the string before matching, so o will match ö, and é matches e.
+This is not a perfect implementation, but works. For now, it disables highlighting of the matched part.

+

-no-lazy-grab

+

Disables lazy grab, this forces the keyboard being grabbed before gui is shown.

+

-no-plugins

+

Disable plugin loading.

+

-plugin-path directory

+

Specify the directory where rofi should look for plugins.

+

-show-icons

+

Show application icons in drun and window modes.

+

-icon-theme

+

Specify icon theme to be used. +If not specified default theme from DE is used, Adwaita and gnome themes act as +fallback themes.

+

-fallback-application-icon

+

Specify an icon to be used when the application icon in run/drun are not yet loaded or is not available.

+

-markup

+

Use Pango markup to format output wherever possible.

+

-normal-window

+

Make rofi react like a normal application window. Useful for scripts like Clerk that are basically an application.

+

-[no-]steal-focus

+

Make rofi steal focus on launch and restore close to window that held it when launched.

+

Matching

+

-matching method

+

Specify the matching algorithm used. +Currently, the following methods are supported:

+
    +
  • normal: match the int string
  • +
  • regex: match a regex input
  • +
  • glob: match a glob pattern
  • +
  • fuzzy: do a fuzzy match
  • +
  • prefix: match prefix
  • +
+

Default: normal

+

Note: glob matching might be slow for larger lists

+

-tokenize

+

Tokenize the input.

+

-drun-categories category1,category2

+

Only show desktop files that are present in the listed categories.

+

-drun-match-fields field1,field2,...

+

When using drun, match only with the specified Desktop entry fields. +The different fields are:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
  • +

    all: all the above

    +

    Default: name,generic,exec,categories,keywords

    +
  • +
+

-drun-display-format

+

The format string for the drun dialog:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
+

Pango markup can be used to formatting the output.

+
Default: {name} [<span weight='light' size='small'><i>({generic})</i></span>]
+
+

Note: Only fields enabled in -drun-match-fields can be used in the format string.

+

-[no-]drun-show-actions

+

Show actions present in the Desktop files.

+
Default: false
+
+

-window-match-fields field1,field2,...

+

When using window mode, match only with the specified fields. +The different fields are:

+
    +
  • title: window's title
  • +
  • class: window's class
  • +
  • role: window's role
  • +
  • name: window's name
  • +
  • desktop: window's current desktop
  • +
  • +

    all: all the above

    +

    Default: all

    +
  • +
+

-matching-negate-char char

+

Set the character used to negate the query (i.e. if it does not match the next keyword). +Set to '\x0' to disable.

+
Default: '-'
+
+

Layout and Theming

+

IMPORTANT: + In newer rofi releases, all the theming options have been moved into the new theme format. They are no longer normal + rofi options that can be passed directly on the command line (there are too many). + Small snippets can be passed on the command line: rofi -theme-str 'window {width: 50%;}' to override a single + setting. They are merged into the current theme. + They can also be appended at the end of the rofi config file to override parts of the theme.

+

Most of the following options are deprecated and should not be used. Please use the new theme format to customize +rofi. More information about the new format can be found in the rofi-theme(5) manpage.

+

-location

+

Specify where the window should be located. The numbers map to the following locations on screen:

+
  1 2 3
+  8 0 4
+  7 6 5
+
+

Default: 0

+

-fixed-num-lines

+

Keep a fixed number of visible lines (See the -lines option.)

+

-sidebar-mode

+

Open in sidebar-mode. In this mode, a list of all enabled modes is shown at the bottom. +(See -modi option) +To show sidebar, use:

+
rofi -show run -sidebar-mode -lines 0
+
+

-hover-select

+

Automatically select the entry the mouse is hovering over. This option is best combined with custom mouse bindings. +To utilize hover-select and accept an entry in a single click, use:

+
rofi -show run -hover-select -me-select-entry '' -me-accept-entry MousePrimary
+
+

-eh number

+

Set row height (in chars) +Default: 1

+

-auto-select

+

When one entry is left, automatically select it.

+

-m num

+

-m name

+

-monitor num

+

-monitor name

+

Select monitor to display rofi on. +It accepts as input: primary (if primary output is set), the xrandr output name, or integer number (in order of +detection). Negative numbers are handled differently:

+
    +
  • -1: the currently focused monitor.
  • +
  • -2: the currently focused window (that is, rofi will be displayed on top of the focused window).
  • +
  • -3: Position of mouse (overrides the location setting to get normal context menu + behavior.)
  • +
  • -4: the monitor with the focused window.
  • +
  • +

    -5: the monitor that shows the mouse pointer.

    +

    Default: -5

    +
  • +
+

See rofi -h output for the detected monitors, their position, and size.

+

-theme filename

+

Path to the new theme file format. This overrides the old theme settings.

+

-theme-str string

+

Allow theme parts to be specified on the command line as an override.

+

For example:

+
rofi -theme-str '#window { fullscreen: true; }'
+
+

This option can be specified multiple times. +This is now the method to tweak the theme via the command line.

+

-dpi number

+

Override the default DPI setting.

+
    +
  • If set to 0, it tries to auto-detect based on X11 screen size (similar to i3 and GTK).
  • +
  • If set to 1, it tries to auto-detect based on the size of the monitor that rofi is displayed on (similar to latest Qt 5).
  • +
+

-selected-row selected row

+

Select a certain row.

+

Default: 0

+

PATTERN setting

+

-terminal

+

Specify which terminal to start.

+
rofi -terminal xterm
+
+

Pattern: {terminal}

+

Default: x-terminal-emulator

+

-ssh-client client

+

Override the used ssh client.

+

Pattern: {ssh-client}

+

Default: ssh

+

SSH settings

+

-ssh-command cmd

+

Set the command to execute when starting an ssh session. +The pattern {host} is replaced by the selected ssh entry.

+

Pattern: {ssh-client}

+

Default: {terminal} -e {ssh-client} {host}

+

-parse-hosts

+

Parse the /etc/hosts file for entries.

+

Default: disabled

+

-parse-known-hosts +-no-parse-known-hosts

+

Parse the ~/.ssh/known_hosts file for entries.

+

Default: enabled

+

Run settings

+

-run-command cmd

+

Set command ({cmd}) to execute when running an application. +See PATTERN.

+

Default: {cmd}

+

-run-shell-command cmd

+

Set command to execute when running an application in a shell. +See PATTERN.

+

Default: {terminal} -e {cmd}

+

-run-list-command cmd

+

If set, use an external tool to generate a list of executable commands. Uses run-command.

+

Default: {cmd}

+

Window switcher settings

+

-window-format format

+

Format what is being displayed for windows.

+

format: {field[:len]}

+

field:

+
    +
  • w: desktop name
  • +
  • t: title of window
  • +
  • n: name
  • +
  • r: role
  • +
  • c: class
  • +
+

len: maximum field length (0 for auto-size). If length and window width are negative, field length is width - len.
+If length is positive, the entry will be truncated or padded to fill that length.

+

default: {w} {c} {t}

+

-window-command cmd

+

Set command to execute on selected window for an alt action (-kb-accept-alt). +See PATTERN.

+

Default: "wmctrl -i -R {window}"

+

-window-thumbnail

+

Show window thumbnail (if available) as icon in the window switcher.

+

You can stop rofi from exiting when closing a window (allowing multiple to be closed in a row).

+
configuration {
+  window {
+      close-on-delete: false;
+  }
+}
+
+

Combi settings

+

-combi-modi mode1,mode2

+

The modi to combine in combi mode. +For syntax to -combi-modi, see -modi. +To get one merge view, of window,run, and ssh:

+
rofi -show combi -combi-modi "window,run,ssh" -modi combi
+
+

NOTE: The i3 window manager dislikes commas in the command when specifying an exec command. +For that case, # can be used as a separator.

+

History and Sorting

+

-disable-history +-no-disable-history (re-enable history)

+

Disable history

+

-sort to enable +-no-sort to disable

+

Enable, disable sorting. +This setting can be changed at runtime (see -kb-toggle-sort).

+

-sorting-method 'method' to specify the sorting method.

+

There are 2 sorting methods:

+
    +
  • levenshtein (Default)
  • +
  • fzf sorting.
  • +
+

-max-history-size number

+

Maximum number of entries to store in history. Defaults to 25. (WARNING: can cause slowdowns when set too high)

+

Dmenu specific

+

-sep separator

+

Separator for dmenu. Example: To show a list of 'a' to 'e' with '|' as a separator:

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
+
+

-p prompt

+

Specify the prompt to show in dmenu mode. For example, select 'monkey', a,b,c,d, or e.

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey"
+
+

Default: dmenu

+

-l number of lines to show

+

Maximum number of lines the menu may show before scrolling.

+
rofi -lines 25
+
+

Default: 15

+

-i

+

Makes dmenu searches case-insensitive

+

-a X

+

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:

+
    +
  • 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'
  • +
+

-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

+

Allows the output of dmenu to be customized (N is the total number of input entries):

+
    +
  • '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)
  • +
+

Default: 's'

+

-select string

+

Select first line that matches the given string

+

-mesg string

+

Add a message line below the filter entry box. Supports Pango markup. +For more information on supported markup, see here

+

-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. +See here for details about Pango markup.

+

-multi-select

+

Allow multiple lines to be selected. Adds a small selection indicator to the left of each entry.

+

-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-match or -auto-select.

+

-async-pre-read number

+

Reads the first number entries blocking, then switches to async mode. +This makes it feel more 'snappy'.

+

default: 25

+

-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.

+

Message dialog

+

-e message

+

Pops up a message dialog (used internally for showing errors) with message. +Message can be multi-line.

+

File browser settings

+

File browser behavior can be controlled via the following options:

+
configuration {
+   filebrowser {
+      /** Directory the file browser starts in. */
+      directory: "/some/directory";
+      /**
+        * Sorting method. Can be set to:
+        *   - "name"
+        *   - "mtime" (modification time)
+        *   - "atime" (access time)
+        *   - "ctime" (change time)
+        */
+      sorting-method: "name";
+      /** Group directories before files. */
+      directories-first: true;
+   }
+}
+
+

Other

+

-drun-use-desktop-cache

+

Build and use a cache with the content of desktop files. Usable for systems with slow hard drives.

+

-drun-reload-desktop-cache

+

If drun-use-desktop-cache is enabled, rebuild a cache with the content of desktop files.

+

-drun-url-launcher command

+

Command to open a Desktop Entry that is a Link.

+

-pid path

+

Make rofi create a pid file and check this on startup. The pid file prevents multiple rofi instances from running simultaneously. This is useful when running rofi from a key-binding daemon.

+

-display-{mode} string

+

Set the name to use for mode. This is used as prompt and in combi-browser.

+

It is now preferred to use the configuration file:

+
configuration {
+  {mode} {
+    display-name: *string*;
+  }
+}
+
+

-click-to-exit +-no-click-to-exit

+

Click the mouse outside the rofi window to exit.

+

Default: enabled

+

PATTERN

+

To launch commands (for example, when using the ssh launcher), the user can enter the used command-line. The following keys can be used that will be replaced at runtime:

+
    +
  • {host}: the host to connect to
  • +
  • {terminal}: the configured terminal (see -terminal-emulator)
  • +
  • {ssh-client}: the configured ssh client (see -ssh-client)
  • +
  • {cmd}: the command to execute
  • +
  • {window}: the window ID of the selected window (in window-command)
  • +
+

DMENU REPLACEMENT

+

If argv[0] (calling command) is dmenu, rofi will start in dmenu mode. +This way, it can be used as a drop-in replacement for dmenu. Just copy or symlink rofi to dmenu in $PATH.

+
ln -s /usr/bin/rofi /usr/bin/dmenu
+
+

THEMING

+

Please see rofi-theme(5) manpage for more information on theming.

+

KEY BINDINGS

+

rofi has the following key bindings:

+
    +
  • Control-v, Insert: Paste from clipboard
  • +
  • Control-Shift-v, Shift-Insert: Paste primary selection
  • +
  • Control-u: Clear the line
  • +
  • Control-a: Beginning of line
  • +
  • Control-e: End of line
  • +
  • Control-f, Right: Forward one character
  • +
  • Alt-f, Control-Right: Forward one word
  • +
  • Control-b, Left: Back one character
  • +
  • Alt-b, Control-Left: Back one word
  • +
  • Control-d, Delete: Delete character
  • +
  • Control-Alt-d: Delete word
  • +
  • Control-h, Backspace, Shift-Backspace: Backspace (delete previous character)
  • +
  • Control-Alt-h: Delete previous word
  • +
  • Control-j,Control-m,Enter: Accept entry
  • +
  • Control-n,Down: Select next entry
  • +
  • Control-p,Up: Select previous entry
  • +
  • Page Up: Go to previous page
  • +
  • Page Down: Go to next page
  • +
  • Control-Page Up: Go to previous column
  • +
  • Control-Page Down: Go to next column
  • +
  • Control-Enter: Use entered text as a command (in ssh/run modi)
  • +
  • Shift-Enter: Launch the application in a terminal (in run mode)
  • +
  • Control-Shift-Enter: As Control-Enter and run the command in terminal (in run mode)
  • +
  • Shift-Enter: Return the selected entry and move to the next item while keeping rofi open. (in dmenu)
  • +
  • Shift-Right: Switch to the next mode. The list can be customized with the -modi argument.
  • +
  • Shift-Left: Switch to the previous mode. The list can be customized with the -modi argument.
  • +
  • Control-Tab: Switch to the next mode. The list can be customized with the -modi argument.
  • +
  • Control-Shift-Tab: Switch to the previous mode. The list can be customized with the -modi argument.
  • +
  • Control-space: Set selected item as input text.
  • +
  • Shift-Del: Delete entry from history.
  • +
  • grave: Toggle case sensitivity.
  • +
  • Alt-grave: Toggle sorting.
  • +
  • Alt-Shift-S: Take a screenshot and store it in the Pictures directory.
  • +
  • Control-l: File complete for run dialog.
  • +
+

This list might not be complete, to get a full list of all key bindings +supported in your rofi, see rofi -h. The options starting with -kb are keybindings.

+

Key bindings can be modified using the configuration systems. Multiple keys can be bound +to one action by comma separating them. For example -kb-primary-paste "Conctrol+v,Insert"

+

To get a searchable list of key bindings, run rofi -show keys.

+

A key binding starting with ! will act when all keys have been released.

+

Available Modi

+

window

+

Show a list of all the windows and allow switching between them. +Pressing the delete-entry binding (shift-delete) will close the window. +Pressing the accept-custom binding (control-enter or shift-enter) will run a command on the window. +(See option window-command );

+

If there is no match, it will try to launch the input.

+

windowcd

+

Shows a list of the windows on the current desktop and allows switching between them. +Pressing the delete-entry binding (shift-delete) will kill the window. +Pressing the accept-custom binding (control-enter or shift-enter) will run a command on the window. +(See option window-command );

+

If there is no match, it will try to launch the input.

+

run

+

Shows a list of executables in $PATH and can launch them (optional in a terminal). +Pressing the delete-entry binding (shift-delete) will remove this entry from the run history. +Pressing the accept-custom binding (control-enter) will run the command as entered in the entry box. +Pressing the accept-alt binding (shift-enter) will run the command in a terminal.

+

When pressing the mode-complete binding (Control-l), you can use the File Browser mode to launch the application +with a file as the first argument.

+

drun

+

Same as the run launches, but the list is created from the installed desktop files. It automatically launches them +in a terminal if specified in the Desktop File. +Pressing the delete-entry binding (shift-delete) will remove this entry from the run history. +Pressing the accept-custom binding (control-enter) will run the command as entered in the entry box. +Pressing the accept-alt binding (shift-enter) will run the command in a terminal.

+

When pressing the mode-complete binding (Control-l), you can use the File Browser mode to launch the application +passing a file as argument if specified in the desktop file.

+

The DRUN mode tries to follow the XDG Desktop Entry +Specification and should be compatible with +applications using this standard. Some applications create invalid desktop files, rofi will discard these entries. +See the debugging section for more info on DRUN mode, this will print why desktop files are +discarded.

+

There are two advanced options to tweak the behaviour:

+
configuration {
+   drun {
+      /** Parse user desktop files. */
+      parse-user:   true;
+      /** Parse system desktop files. */
+      parse-system: false;
+   }
+}
+
+

ssh

+

Shows a list of SSH targets based on your ssh config file, and allows to quickly ssh into them.

+

keys

+

Shows a searchable list of key bindings.

+

script

+

Allows custom scripted Modi to be added, see the rofi-script(5) manpage for more information.

+

combi

+

Combines multiple modi in one list. Specify which modi are included with the -combi-modi option.

+

When using the combi mode, a !bang can be used to filter the results by modi. +All modi that match the bang as a prefix are included. +For example, say you have specified -combi-modi run,window,windowcd. If your +query begins with the bang !w, only results from the window and windowcd +modi are shown, even if the rest of the input text would match results from run.

+

If no match, the input is handled by the first combined modi.

+

FAQ

+

The text in the window switcher is not nicely aligned.

+

Try using a mono-space font.

+

The window is completely black.

+

Check quotes used on the command-line: you might have used ("smart quotes") instead of " ("machine quotes").

+

What does the icon in the top right show?

+

The indicator shows:

+
` ` Case insensitive and no sorting.
+`-` Case sensitivity enabled, no sorting.
+`+` Case insensitive and Sorting enabled
+`±` Sorting and Case sensitivity enabled"
+
+

EXAMPLES

+

Some basic usage examples of rofi:

+

Show the run dialog:

+
rofi -modi run -show run
+
+

Show the run dialog, and allow switching to Desktop File run dialog (drun):

+
rofi -modi run,drun -show run
+
+

Combine the run and Desktop File run dialog (drun):

+
rofi -modi combi -show combi -combi-modi run,drun
+
+

Combine the run and Desktop File run dialog (drun), and allow switching to window switcher:

+
rofi -modi combi,window -show combi -combi-modi run,drun
+
+

Pop up a text message claiming that this is the end:

+
rofi -e "This is the end"
+
+

Pop up a text message in red, bold font claiming that this is still the end:

+
rofi -e "<span color='red'><b>This is still the end</b></span>" -markup
+
+

Show all key bindings:

+
rofi -show keys
+
+

Use qalc to get a simple calculator in rofi:

+
 rofi -show calc -modi "calc:qalc +u8 -nocurrencies"
+
+

i3

+

In i3 you want to bind rofi to be launched on key release. Otherwise, it cannot grab the keyboard. +See also the i3 manual:

+

Some tools (such as import or xdotool) might be unable to run upon a KeyPress event, because the keyboard/pointer is +still grabbed. For these situations, the --release flag can be used, as it will execute the command after the keys have +been released.

+

LICENSE

+
MIT/X11
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+

WEBSITE

+

rofi website can be found here

+

SUPPORT

+

rofi support can be obtained: + * GitHub Discussions + * Forum (Reddit) + * IRC (#rofi on irc.libera.chat),

+

DEBUGGING

+

To debug, it is smart to first try disabling your custom configuration: +-no-config

+

Disable parsing of configuration. This runs rofi in stock mode.

+

If you run custom C plugins, you can disable them using:

+

-no-plugins

+

Disables the loading of plugins.

+

To further debug the plugin, you can get a trace with (lots of) debug information. This debug output can be enabled for +multiple parts in rofi using the glib debug framework. Debug domains can be enabled by setting the G_MESSAGES_DEBUG +environment variable. At the time of creation of this page, the following debug domains exist:

+
    +
  • all: Show debug information from all domains.
  • +
  • X11Helper: The X11 Helper functions.
  • +
  • View: The main window view functions.
  • +
  • Widgets.Box: The Box widget.
  • +
  • Dialogs.DMenu: The dmenu mode.
  • +
  • Dialogs.Run: The run mode.
  • +
  • Dialogs.DRun: The desktop file run mode.
  • +
  • Dialogs.Window: The window mode.
  • +
  • Dialogs.Script: The script mode.
  • +
  • Dialogs.Combi: The script mode.
  • +
  • Dialogs.Ssh: The ssh mode.
  • +
  • Rofi: The main application.
  • +
  • Timings: Get timing output.
  • +
  • Theme: Theme engine debug output. (warning lots of output).
  • +
  • Widgets.Icon: The Icon widget.
  • +
  • Widgets.Box: The box widget.
  • +
  • Widgets.Container: The container widget.
  • +
  • Widgets.Window: The window widget.
  • +
  • Helpers.IconFetcher: Information about icon lookup.
  • +
+

The output of this can provide useful information when writing an issue.

+

More information (possibly outdated) see this wiki entry.

+

ISSUE TRACKER

+

The rofi issue tracker can be found here

+

When creating an issue, please read this +first.

+

SEE ALSO

+

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

+

AUTHOR

+ +

Original code based on work by: Sean Pringle sean.pringle@gmail.com

+

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

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.1/rofi-script.5/index.html b/1.7.1/rofi-script.5/index.html new file mode 100644 index 00000000..26149e33 --- /dev/null +++ b/1.7.1/rofi-script.5/index.html @@ -0,0 +1,1487 @@ + + + + + + + + + + + + + + + + + + + + + + Script - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-SCRIPT 5 rofi-script

+

NAME

+

rofi script mode - Rofi format for scriptable modi.

+

DESCRIPTION

+

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

+

USAGE

+

To specify a script mode, set a mode with the following syntax: "{name}:{executable}"

+

For example:

+
rofi -show fb -modi "fb:file_browser.sh"
+
+

The name should be unique.

+

API

+

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" ]
+then
+    exit 0
+fi
+echo "reload"
+echo "quit"
+
+
+

This shows two entries, reload and quit. When the quit entry is selected, rofi closes.

+

Environment

+

Rofi sets the following environment variable when executing the script:

+

ROFI_RETV

+

An integer number with the current state:

+
    +
  • 0: Initial call of script.
  • +
  • 1: Selected an entry.
  • +
  • 2: Selected a custom entry.
  • +
  • 10-28: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
  • +
+

ROFI_INFO

+

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. +Extra 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:

+
    +
  • prompt: Update the prompt text.
  • +
  • message: Update the message text.
  • +
  • markup-rows: If 'true' renders markup in the row.
  • +
  • urgent: Mark rows as urgent. (for syntax see the urgent option in dmenu mode)
  • +
  • active: Mark rows as active. (for syntax see the active option in dmenu mode)
  • +
  • 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.
  • +
  • no-custom: If set to 'true'; only accept listed entries, ignore custom input.
  • +
  • use-hot-keys: If set to true, it enabled the Custom keybindings for script. Warning this breaks the normal rofi flow.
  • +
+

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 entry.

+

For example:

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

The following options are supported:

+
    +
  • icon: Set the icon for that row.
  • +
  • meta: Specify invisible search terms.
  • +
  • nonselectable: If true the row cannot activated.
  • +
  • info: Info that, on selection, gets placed in the ROFI_INFO environment variable. This entry does not get searched.
  • +
+

multiple entries can be passed using the \x1f separator.

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

Executing external program

+

If you want to launch an external program from the script, you need to make sure it is launched in the background. +If not rofi will wait for its output (to display).

+

In bash the best way to do this is using coproc.

+
 coproc ( myApp  > /dev/null  2>&1 )
+
+

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 github.

+

SEE ALSO

+

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

+

AUTHOR

+

Qball Cow qball@gmpclient.org

+

Rasmus Steinke rasi@xssn.at

+

Quentin 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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.1/rofi-theme.5/index.html b/1.7.1/rofi-theme.5/index.html new file mode 100644 index 00000000..b09d4208 --- /dev/null +++ b/1.7.1/rofi-theme.5/index.html @@ -0,0 +1,3088 @@ + + + + + + + + + + + + + + + + + + + + + + Themes - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-THEME 5 rofi-theme

+

NAME

+

rofi-theme - Rofi theme format files

+

DEFAULT THEME LOADING

+

By default, rofi loads the default theme. This theme is always loaded. +In the default (always loaded) configuration it does:

+
@theme "default"
+
+

To unload the default theme, and load another theme, add @theme to your +config.rasi file.

+

If you have a theme loaded by @theme or use the default theme, you can tweak +it by adding overriding elements at the end of your config.rasi file.

+

For the difference between @import and @theme see the Multiple file +handling section in this manpage.

+

To see the default theme, run the following command:

+
rofi -no-config -dump-theme
+
+

DESCRIPTION

+

The need for a new theme format was motivated by the fact that the way rofi handled widgets has changed. From a very +static drawing of lines and text to a nice structured form of packing widgets. This change made it possible to provide a +more flexible theme framework. The old theme format and config file are not flexible enough to expose these options in a +user-friendly way. Therefore, a new file format has been created, replacing the old one.

+

FORMAT SPECIFICATION

+

Encoding

+

The encoding of the file is utf-8. Both unix (\n) and windows (\r\n) newlines format are supported. But unix is +preferred.

+

Comments

+

C and C++ file comments are supported.

+
    +
  • Anything after // and before a newline is considered a comment.
  • +
  • Everything between /* and */ is a comment.
  • +
+

Comments can be nested and the C comments can be inline.

+

The following is valid:

+
// Magic comment.
+property: /* comment */ value;
+
+

However, this is not:

+
prop/*comment*/erty: value;
+
+

White space

+

White space and newlines, like comments, are ignored by the parser.

+

This:

+
property: name;
+
+

Is identical to:

+
     property             :
+name
+
+;
+
+

File extension

+

The preferred file extension for the new theme format is rasi. This is an +abbreviation for rofi advanced style information.

+

Basic Structure

+

Each element has a section with defined properties. Global properties can be defined in section * { }. +Sub-section names begin with a hash symbol #.

+

It is advised to define the global properties section on top of the file to +make inheritance of properties clearer.

+
/* Global properties section */
+* {
+    // list of properties
+}
+
+/* Element theme section. */
+{element path} {
+    // list of properties
+}
+{elements... } {
+    // list of properties
+}
+
+

If there are multiple sections with the same name, they are merged. Duplicate properties are overwritten and the last +parsed entry kept.

+

Global properties section

+

A theme can have one or more global properties sections. If there is more than one, +they will be merged.

+

The global properties section denotes the defaults for each element. +Each property of this section can be referenced with @{identifier} +(See Properties section)

+

A global properties section is indicated with a * as element path.

+

Element theme section

+

A theme can have multiple element theme sections.

+

The element path can consist of multiple names separated by whitespace or dots. +Each element may contain any number of letters, numbers and -'s. +The first element in the element path should always start with a #. +Multiple elements can be specified by a ,.

+

This is a valid element name:

+
element normal.normal {
+    background-color: blue;
+}
+button {
+    background-color: blue;
+}
+
+

And is identical to:

+
element normal normal, button {
+    background-color: blue;
+}
+
+

Each section inherits the global properties. Properties can be explicitly inherited from their parent with the +inherit keyword. +In the following example:

+
window {
+ a: 1;
+ b: 2;
+ children: [ mainbox ];
+}
+mainbox {
+    a: inherit;
+    b: 4;
+    c: 8;
+}
+
+

The element mainbox will have the following set of properties (if mainbox is a child of window):

+
a: 1;
+b: 4;
+c: 8;
+
+

If multiple sections are defined with the same name, they are merged by the +parser. If multiple properties with the same name are defined in one section, +the last encountered property is used.

+

Properties Format

+

The properties in a section consist of:

+
{identifier}: {value};
+
+

Both fields are mandatory for a property.

+

The identifier names the specified property. Identifiers can consist of any +combination of numbers, letters and '-'. It must not contain any whitespace. +The structure of the value defines the type of the property. The current +parser does not define or enforce a certain type of a particular identifier. +When used, values with the wrong type that cannot be converted are ignored.

+

The current theme format supports different types:

+
    +
  • a string
  • +
  • an integer number
  • +
  • a fractional number
  • +
  • a boolean value
  • +
  • a color
  • +
  • image
  • +
  • text style
  • +
  • line style
  • +
  • a distance
  • +
  • a padding
  • +
  • a border
  • +
  • a position
  • +
  • a reference
  • +
  • an orientation
  • +
  • a cursor
  • +
  • a list of keywords
  • +
  • an environment variable
  • +
  • Inherit
  • +
+

Some of these types are a combination of other types.

+

String

+
    +
  • Format: "[:print:]+"
  • +
+

A string is always surrounded by double quotes ("). Between the quotes there can be any printable character.

+

For example:

+
font: "Awasome 12";
+
+

The string must be valid UTF-8.

+

Integer

+
    +
  • Format: [-+]?[:digit:]+
  • +
+

An integer may contain any number.

+

For examples:

+
lines: 12;
+
+

Real

+
    +
  • Format: [-+]?[:digit:]+(\.[:digit:]+)?
  • +
+

A real is an integer with an optional fraction.

+

For example:

+
real: 3.4;
+
+

The following is not valid: .3, 3. or scientific notation: 3.4e-3.

+

Boolean

+
    +
  • Format: (true|false)
  • +
+

Boolean value is either true or false. This is case-sensitive.

+

For example:

+
dynamic: false;
+
+

Image

+

rofi support a limited set of background-image formats.

+
    +
  • Format: url("path to image");
  • +
  • Format: url("path to image", scale); + where scale is: none, both, width, height
  • +
  • Format: linear-gradient(stop color,stop1, color, stop2 color, ...);
  • +
  • Format: linear-gradient(to direction, stop color,stop1, color, stop2 color, ...); + where direction is: top,left,right,bottom.
  • +
  • Format: linear-gradient(angle, stop color,stop1, color, stop2 color, ...); + Angle in deg,rad,grad (as used in color).
  • +
+

Where the path is a string, and stop color is of type color.

+

Color

+

rofi supports the color formats as specified in the CSS standard (1,2,3 and some of CSS 4)

+
    +
  • Format: #{HEX}{3} (rgb)
  • +
  • Format: #{HEX}{4} (rgba)
  • +
  • Format: #{HEX}{6} (rrggbb)
  • +
  • Format: #{HEX}{8} (rrggbbaa)
  • +
  • Format: rgb[a]({INTEGER},{INTEGER},{INTEGER}[, {PERCENTAGE}])
  • +
  • Format: rgb[a]({INTEGER}%,{INTEGER}%,{INTEGER}%[, {PERCENTAGE}])
  • +
  • Format: hsl[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])
  • +
  • Format: hwb[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])
  • +
  • Format: cmyk( {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE} ])
  • +
  • Format: {named-color} [ / {PERCENTAGE} ]
  • +
+

The white-space format proposed in CSS4 is also supported.

+

The different values are:

+
    +
  • {HEX} is a hexadecimal number ('0-9a-f' case insensitive).
  • +
  • {INTEGER} value can be between 0 and 255 or 0-100 when representing percentage.
  • +
  • {ANGLE} is the angle on the color wheel, can be in deg, rad, grad or turn. When no unit is specified, degrees is assumed.
  • +
  • {PERCENTAGE} can be between 0-1.0, or 0%-100%
  • +
  • +

    {named-color} is one of the following colors:

    +

    AliceBlue, AntiqueWhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet, Brown, +BurlyWood, CadetBlue, Chartreuse, Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, DarkCyan, +DarkGoldenRod, DarkGray, DarkGrey, DarkGreen, DarkKhaki, DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, +DarkSalmon, DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkSlateGrey, DarkTurquoise, DarkViolet, DeepPink, DeepSkyBlue, +DimGray, DimGrey, DodgerBlue, FireBrick, FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, GoldenRod, +Gray, Grey, Green, GreenYellow, HoneyDew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, +LemonChiffon, LightBlue, LightCoral, LightCyan, LightGoldenRodYellow, LightGray, LightGrey, LightGreen, LightPink, +LightSalmon, LightSeaGreen, LightSkyBlue, LightSlateGray, LightSlateGrey, LightSteelBlue, LightYellow, Lime, LimeGreen, +Linen, Magenta, Maroon, MediumAquaMarine, MediumBlue, MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, +MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, MintCream, MistyRose, Moccasin, NavajoWhite, Navy, +OldLace, Olive, OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenRod, PaleGreen, PaleTurquoise, PaleVioletRed, +PapayaWhip, PeachPuff, Peru, Pink, Plum, PowderBlue, Purple, RebeccaPurple, Red, RosyBrown, RoyalBlue, SaddleBrown, +Salmon, SandyBrown, SeaGreen, SeaShell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray, SlateGrey, Snow, SpringGreen, +SteelBlue, Tan, Teal, Thistle, Tomato, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, YellowGreen,transparent

    +
  • +
+

For example:

+
background-color: #FF0000;
+border-color: rgba(0,0,1, 0.5);
+text-color: SeaGreen;
+
+

or

+
background-color: transparent;
+text-color: Black;
+
+

Text style

+
    +
  • Format: (bold|italic|underline|strikethrough|none)
  • +
+

Text style indicates how the highlighted text is emphasized. None indicates that no emphasis +should be applied.

+
    +
  • bold: make the text thicker then the surrounding text.
  • +
  • italic: put the highlighted text in script type (slanted).
  • +
  • underline: put a line under the highlighted text.
  • +
  • strikethrough: put a line through the highlighted text.
  • +
+

Line style

+
    +
  • Format: (dash|solid)
  • +
+

Indicates how a line should be drawn. +It currently supports: + * dash: a dashed line, where the gap is the same width as the dash + * solid: a solid line

+

Distance

+
    +
  • Format: {Integer}px
  • +
  • Format: {Real}em
  • +
  • Format: {Real}ch
  • +
  • Format: {Real}%
  • +
  • Format: {Integer}mm
  • +
+

A distance can be specified in 3 different units:

+
    +
  • px: Screen pixels.
  • +
  • em: Relative to text height.
  • +
  • ch: Relative to width of a single number.
  • +
  • mm: Actual size in millimeters (based on dpi).
  • +
  • %: Percentage of the monitor size.
  • +
+

Distances used in the horizontal direction use the monitor width. Distances in +the vertical direction use the monitor height. +For example:

+
   padding: 10%;
+
+

On a full-HD (1920x1080) monitor, it defines a padding of 192 pixels on the left +and right side and 108 pixels on the top and bottom.

+

Calculating sizes

+

Rofi supports some maths in calculating sizes. For this it uses the CSS syntax:

+
width: calc( 100% - 37px );
+
+

It supports the following operations:

+
    +
  • + : Add
  • +
  • - : Subtract
  • +
  • / : Divide
  • +
  • * : Multiply
  • +
  • % : Multiply
  • +
  • min : Minimum of l or rvalue;
  • +
  • max : Maximum of l or rvalue;
  • +
+

It uses the C precedence ordering.

+

Padding

+
    +
  • Format: {Integer}
  • +
  • Format: {Distance}
  • +
  • Format: {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance} {Distance}
  • +
+

If no unit is specified, pixels are assumed.

+

The different number of fields in the formats are parsed like:

+
    +
  • 1 field: all
  • +
  • 2 fields: top&bottom left&right
  • +
  • 3 fields: top, left&right, bottom
  • +
  • 4 fields: top, right, bottom, left
  • +
+

Border

+
    +
  • Format: {Integer}
  • +
  • Format: {Distance}
  • +
  • Format: {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style} {Distance} {Line style}
  • +
+

Borders are identical to padding, except that each distance field has a line +style property.

+
+

When no unit is specified, pixels are assumed.

+
+

Position

+

Indicate a place on the window/monitor.

+
    +
  • Format: (center|east|north|west|south|north east|north west|south west|south east)
  • +
+

+north west   |    north    |  north east
+-------------|-------------|------------
+      west   |   center    |  east
+-------------|-------------|------------
+south west   |    south    |  south east
+
+

Visibility

+

It is possible to hide widgets:

+

inputbar { + enabled: false; +}

+

Reference

+
    +
  • Format: @{PROPERTY NAME}
  • +
+

A reference can point to another reference. Currently, the maximum number of redirects is 20. +A property always refers to another property. It cannot be used for a subpart of the property. +For example, this is not valid:

+
highlight: bold @pink;
+
+

But this is:

+
* {
+    myhigh: bold #FAA;
+}
+
+window {
+    highlight: @myhigh;
+}
+
+
    +
  • Format: var(PROPERTY NAME, DEFAULT)
  • +
+

A reference can point to another reference. Currently, the maximum number of redirects is 20. +A property always refers to another property. It cannot be used for a subpart of the property.

+

Example:

+
window {
+    width: var( width, 30%);
+}
+
+

If the property width is set globally (*{}) that value is used, if the property +width is not set, the default value is used.

+

Orientation

+
    +
  • Format: (horizontal|vertical)
  • +
+

Specify the orientation of the widget.

+

Cursor

+
    +
  • Format: (default|pointer|text)
  • +
+

Specify the type of mouse cursor that is set when the mouse pointer is over the widget.

+

List of keywords

+
    +
  • Format: [ keyword, keyword ]
  • +
+

A list starts with a '[' and ends with a ']'. The entries in the list are comma-separated. +The keyword in the list refers to an widget name.

+

Environment variable

+
    +
  • Format: ${:alnum:}
  • +
+

This will parse the environment variable as the property value. (that then can be any of the above types). +The environment variable should be an alphanumeric string without white-space.

+
* {
+    background-color: ${BG};
+}
+
+
    +
  • Format: env(ENVIRONMENT, default)
  • +
+

This will parse the environment variable as the property value. (that then can be any of the above types). +The environment variable should be an alphanumeric string without white-space. +If the environment value is not found, the default value is used.

+
window {
+    width: env(WIDTH, 40%);
+}
+
+

If environment WIDTH is set, then that value is parsed, otherwise the default value (40%).

+

Inherit

+
    +
  • Format: inherit
  • +
+

Inherits the property from its parent widget.

+
mainbox {
+    border-color: inherit;
+}
+
+

ELEMENTS PATHS

+

Element paths exists of two parts, the first part refers to the actual widget by name. +Some widgets have an extra state.

+

For example:

+
element selected {
+}
+
+

Here element selected is the name of the widget, selected is the state of the widget.

+

The difference between dots and spaces is purely cosmetic. These are all the same:

+
element .selected {
+
+element.selected {
+}
+element selected {
+}
+
+

SUPPORTED ELEMENT PATH

+

Name

+

The current widgets available in rofi:

+
    +
  • window
  • +
  • overlay: the overlay widget.
  • +
  • mainbox: The mainbox box.
      +
    • inputbar: The input bar box.
    • +
    • box: the horizontal @box packing the widgets
    • +
    • case-indicator: the case/sort indicator @textbox
    • +
    • prompt: the prompt @textbox
    • +
    • entry: the main entry @textbox
    • +
    • num-rows: Shows the total number of rows.
    • +
    • num-filtered-rows: Shows the total number of rows after filtering.
    • +
    • listview: The listview.
    • +
    • scrollbar: the listview scrollbar
    • +
    • element: a box in the listview holding the entries
        +
      • element-icon: the widget in the listview's entry showing the (optional) icon
      • +
      • element-index: the widget in the listview's entry keybindable index (1,2,3..0)
      • +
      • element-text: the widget in the listview's entry showing the text.
      • +
      +
    • +
    • mode-switcher: the main horizontal @box packing the buttons.
    • +
    • button: the buttons @textbox for each mode
    • +
    • message: The container holding the textbox.
    • +
    • textbox: the message textbox
    • +
    +
  • +
+

Note that these path names match the default theme. Themes that provide a custom layout will have different +elements, and structure.

+

State

+

State: State of widget

+

Optional flag(s) indicating state of the widget, used for theming.

+

These are appended after the name or class of the widget.

+

Example:

+

button selected.normal { }

+

element selected.urgent { }

+

Currently only the entrybox and scrollbar have states:

+

Entrybox:

+

{visible modifier}.{state}

+

Where visible modifier can be: + * normal: no modification + * selected: the entry is selected/highlighted by user + * alternate: the entry is at an alternating row (uneven row)

+

Where state is: + * normal: no modification + * urgent: this entry is marked urgent + * active: this entry is marked active

+

These can be mixed.

+

Example:

+
nametotextbox selected.active {
+    background-color: #003642;
+    text-color: #008ed4;
+}
+
+

Sets all selected textboxes marked active to the given text and background color. +Note that a state modifies the original element, it therefore contains all the properties of that element.

+

Scrollbar

+

The scrollbar uses the handle state when drawing the small scrollbar handle. +This allows the colors used for drawing the handle to be set independently.

+

SUPPORTED PROPERTIES

+

The following properties are currently supported:

+

all widgets:

+
    +
  • enabled: enable/disable the widget
  • +
  • padding: padding + Padding on the inside of the widget
  • +
  • margin: padding + Margin on the outside of the widget
  • +
  • border: border + Border around the widget (between padding and margin)/
  • +
  • border-radius: padding + Sets a radius on the corners of the borders.
  • +
  • background-color: color + Background color
  • +
  • background-image: image + Background image
  • +
  • border-color: color + Color of the border
  • +
  • cursor: cursor + Type of mouse cursor that is set when the mouse pointer is hovered over the widget.
  • +
+

window:

+
    +
  • +

    font: string + The font used in the window

    +
  • +
  • +

    transparency: string + Indicating if transparency should be used and what type: + real - True transparency. Only works with a compositor. + background - Take a screenshot of the background image and use that. + screenshot - Take a screenshot of the screen and use that. + Path to png file - Use an image.

    +
  • +
  • +

    location: position + The place of the anchor on the monitor

    +
  • +
  • anchor: anchor + The anchor position on the window
  • +
  • fullscreen: boolean + Window is fullscreen.
  • +
  • width: distance + The width of the window
  • +
  • x-offset: distance
  • +
  • y-offset: distance + The offset of the window to the anchor point, allowing you to push the window left/right/up/down
  • +
+

scrollbar:

+
    +
  • background-color: color
  • +
  • handle-width: distance
  • +
  • handle-color: color
  • +
  • border-color: color
  • +
+

box:

+
    +
  • orientation: orientation + Set the direction the elements are packed.
  • +
  • spacing: distance + Distance between the packed elements.
  • +
+

textbox:

+
    +
  • background-color: color
  • +
  • border-color: the color used for the border around the widget.
  • +
  • font: the font used by this textbox (string).
  • +
  • str: the string to display by this textbox (string).
  • +
  • vertical-align: Vertical alignment of the text. A number between 0 (top) and 1 (bottom).
  • +
  • horizontal-align: Horizontal alignment of the text. A number between 0 (left) and 1 (right).
  • +
  • text-color: the text color to use.
  • +
  • highlight: text style {color}. + color is optional, multiple highlight styles can be added like: bold underline italic #000000; + This option is only available on the element-text widget.
  • +
  • width: override the desired width for the textbox.
  • +
  • content: Set the displayed text (String).
  • +
  • placeholder: Set the displayed text (String) when nothing is entered.
  • +
  • placeholder-color: Color of the placeholder text.
  • +
  • blink: Enable/Disable blinking on an input textbox (Boolean).
  • +
  • markup: Force markup on, beware that only valid pango markup strings are shown.
  • +
+

listview:

+
    +
  • columns: integer + Number of columns to show (at least 1)
  • +
  • fixed-height: boolean + Always show lines rows, even if fewer elements are available.
  • +
  • dynamic: boolean + True if the size should change when filtering the list, False if it should keep the original height.
  • +
  • scrollbar: boolean + If the scrollbar should be enabled/disabled.
  • +
  • scrollbar-width: distance + Width of the scrollbar
  • +
  • cycle: boolean + When navigating, it should wrap around
  • +
  • spacing: distance + Spacing between the elements (both vertical and horizontal)
  • +
  • lines: integer + Number of rows to show in the list view.
  • +
  • layout: orientation + Indicate how elements are stacked. Horizontal implements the dmenu style.
  • +
  • reverse: boolean + Reverse the ordering (top down to bottom up).
  • +
  • fixed-columns: boolean + Do not reduce the number of columns shown when number of visible elements is not enough to fill them all.
  • +
+

Each element is a box called element. Each element can contain an element-icon and element-text.

+

listview text highlight:

+

The element-text widget in the listview is the one used to show the text. +On this widget set the highlight property (only place this property is used) to change +the style of highlighting. +The highlight property consist of the text-style property and a color.

+

To disable highlighting:

+
  element-text {
+    highlight: None;
+  }
+
+

To set to red underlined:

+
  element-text {
+    highlight: underline red;
+  }
+
+

Layout

+

The new format allows the layout of the rofi window to be tweaked extensively. +For each widget, the themer can specify padding, margin, border, font, and more. +It even allows, as an advanced feature, to pack widgets in a custom structure.

+

Basic structure

+

The whole view is made out of boxes that pack other boxes or widgets. +The box can be vertical or horizontal. This is loosely inspired by GTK.

+

The current layout of rofi is structured as follows:

+
|------------------------------------------------------------------------------------|
+| window {BOX:vertical}                                                              |
+| |-------------------------------------------------------------------------------|  |
+| | mainbox  {BOX:vertical}                                                       |  |
+| | |---------------------------------------------------------------------------| |  |
+| | | inputbar {BOX:horizontal}                                                 | |  |
+| | | |---------| |-| |---------------------------------|---| |---| |---| |---| | |  |
+| | | | prompt  | |:| | entry                           |#fr| | / | |#ns| |ci | | |  |
+| | | |---------| |_| |---------------------------------|---| |---| |---| |---| | |  |
+| | |---------------------------------------------------------------------------| |  |
+| |                                                                               |  |
+| | |---------------------------------------------------------------------------| |  |
+| | | message                                                                   | |  |
+| | | |-----------------------------------------------------------------------| | |  |
+| | | | textbox                                                               | | |  |
+| | | |-----------------------------------------------------------------------| | |  |
+| | |---------------------------------------------------------------------------| |  |
+| |                                                                               |  |
+| | |-----------------------------------------------------------------------------|  |
+| | | listview                                                                    |  |
+| | | |------------------------------------------------------------------------]  |  |
+| | | | element                                                                |  |  |
+| | | | |-----------------| |------------------------------------------------] |  |  |
+| | | | |element-icon     | |element-text                                    | |  |  |
+| | | | |-----------------| |------------------------------------------------| |  |  |
+| | | |------------------------------------------------------------------------]  |  |
+| | |-----------------------------------------------------------------------------|  |
+| |                                                                               |  |
+| | |---------------------------------------------------------------------------| |  |
+| | |  mode-switcher {BOX:horizontal}                                           | |  |
+| | | |---------------|   |---------------|  |--------------| |---------------| | |  |
+| | | | Button        |   | Button        |  | Button       | | Button        | | |  |
+| | | |---------------|   |---------------|  |--------------| |---------------| | |  |
+| | |---------------------------------------------------------------------------| |  |
+| |-------------------------------------------------------------------------------|  |
+|------------------------------------------------------------------------------------|
+
+
+
+
+
    +
  • ci is the case-indicator
  • +
  • fr is the num-filtered-rows
  • +
  • ns is the num-rows
  • +
+
+

Error message structure

+
|-----------------------------------------------------------------------------------|
+| window {BOX:vertical}                                                             |
+| |------------------------------------------------------------------------------|  |
+| | error-message {BOX:vertical}                                                 |  |
+| | |-------------------------------------------------------------------------|  |  |
+| | | textbox                                                                 |  |  |
+| | |-------------------------------------------------------------------------|  |  |
+| |------------------------------------------------------------------------------|  |
+|-----------------------------------------------------------------------------------|
+
+
+
+

Advanced layout

+

The layout of rofi can be tweaked by packing the 'fixed' widgets in a custom structure.

+

The following widgets are fixed, as they provide core rofi functionality:

+
    +
  • prompt
  • +
  • entry
  • +
  • overlay
  • +
  • case-indicator
  • +
  • message
  • +
  • listview
  • +
  • mode-switcher
  • +
  • num-rows
  • +
  • num-filtered-rows
  • +
+

The following keywords are defined and can be used to automatically pack a subset of the widgets. +These are used in the default theme as depicted in the figure above.

+
    +
  • mainbox + Packs: inputbar, message, listview, mode-switcher
  • +
  • inputbar + Packs: prompt,entry,case-indicator
  • +
+

Any widget name starting with textbox is a textbox widget, others are box widgets and can pack other widgets.

+

There are several special widgets that can be used by prefixing the name of the widget:

+

textbox

+

This is a read-only textbox widget. The displayed string can be set with content.

+

Example:

+
textbox-custom {
+  expand: false;
+  content: "My Message";
+}
+
+

Icon

+

This is an icon widget. The displayed icon can be set with filename and size with size. +If the property action is set, it acts as a button. +action can be set to a keybinding name and completes that action. (see rofi -show keys for a list).

+

If the squared property is set to false the widget height and width are not forced to be equal.

+

Example:

+
icon-paste {
+    expand: false;
+    filename: "gtk-paste";
+    size: 24;
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

button

+

This is a textbox widget that can have a 'clickable' action. +The action can be set to: +keybinding: accepts a keybinding name and completes that action. (see rofi -show keys for a list).

+
button-paste {
+    expand: false;
+    content: "My Clickable Message";
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

Children

+

To specify children, set the children +property (this always happens on the box child, see example below):

+
inputbar {
+  children: [prompt,entry,overlay,case-indicator];
+}
+
+

The theme needs to be updated to match the hierarchy specified.

+

Below is an example of a theme emulating dmenu:

+
* {
+    background-color:      Black;
+    text-color:            White;
+    border-color:          White;
+    font:            "Times New Roman 12";
+}
+
+window {
+    anchor:     north;
+    location:   north;
+    width:      100%;
+    padding:    4px;
+    children:   [ horibox ];
+}
+
+horibox {
+    orientation: horizontal;
+    children:   [ prompt, entry, listview ];
+}
+
+listview {
+    layout:     horizontal;
+    spacing:    5px;
+    lines:      10;
+}
+
+entry {
+    expand:     false;
+    width:      10em;
+}
+
+element {
+    padding: 0px 2px;
+}
+element selected {
+    background-color: SteelBlue;
+}
+
+

Padding and margin

+

Just like CSS, rofi uses the box model for each widget.

+
|-------------------------------------------------------------------|
+| margin                                                            |
+|  |-------------------------------------------------------------|  |
+|  | border                                                      |  |
+|  | |---------------------------------------------------------| |  |
+|  | | padding                                                 | |  |
+|  | | |-----------------------------------------------------| | |  |
+|  | | | content                                             | | |  |
+|  | | |-----------------------------------------------------| | |  |
+|  | |---------------------------------------------------------| |  |
+|  |-------------------------------------------------------------|  |
+|-------------------------------------------------------------------|
+
+

Explanation of the different parts:

+
    +
  • Content - The content of the widget.
  • +
  • Padding - Clears an area around the widget. + The padding shows the background color of the widget.
  • +
  • Border - A border that goes around the padding and content. + The border use the border-color of the widget.
  • +
  • Margin - Clears an area outside the border. + The margin is transparent.
  • +
+

The box model allows us to add a border around elements, and to define space between elements.

+

The size of each margin, border, and padding can be set. +For the border, a linestyle and radius can be set.

+

Spacing

+

Widgets that can pack more then one child widget (currently box and listview) have the spacing property. +This property sets the distance between the packed widgets (both horizontally and vertically).

+
|---------------------------------------|
+|  |--------| s |--------| s |-------|  |
+|  | child  | p | child  | p | child |  |
+|  |        | a |        | a |       |  |
+|  |        | c |        | c |       |  |
+|  |        | i |        | i |       |  |
+|  |        | n |        | n |       |  |
+|  |--------| g |--------| g |-------|  |
+|---------------------------------------|
+
+

Advanced box packing

+

More dynamic spacing can be achieved by adding dummy widgets, for example to make one widget centered:

+
|----------------------------------------------------|
+|  |---------------|  |--------|  |---------------|  |
+|  | dummy         |  | child  |  | dummy         |  |
+|  | expand: true; |  |        |  | expand: true; |  |
+|  |               |  |        |  |               |  |
+|  |               |  |        |  |               |  |
+|  |               |  |        |  |               |  |
+|  |---------------|  |--------|  |---------------|  |
+|----------------------------------------------------|
+
+

If both dummy widgets are set to expand, child will be centered. Depending on the expand flag of child the +remaining space will be equally divided between both dummy and child widget (expand enabled), or both dummy widgets +(expand disabled).

+

DEBUGGING

+

To get debug information from the parser, run rofi like:

+
G_MESSAGES_DEBUG=Parser rofi -show run
+
+

Syntax errors are shown in a popup and printed out to command line with the above command.

+

To see the elements queried during running, run:

+
G_MESSAGES_DEBUG=Theme rofi -show run
+
+

To test minor changes, part of the theme can be passed on the command line, for example to set it to full-screen:

+
rofi -theme-str 'window { fullscreen:true;}' -show run
+
+

To print the current theme, run:

+
rofi -dump-theme
+
+

Media support

+

Parts of the theme can be conditionally loaded, like the CSS @media option.

+
@media ( min-width: 120 ) {
+
+}
+
+

It supports the following keys as constraint:

+
    +
  • min-width: load when width is bigger or equal then value.
  • +
  • max-width: load when width is smaller then value.
  • +
  • min-height: load when height is bigger or equal then value.
  • +
  • max-height: load when height is smaller then value.
  • +
  • min-aspect-ratio load when aspect ratio is over value.
  • +
  • max-aspect-ratio: load when aspect ratio is under value.
  • +
  • monitor-id: The monitor id, see rofi -help for id's.
  • +
+

@media takes an integer number or a fraction, for integer number px can be added.

+
@media ( min-width: 120 px ) {
+
+}
+
+

Font Parsing

+

Rofi uses pango for font rendering. The font should be specified in a format that pango +understands. +This normally is the font name followed by the font size. For example:

+
mono 18
+
+

Or

+
FontAwesome 22
+
+

Multiple file handling

+

The rasi file format offers two methods of including other files. +This can be used to modify existing themes, or have multiple variations on a theme.

+
    +
  • import: Import and parse a second file.
  • +
  • theme: Discard theme, and load file as a fresh theme.
  • +
+

Syntax:

+
@import "myfile"
+@theme "mytheme"
+
+

The specified file can either by name, filename,full path.

+

If a filename is provided, it will try to resolve it in the following order:

+
    +
  • ${XDG_CONFIG_HOME}/rofi/themes/
  • +
  • ${XDG_CONFIG_HOME}/rofi/
  • +
  • ${XDG_DATA_HOME}/rofi/themes/
  • +
  • ${INSTALL PREFIX}/share/rofi/themes/
  • +
+

A name is resolved as a filename by appending the .rasi extension.

+

EXAMPLES

+

Several examples are installed together with rofi. These can be found in {datadir}/rofi/themes/, where +{datadir} is the install path of rofi data. When installed using a package manager, this is usually: /usr/share/.

+

SEE ALSO

+

rofi(1), rofi-script(5), rofi-theme-selector(1)

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.1/rofi.1/index.html b/1.7.1/rofi.1/index.html new file mode 100644 index 00000000..4491360d --- /dev/null +++ b/1.7.1/rofi.1/index.html @@ -0,0 +1,2710 @@ + + + + + + + + + + + + + + + + + + + + + + Rofi - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

ROFI 1 rofi

+

NAME

+

rofi - A window switcher, application launcher, ssh dialog, dmenu replacement and more

+

SYNOPSIS

+

rofi [ -show mode ]|[ -dmenu ]|[ -e msg ] [ CONFIGURATION ]

+

DESCRIPTION

+

rofi is an X11 pop-up window switcher, run dialog, dmenu replacement, and more. It focuses on +being fast to use and have minimal distraction. It supports keyboard and mouse navigation, type to +filter, tokenized search and more.

+

USAGE

+

rofi's main functionality is to assist in your workflow, allowing you to quickly switch +between windows, start applications or log into a remote machine via ssh. +There are different modi for different types of actions.

+

rofi can also function as (drop-in) replacement for dmenu(1).

+

Running rofi

+

To launch rofi directly in a certain mode, specify a mode with rofi -show <mode>. +To show the run dialog:

+
rofi -show run
+
+

Emulating dmenu

+

rofi can emulate dmenu(1) (a dynamic menu for X11) when launched with the -dmenu flag.

+

The website for dmenu can be found here.

+

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).

+

Display Error message

+

rofi error dialog can also be called from the command line.

+
rofi -e "my message"
+
+

Markup support can be enabled, see CONFIGURATION options.

+

CONFIGURATION

+

There are currently three methods of setting configuration options (evaluated in order below):

+
    +
  • System configuration file (for example /etc/rofi.rasi). + It first checks XDG_CONFIG_DIRS, and then SYSCONFDIR (that is passed at compile time). + It loads the first config file it finds, it does not merge multiple system configuration files.
  • +
  • Rasi theme file: The new theme format can be used to set configuration values.
  • +
  • Command-line options: Arguments passed to rofi.
  • +
+

To get a template config file, run: rofi -dump-config > config.rasi

+

This will contain (commented) all current configuration options, modified options are uncommented.

+

The configuration system supports the following types:

+
    +
  • string
  • +
  • integer (signed and unsigned)
  • +
  • char
  • +
  • boolean
  • +
  • lists
  • +
+

For the syntax of these options, see the rofi-theme(5) manpage.

+

For use on the command line, Boolean options have a non-default command-line +syntax. Example to enable option X:

+
-X
+
+

To disable option X:

+
-no-X
+
+

Below is a list of the most important options:

+

General

+

-help

+

The help option shows the full list of command-line options and the current set values. +These include dynamic (run-time generated) options.

+

-version

+

Show the rofi version and exit.

+

-dump-config

+

Dump the current active configuration, in rasi format, to stdout and exit. +Information about the rasi format can be found in the rofi-theme(5) manpage.

+

-dump-theme

+

Dump the current active theme, in rasi format, to stdout and exit.

+

-rasi-validate filename

+

Try to parse the file and return 0 when successful, non-zero when failed.

+

-threads num

+

Specify the number of threads rofi should use:

+
    +
  • 0: Autodetect the number of supported hardware threads.
  • +
  • 1: Disable threading
  • +
  • +

    2..n: Specify the maximum number of threads to use in the thread pool.

    +

    Default: Autodetect

    +
  • +
+

-display display

+

The X server to contact. Default is $DISPLAY.

+

-dmenu

+

Run rofi in dmenu mode. This allows for interactive scripts. +In dmenu mode, rofi reads from STDIN, and output to STDOUT. +A simple example, displaying three pre-defined options:

+
echo -e "Option #1\nOption #2\nOption #3" | rofi -dmenu
+
+

Or get the options from a script:

+
~/my_script.sh | rofi -dmenu
+
+

-show mode

+

Open rofi in a certain mode. Available modes are window, run, drun, ssh, combi. +The special argument keys can be used to open a searchable list of supported key bindings +(see KEY BINDINGS)

+

To show the run-dialog:

+
rofi -show run
+
+

If -show is the last option passed to rofi, the first enabled modi is shown.

+

-modi mode1,mode2

+

Specify an ordered, comma-separated list of modes to enable. +Enabled modes can be changed at runtime. Default key is Ctrl+Tab. +If no modes are specified, all configured modes will be enabled. +To only show the run and ssh launcher:

+
rofi -modi "run,ssh" -show run
+
+

Custom modes can be added using the internal script mode. Each such mode has two parameters:

+
<name>:<script>
+
+

Example: Have a mode called 'Workspaces' using the i3_switch_workspaces.sh script:

+
rofi -modi "window,run,ssh,Workspaces:i3_switch_workspaces.sh" -show Workspaces
+
+

Notes: The i3 window manager dislikes commas in the command when specifying an exec command. +For that case, # can be used as a separator.

+

TIP: The name is allowed to contain spaces:

+
rofi -modi "My File Browser:fb.sh" -show "My File Browser"
+
+

-case-sensitive

+

Start in case-sensitive mode. +This option can be changed at run-time using the -kb-toggle-case-sensitivity key binding.

+

-cycle

+

Cycle through the result list. Default is 'true'.

+

-filter filter

+

Filter the list by setting text in input bar to filter

+

-config filename

+

Load an alternative configuration file.

+

-cache-dir filename

+

Directory that is used to place temporary files, like history.

+

-scroll-method method

+

Select the scrolling method. 0: Per page, 1: continuous.

+

-normalize-match

+

Normalize the string before matching, so o will match ö, and é matches e.
+This is not a perfect implementation, but works. For now, it disables highlighting of the matched part.

+

-no-lazy-grab

+

Disables lazy grab, this forces the keyboard being grabbed before gui is shown.

+

-no-plugins

+

Disable plugin loading.

+

-plugin-path directory

+

Specify the directory where rofi should look for plugins.

+

-show-icons

+

Show application icons in drun and window modes.

+

-icon-theme

+

Specify icon theme to be used. +If not specified default theme from DE is used, Adwaita and gnome themes act as +fallback themes.

+

-application-fallback-icon

+

Specify an icon to be used when the application icon in run/drun are not yet loaded or is not available.

+

-markup

+

Use Pango markup to format output wherever possible.

+

-normal-window

+

Make rofi react like a normal application window. Useful for scripts like Clerk that are basically an application.

+

-[no-]steal-focus

+

Make rofi steal focus on launch and restore close to window that held it when launched.

+

Matching

+

-matching method

+

Specify the matching algorithm used. +Currently, the following methods are supported:

+
    +
  • normal: match the int string
  • +
  • regex: match a regex input
  • +
  • glob: match a glob pattern
  • +
  • fuzzy: do a fuzzy match
  • +
  • prefix: match prefix
  • +
+

Default: normal

+

Note: glob matching might be slow for larger lists

+

-tokenize

+

Tokenize the input.

+

-drun-categories category1,category2

+

Only show desktop files that are present in the listed categories.

+

-drun-match-fields field1,field2,...

+

When using drun, match only with the specified Desktop entry fields. +The different fields are:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
  • +

    all: all the above

    +

    Default: name,generic,exec,categories,keywords

    +
  • +
+

-drun-display-format

+

The format string for the drun dialog:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
+

Pango markup can be used to formatting the output.

+
Default: {name} [<span weight='light' size='small'><i>({generic})</i></span>]
+
+

Note: Only fields enabled in -drun-match-fields can be used in the format string.

+

-[no-]drun-show-actions

+

Show actions present in the Desktop files.

+
Default: false
+
+

-window-match-fields field1,field2,...

+

When using window mode, match only with the specified fields. +The different fields are:

+
    +
  • title: window's title
  • +
  • class: window's class
  • +
  • role: window's role
  • +
  • name: window's name
  • +
  • desktop: window's current desktop
  • +
  • +

    all: all the above

    +

    Default: all

    +
  • +
+

-matching-negate-char char

+

Set the character used to negate the query (i.e. if it does not match the next keyword). +Set to '\x0' to disable.

+
Default: '-'
+
+

Layout and Theming

+

IMPORTANT: + In newer rofi releases, all the theming options have been moved into the new theme format. They are no longer normal + rofi options that can be passed directly on the command line (there are too many). + Small snippets can be passed on the command line: rofi -theme-str 'window {width: 50%;}' to override a single + setting. They are merged into the current theme. + They can also be appended at the end of the rofi config file to override parts of the theme.

+

Most of the following options are deprecated and should not be used. Please use the new theme format to customize +rofi. More information about the new format can be found in the rofi-theme(5) manpage.

+

-location

+

Specify where the window should be located. The numbers map to the following locations on screen:

+
  1 2 3
+  8 0 4
+  7 6 5
+
+

Default: 0

+

-fixed-num-lines

+

Keep a fixed number of visible lines.

+

-sidebar-mode

+

Open in sidebar-mode. In this mode, a list of all enabled modes is shown at the bottom. +(See -modi option) +To show sidebar, use:

+
rofi -show run -sidebar-mode
+
+

-hover-select

+

Automatically select the entry the mouse is hovering over. This option is best combined with custom mouse bindings. +To utilize hover-select and accept an entry in a single click, use:

+
rofi -show run -hover-select -me-select-entry '' -me-accept-entry MousePrimary
+
+

-eh number

+

Set row height (in chars) +Default: 1

+

-auto-select

+

When one entry is left, automatically select it.

+

-m num

+

-m name

+

-monitor num

+

-monitor name

+

Select monitor to display rofi on. +It accepts as input: primary (if primary output is set), the xrandr output name, or integer number (in order of +detection). Negative numbers are handled differently:

+
    +
  • -1: the currently focused monitor.
  • +
  • -2: the currently focused window (that is, rofi will be displayed on top of the focused window).
  • +
  • -3: Position of mouse (overrides the location setting to get normal context menu + behavior.)
  • +
  • -4: the monitor with the focused window.
  • +
  • +

    -5: the monitor that shows the mouse pointer.

    +

    Default: -5

    +
  • +
+

See rofi -h output for the detected monitors, their position, and size.

+

-theme filename

+

Path to the new theme file format. This overrides the old theme settings.

+

-theme-str string

+

Allow theme parts to be specified on the command line as an override.

+

For example:

+
rofi -theme-str '#window { fullscreen: true; }'
+
+

This option can be specified multiple times. +This is now the method to tweak the theme via the command line.

+

-dpi number

+

Override the default DPI setting.

+
    +
  • If set to 0, it tries to auto-detect based on X11 screen size (similar to i3 and GTK).
  • +
  • If set to 1, it tries to auto-detect based on the size of the monitor that rofi is displayed on (similar to latest Qt 5).
  • +
+

-selected-row selected row

+

Select a certain row.

+

Default: 0

+

PATTERN setting

+

-terminal

+

Specify which terminal to start.

+
rofi -terminal xterm
+
+

Pattern: {terminal}

+

Default: x-terminal-emulator

+

-ssh-client client

+

Override the used ssh client.

+

Pattern: {ssh-client}

+

Default: ssh

+

SSH settings

+

-ssh-command cmd

+

Set the command to execute when starting an ssh session. +The pattern {host} is replaced by the selected ssh entry.

+

Pattern: {ssh-client}

+

Default: {terminal} -e {ssh-client} {host}

+

-parse-hosts

+

Parse the /etc/hosts file for entries.

+

Default: disabled

+

-parse-known-hosts +-no-parse-known-hosts

+

Parse the ~/.ssh/known_hosts file for entries.

+

Default: enabled

+

Run settings

+

-run-command cmd

+

Set command ({cmd}) to execute when running an application. +See PATTERN.

+

Default: {cmd}

+

-run-shell-command cmd

+

Set command to execute when running an application in a shell. +See PATTERN.

+

Default: {terminal} -e {cmd}

+

-run-list-command cmd

+

If set, use an external tool to generate a list of executable commands. Uses run-command.

+

Default: {cmd}

+

Window switcher settings

+

-window-format format

+

Format what is being displayed for windows.

+

format: {field[:len]}

+

field:

+
    +
  • w: desktop name
  • +
  • t: title of window
  • +
  • n: name
  • +
  • r: role
  • +
  • c: class
  • +
+

len: maximum field length (0 for auto-size). If length and window width are negative, field length is width - len.
+If length is positive, the entry will be truncated or padded to fill that length.

+

default: {w} {c} {t}

+

-window-command cmd

+

Set command to execute on selected window for an alt action (-kb-accept-alt). +See PATTERN.

+

Default: "wmctrl -i -R {window}"

+

-window-thumbnail

+

Show window thumbnail (if available) as icon in the window switcher.

+

You can stop rofi from exiting when closing a window (allowing multiple to be closed in a row).

+
configuration {
+  window {
+      close-on-delete: false;
+  }
+}
+
+

Combi settings

+

-combi-modi mode1,mode2

+

The modi to combine in combi mode. +For syntax to -combi-modi, see -modi. +To get one merge view, of window,run, and ssh:

+
rofi -show combi -combi-modi "window,run,ssh" -modi combi
+
+

NOTE: The i3 window manager dislikes commas in the command when specifying an exec command. +For that case, # can be used as a separator.

+

History and Sorting

+

-disable-history +-no-disable-history (re-enable history)

+

Disable history

+

-sort to enable +-no-sort to disable

+

Enable, disable sorting. +This setting can be changed at runtime (see -kb-toggle-sort).

+

-sorting-method 'method' to specify the sorting method.

+

There are 2 sorting methods:

+
    +
  • levenshtein (Default)
  • +
  • fzf sorting.
  • +
+

-max-history-size number

+

Maximum number of entries to store in history. Defaults to 25. (WARNING: can cause slowdowns when set too high)

+

Dmenu specific

+

-sep separator

+

Separator for dmenu. Example: To show a list of 'a' to 'e' with '|' as a separator:

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
+
+

-p prompt

+

Specify the prompt to show in dmenu mode. For example, select 'monkey', a,b,c,d, or e.

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey"
+
+

Default: dmenu

+

-l number of lines to show

+

Maximum number of lines the menu may show before scrolling.

+
rofi -dmenu -l 25
+
+

Default: 15

+

-i

+

Makes dmenu searches case-insensitive

+

-a X

+

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:

+
    +
  • 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'
  • +
+

-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

+

Allows the output of dmenu to be customized (N is the total number of input entries):

+
    +
  • '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)
  • +
+

Default: 's'

+

-select string

+

Select first line that matches the given string

+

-mesg string

+

Add a message line below the filter entry box. Supports Pango markup. +For more information on supported markup, see here

+

-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. +See here for details about Pango markup.

+

-multi-select

+

Allow multiple lines to be selected. Adds a small selection indicator to the left of each entry.

+

-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-match or -auto-select.

+

-async-pre-read number

+

Reads the first number entries blocking, then switches to async mode. +This makes it feel more 'snappy'.

+

default: 25

+

-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.

+

Message dialog

+

-e message

+

Pops up a message dialog (used internally for showing errors) with message. +Message can be multi-line.

+

File browser settings

+

File browser behavior can be controlled via the following options:

+
configuration {
+   filebrowser {
+      /** Directory the file browser starts in. */
+      directory: "/some/directory";
+      /**
+        * Sorting method. Can be set to:
+        *   - "name"
+        *   - "mtime" (modification time)
+        *   - "atime" (access time)
+        *   - "ctime" (change time)
+        */
+      sorting-method: "name";
+      /** Group directories before files. */
+      directories-first: true;
+   }
+}
+
+

Other

+

-drun-use-desktop-cache

+

Build and use a cache with the content of desktop files. Usable for systems with slow hard drives.

+

-drun-reload-desktop-cache

+

If drun-use-desktop-cache is enabled, rebuild a cache with the content of desktop files.

+

-drun-url-launcher command

+

Command to open a Desktop Entry that is a Link.

+

-pid path

+

Make rofi create a pid file and check this on startup. The pid file prevents multiple rofi instances from running simultaneously. This is useful when running rofi from a key-binding daemon.

+

-display-{mode} string

+

Set the name to use for mode. This is used as prompt and in combi-browser.

+

It is now preferred to use the configuration file:

+
configuration {
+  {mode} {
+    display-name: *string*;
+  }
+}
+
+

-click-to-exit +-no-click-to-exit

+

Click the mouse outside the rofi window to exit.

+

Default: enabled

+

PATTERN

+

To launch commands (for example, when using the ssh launcher), the user can enter the used command-line. The following keys can be used that will be replaced at runtime:

+
    +
  • {host}: the host to connect to
  • +
  • {terminal}: the configured terminal (see -terminal-emulator)
  • +
  • {ssh-client}: the configured ssh client (see -ssh-client)
  • +
  • {cmd}: the command to execute
  • +
  • {window}: the window ID of the selected window (in window-command)
  • +
+

DMENU REPLACEMENT

+

If argv[0] (calling command) is dmenu, rofi will start in dmenu mode. +This way, it can be used as a drop-in replacement for dmenu. Just copy or symlink rofi to dmenu in $PATH.

+
ln -s /usr/bin/rofi /usr/bin/dmenu
+
+

THEMING

+

Please see rofi-theme(5) manpage for more information on theming.

+

KEY BINDINGS

+

rofi has the following key bindings:

+
    +
  • Control-v, Insert: Paste from clipboard
  • +
  • Control-Shift-v, Shift-Insert: Paste primary selection
  • +
  • Control-u: Clear the line
  • +
  • Control-a: Beginning of line
  • +
  • Control-e: End of line
  • +
  • Control-f, Right: Forward one character
  • +
  • Alt-f, Control-Right: Forward one word
  • +
  • Control-b, Left: Back one character
  • +
  • Alt-b, Control-Left: Back one word
  • +
  • Control-d, Delete: Delete character
  • +
  • Control-Alt-d: Delete word
  • +
  • Control-h, Backspace, Shift-Backspace: Backspace (delete previous character)
  • +
  • Control-Alt-h: Delete previous word
  • +
  • Control-j,Control-m,Enter: Accept entry
  • +
  • Control-n,Down: Select next entry
  • +
  • Control-p,Up: Select previous entry
  • +
  • Page Up: Go to previous page
  • +
  • Page Down: Go to next page
  • +
  • Control-Page Up: Go to previous column
  • +
  • Control-Page Down: Go to next column
  • +
  • Control-Enter: Use entered text as a command (in ssh/run modi)
  • +
  • Shift-Enter: Launch the application in a terminal (in run mode)
  • +
  • Control-Shift-Enter: As Control-Enter and run the command in terminal (in run mode)
  • +
  • Shift-Enter: Return the selected entry and move to the next item while keeping rofi open. (in dmenu)
  • +
  • Shift-Right: Switch to the next mode. The list can be customized with the -modi argument.
  • +
  • Shift-Left: Switch to the previous mode. The list can be customized with the -modi argument.
  • +
  • Control-Tab: Switch to the next mode. The list can be customized with the -modi argument.
  • +
  • Control-Shift-Tab: Switch to the previous mode. The list can be customized with the -modi argument.
  • +
  • Control-space: Set selected item as input text.
  • +
  • Shift-Del: Delete entry from history.
  • +
  • grave: Toggle case sensitivity.
  • +
  • Alt-grave: Toggle sorting.
  • +
  • Alt-Shift-S: Take a screenshot and store it in the Pictures directory.
  • +
  • Control-l: File complete for run dialog.
  • +
+

This list might not be complete, to get a full list of all key bindings +supported in your rofi, see rofi -h. The options starting with -kb are keybindings.

+

Key bindings can be modified using the configuration systems. Multiple keys can be bound +to one action by comma separating them. For example -kb-primary-paste "Conctrol+v,Insert"

+

To get a searchable list of key bindings, run rofi -show keys.

+

A key binding starting with ! will act when all keys have been released.

+

You can bind certain events to key-actions:

+

Timeout

+

You can configure an action to be taken when rofi has not been interacted +with for a certain amount of seconds. You can specify a keybinding to trigger +after X seconds.

+
configuration {
+  timeout {
+      delay:  15;
+      action: "kb-cancel";
+  }
+}
+
+

Input change

+

When the input of the textbox changes:

+
configuration {
+  inputchange {
+      action: "kb-row-first";
+  }
+}
+
+

Available Modi

+

window

+

Show a list of all the windows and allow switching between them. +Pressing the delete-entry binding (shift-delete) will close the window. +Pressing the accept-custom binding (control-enter or shift-enter) will run a command on the window. +(See option window-command );

+

If there is no match, it will try to launch the input.

+

windowcd

+

Shows a list of the windows on the current desktop and allows switching between them. +Pressing the delete-entry binding (shift-delete) will kill the window. +Pressing the accept-custom binding (control-enter or shift-enter) will run a command on the window. +(See option window-command );

+

If there is no match, it will try to launch the input.

+

run

+

Shows a list of executables in $PATH and can launch them (optional in a terminal). +Pressing the delete-entry binding (shift-delete) will remove this entry from the run history. +Pressing the accept-custom binding (control-enter) will run the command as entered in the entry box. +Pressing the accept-alt binding (shift-enter) will run the command in a terminal.

+

When pressing the mode-complete binding (Control-l), you can use the File Browser mode to launch the application +with a file as the first argument.

+

drun

+

Same as the run launches, but the list is created from the installed desktop files. It automatically launches them +in a terminal if specified in the Desktop File. +Pressing the delete-entry binding (shift-delete) will remove this entry from the run history. +Pressing the accept-custom binding (control-enter) will run the command as entered in the entry box. +Pressing the accept-alt binding (shift-enter) will run the command in a terminal.

+

When pressing the mode-complete binding (Control-l), you can use the File Browser mode to launch the application +passing a file as argument if specified in the desktop file.

+

The DRUN mode tries to follow the XDG Desktop Entry +Specification and should be compatible with +applications using this standard. Some applications create invalid desktop files, rofi will discard these entries. +See the debugging section for more info on DRUN mode, this will print why desktop files are +discarded.

+

There are two advanced options to tweak the behaviour:

+
configuration {
+   drun {
+      /** Parse user desktop files. */
+      parse-user:   true;
+      /** Parse system desktop files. */
+      parse-system: false;
+   }
+}
+
+

ssh

+

Shows a list of SSH targets based on your ssh config file, and allows to quickly ssh into them.

+

keys

+

Shows a searchable list of key bindings.

+

script

+

Allows custom scripted Modi to be added, see the rofi-script(5) manpage for more information.

+

combi

+

Combines multiple modi in one list. Specify which modi are included with the -combi-modi option.

+

When using the combi mode, a !bang can be used to filter the results by modi. +All modi that match the bang as a prefix are included. +For example, say you have specified -combi-modi run,window,windowcd. If your +query begins with the bang !w, only results from the window and windowcd +modi are shown, even if the rest of the input text would match results from run.

+

If no match, the input is handled by the first combined modi.

+

FAQ

+

The text in the window switcher is not nicely aligned.

+

Try using a mono-space font.

+

The window is completely black.

+

Check quotes used on the command-line: you might have used ("smart quotes") instead of " ("machine quotes").

+

What does the icon in the top right show?

+

The indicator shows:

+
` ` Case insensitive and no sorting.
+`-` Case sensitivity enabled, no sorting.
+`+` Case insensitive and Sorting enabled
+`±` Sorting and Case sensitivity enabled"
+
+

EXAMPLES

+

Some basic usage examples of rofi:

+

Show the run dialog:

+
rofi -modi run -show run
+
+

Show the run dialog, and allow switching to Desktop File run dialog (drun):

+
rofi -modi run,drun -show run
+
+

Combine the run and Desktop File run dialog (drun):

+
rofi -modi combi -show combi -combi-modi run,drun
+
+

Combine the run and Desktop File run dialog (drun), and allow switching to window switcher:

+
rofi -modi combi,window -show combi -combi-modi run,drun
+
+

Pop up a text message claiming that this is the end:

+
rofi -e "This is the end"
+
+

Pop up a text message in red, bold font claiming that this is still the end:

+
rofi -e "<span color='red'><b>This is still the end</b></span>" -markup
+
+

Show all key bindings:

+
rofi -show keys
+
+

Use qalc to get a simple calculator in rofi:

+
 rofi -show calc -modi "calc:qalc +u8 -nocurrencies"
+
+

i3

+

In i3 you want to bind rofi to be launched on key release. Otherwise, it cannot grab the keyboard. +See also the i3 manual:

+

Some tools (such as import or xdotool) might be unable to run upon a KeyPress event, because the keyboard/pointer is +still grabbed. For these situations, the --release flag can be used, as it will execute the command after the keys have +been released.

+

LICENSE

+
MIT/X11
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+

WEBSITE

+

rofi website can be found here

+

SUPPORT

+

rofi support can be obtained: + * GitHub Discussions + * Forum (Reddit) + * IRC (#rofi on irc.libera.chat),

+

DEBUGGING

+

To debug, it is smart to first try disabling your custom configuration: +-no-config

+

Disable parsing of configuration. This runs rofi in stock mode.

+

If you run custom C plugins, you can disable them using:

+

-no-plugins

+

Disables the loading of plugins.

+

To further debug the plugin, you can get a trace with (lots of) debug information. This debug output can be enabled for +multiple parts in rofi using the glib debug framework. Debug domains can be enabled by setting the G_MESSAGES_DEBUG +environment variable. At the time of creation of this page, the following debug domains exist:

+
    +
  • all: Show debug information from all domains.
  • +
  • X11Helper: The X11 Helper functions.
  • +
  • View: The main window view functions.
  • +
  • Widgets.Box: The Box widget.
  • +
  • Dialogs.DMenu: The dmenu mode.
  • +
  • Dialogs.Run: The run mode.
  • +
  • Dialogs.DRun: The desktop file run mode.
  • +
  • Dialogs.Window: The window mode.
  • +
  • Dialogs.Script: The script mode.
  • +
  • Dialogs.Combi: The script mode.
  • +
  • Dialogs.Ssh: The ssh mode.
  • +
  • Rofi: The main application.
  • +
  • Timings: Get timing output.
  • +
  • Theme: Theme engine debug output. (warning lots of output).
  • +
  • Widgets.Icon: The Icon widget.
  • +
  • Widgets.Box: The box widget.
  • +
  • Widgets.Container: The container widget.
  • +
  • Widgets.Window: The window widget.
  • +
  • Helpers.IconFetcher: Information about icon lookup.
  • +
+

The output of this can provide useful information when writing an issue.

+

More information (possibly outdated) see this wiki entry.

+

ISSUE TRACKER

+

The rofi issue tracker can be found here

+

When creating an issue, please read this +first.

+

SEE ALSO

+

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

+

AUTHOR

+ +

Original code based on work by: Sean Pringle sean.pringle@gmail.com

+

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

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.2/rofi-script.5/index.html b/1.7.2/rofi-script.5/index.html new file mode 100644 index 00000000..499df110 --- /dev/null +++ b/1.7.2/rofi-script.5/index.html @@ -0,0 +1,1487 @@ + + + + + + + + + + + + + + + + + + + + + + Script - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-SCRIPT 5 rofi-script

+

NAME

+

rofi script mode - Rofi format for scriptable modi.

+

DESCRIPTION

+

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

+

USAGE

+

To specify a script mode, set a mode with the following syntax: "{name}:{executable}"

+

For example:

+
rofi -show fb -modi "fb:file_browser.sh"
+
+

The name should be unique.

+

API

+

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" ]
+then
+    exit 0
+fi
+echo "reload"
+echo "quit"
+
+
+

This shows two entries, reload and quit. When the quit entry is selected, rofi closes.

+

Environment

+

Rofi sets the following environment variable when executing the script:

+

ROFI_RETV

+

An integer number with the current state:

+
    +
  • 0: Initial call of script.
  • +
  • 1: Selected an entry.
  • +
  • 2: Selected a custom entry.
  • +
  • 10-28: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
  • +
+

ROFI_INFO

+

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. +Extra 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:

+
    +
  • prompt: Update the prompt text.
  • +
  • message: Update the message text.
  • +
  • markup-rows: If 'true' renders markup in the row.
  • +
  • urgent: Mark rows as urgent. (for syntax see the urgent option in dmenu mode)
  • +
  • active: Mark rows as active. (for syntax see the active option in dmenu mode)
  • +
  • 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.
  • +
  • no-custom: If set to 'true'; only accept listed entries, ignore custom input.
  • +
  • use-hot-keys: If set to true, it enabled the Custom keybindings for script. Warning this breaks the normal rofi flow.
  • +
+

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 entry.

+

For example:

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

The following options are supported:

+
    +
  • icon: Set the icon for that row.
  • +
  • meta: Specify invisible search terms.
  • +
  • nonselectable: If true the row cannot activated.
  • +
  • info: Info that, on selection, gets placed in the ROFI_INFO environment variable. This entry does not get searched.
  • +
+

multiple entries can be passed using the \x1f separator.

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

Executing external program

+

If you want to launch an external program from the script, you need to make sure it is launched in the background. +If not rofi will wait for its output (to display).

+

In bash the best way to do this is using coproc.

+
 coproc ( myApp  > /dev/null  2>&1 )
+
+

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 github.

+

SEE ALSO

+

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

+

AUTHOR

+

Qball Cow qball@gmpclient.org

+

Rasmus Steinke rasi@xssn.at

+

Quentin 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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.2/rofi-theme.5/index.html b/1.7.2/rofi-theme.5/index.html new file mode 100644 index 00000000..4dfbd9c6 --- /dev/null +++ b/1.7.2/rofi-theme.5/index.html @@ -0,0 +1,3088 @@ + + + + + + + + + + + + + + + + + + + + + + Themes - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-THEME 5 rofi-theme

+

NAME

+

rofi-theme - Rofi theme format files

+

DEFAULT THEME LOADING

+

By default, rofi loads the default theme. This theme is always loaded. +In the default (always loaded) configuration it does:

+
@theme "default"
+
+

To unload the default theme, and load another theme, add @theme to your +config.rasi file.

+

If you have a theme loaded by @theme or use the default theme, you can tweak +it by adding overriding elements at the end of your config.rasi file.

+

For the difference between @import and @theme see the Multiple file +handling section in this manpage.

+

To see the default theme, run the following command:

+
rofi -no-config -dump-theme
+
+

DESCRIPTION

+

The need for a new theme format was motivated by the fact that the way rofi handled widgets has changed. From a very +static drawing of lines and text to a nice structured form of packing widgets. This change made it possible to provide a +more flexible theme framework. The old theme format and config file are not flexible enough to expose these options in a +user-friendly way. Therefore, a new file format has been created, replacing the old one.

+

FORMAT SPECIFICATION

+

Encoding

+

The encoding of the file is utf-8. Both unix (\n) and windows (\r\n) newlines format are supported. But unix is +preferred.

+

Comments

+

C and C++ file comments are supported.

+
    +
  • Anything after // and before a newline is considered a comment.
  • +
  • Everything between /* and */ is a comment.
  • +
+

Comments can be nested and the C comments can be inline.

+

The following is valid:

+
// Magic comment.
+property: /* comment */ value;
+
+

However, this is not:

+
prop/*comment*/erty: value;
+
+

White space

+

White space and newlines, like comments, are ignored by the parser.

+

This:

+
property: name;
+
+

Is identical to:

+
     property             :
+name
+
+;
+
+

File extension

+

The preferred file extension for the new theme format is rasi. This is an +abbreviation for rofi advanced style information.

+

Basic Structure

+

Each element has a section with defined properties. Global properties can be defined in section * { }. +Sub-section names begin with a hash symbol #.

+

It is advised to define the global properties section on top of the file to +make inheritance of properties clearer.

+
/* Global properties section */
+* {
+    // list of properties
+}
+
+/* Element theme section. */
+{element path} {
+    // list of properties
+}
+{elements... } {
+    // list of properties
+}
+
+

If there are multiple sections with the same name, they are merged. Duplicate properties are overwritten and the last +parsed entry kept.

+

Global properties section

+

A theme can have one or more global properties sections. If there is more than one, +they will be merged.

+

The global properties section denotes the defaults for each element. +Each property of this section can be referenced with @{identifier} +(See Properties section)

+

A global properties section is indicated with a * as element path.

+

Element theme section

+

A theme can have multiple element theme sections.

+

The element path can consist of multiple names separated by whitespace or dots. +Each element may contain any number of letters, numbers and -'s. +The first element in the element path should always start with a #. +Multiple elements can be specified by a ,.

+

This is a valid element name:

+
element normal.normal {
+    background-color: blue;
+}
+button {
+    background-color: blue;
+}
+
+

And is identical to:

+
element normal normal, button {
+    background-color: blue;
+}
+
+

Each section inherits the global properties. Properties can be explicitly inherited from their parent with the +inherit keyword. +In the following example:

+
window {
+ a: 1;
+ b: 2;
+ children: [ mainbox ];
+}
+mainbox {
+    a: inherit;
+    b: 4;
+    c: 8;
+}
+
+

The element mainbox will have the following set of properties (if mainbox is a child of window):

+
a: 1;
+b: 4;
+c: 8;
+
+

If multiple sections are defined with the same name, they are merged by the +parser. If multiple properties with the same name are defined in one section, +the last encountered property is used.

+

Properties Format

+

The properties in a section consist of:

+
{identifier}: {value};
+
+

Both fields are mandatory for a property.

+

The identifier names the specified property. Identifiers can consist of any +combination of numbers, letters and '-'. It must not contain any whitespace. +The structure of the value defines the type of the property. The current +parser does not define or enforce a certain type of a particular identifier. +When used, values with the wrong type that cannot be converted are ignored.

+

The current theme format supports different types:

+
    +
  • a string
  • +
  • an integer number
  • +
  • a fractional number
  • +
  • a boolean value
  • +
  • a color
  • +
  • image
  • +
  • text style
  • +
  • line style
  • +
  • a distance
  • +
  • a padding
  • +
  • a border
  • +
  • a position
  • +
  • a reference
  • +
  • an orientation
  • +
  • a cursor
  • +
  • a list of keywords
  • +
  • an environment variable
  • +
  • Inherit
  • +
+

Some of these types are a combination of other types.

+

String

+
    +
  • Format: "[:print:]+"
  • +
+

A string is always surrounded by double quotes ("). Between the quotes there can be any printable character.

+

For example:

+
font: "Awasome 12";
+
+

The string must be valid UTF-8.

+

Integer

+
    +
  • Format: [-+]?[:digit:]+
  • +
+

An integer may contain any number.

+

For examples:

+
lines: 12;
+
+

Real

+
    +
  • Format: [-+]?[:digit:]+(\.[:digit:]+)?
  • +
+

A real is an integer with an optional fraction.

+

For example:

+
real: 3.4;
+
+

The following is not valid: .3, 3. or scientific notation: 3.4e-3.

+

Boolean

+
    +
  • Format: (true|false)
  • +
+

Boolean value is either true or false. This is case-sensitive.

+

For example:

+
dynamic: false;
+
+

Image

+

rofi support a limited set of background-image formats.

+
    +
  • Format: url("path to image");
  • +
  • Format: url("path to image", scale); + where scale is: none, both, width, height
  • +
  • Format: linear-gradient(stop color,stop1, color, stop2 color, ...);
  • +
  • Format: linear-gradient(to direction, stop color,stop1, color, stop2 color, ...); + where direction is: top,left,right,bottom.
  • +
  • Format: linear-gradient(angle, stop color,stop1, color, stop2 color, ...); + Angle in deg,rad,grad (as used in color).
  • +
+

Where the path is a string, and stop color is of type color.

+

Color

+

rofi supports the color formats as specified in the CSS standard (1,2,3 and some of CSS 4)

+
    +
  • Format: #{HEX}{3} (rgb)
  • +
  • Format: #{HEX}{4} (rgba)
  • +
  • Format: #{HEX}{6} (rrggbb)
  • +
  • Format: #{HEX}{8} (rrggbbaa)
  • +
  • Format: rgb[a]({INTEGER},{INTEGER},{INTEGER}[, {PERCENTAGE}])
  • +
  • Format: rgb[a]({INTEGER}%,{INTEGER}%,{INTEGER}%[, {PERCENTAGE}])
  • +
  • Format: hsl[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])
  • +
  • Format: hwb[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])
  • +
  • Format: cmyk( {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE} ])
  • +
  • Format: {named-color} [ / {PERCENTAGE} ]
  • +
+

The white-space format proposed in CSS4 is also supported.

+

The different values are:

+
    +
  • {HEX} is a hexadecimal number ('0-9a-f' case insensitive).
  • +
  • {INTEGER} value can be between 0 and 255 or 0-100 when representing percentage.
  • +
  • {ANGLE} is the angle on the color wheel, can be in deg, rad, grad or turn. When no unit is specified, degrees is assumed.
  • +
  • {PERCENTAGE} can be between 0-1.0, or 0%-100%
  • +
  • +

    {named-color} is one of the following colors:

    +

    AliceBlue, AntiqueWhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet, Brown, +BurlyWood, CadetBlue, Chartreuse, Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, DarkCyan, +DarkGoldenRod, DarkGray, DarkGrey, DarkGreen, DarkKhaki, DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, +DarkSalmon, DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkSlateGrey, DarkTurquoise, DarkViolet, DeepPink, DeepSkyBlue, +DimGray, DimGrey, DodgerBlue, FireBrick, FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, GoldenRod, +Gray, Grey, Green, GreenYellow, HoneyDew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, +LemonChiffon, LightBlue, LightCoral, LightCyan, LightGoldenRodYellow, LightGray, LightGrey, LightGreen, LightPink, +LightSalmon, LightSeaGreen, LightSkyBlue, LightSlateGray, LightSlateGrey, LightSteelBlue, LightYellow, Lime, LimeGreen, +Linen, Magenta, Maroon, MediumAquaMarine, MediumBlue, MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, +MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, MintCream, MistyRose, Moccasin, NavajoWhite, Navy, +OldLace, Olive, OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenRod, PaleGreen, PaleTurquoise, PaleVioletRed, +PapayaWhip, PeachPuff, Peru, Pink, Plum, PowderBlue, Purple, RebeccaPurple, Red, RosyBrown, RoyalBlue, SaddleBrown, +Salmon, SandyBrown, SeaGreen, SeaShell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray, SlateGrey, Snow, SpringGreen, +SteelBlue, Tan, Teal, Thistle, Tomato, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, YellowGreen,transparent

    +
  • +
+

For example:

+
background-color: #FF0000;
+border-color: rgba(0,0,1, 0.5);
+text-color: SeaGreen;
+
+

or

+
background-color: transparent;
+text-color: Black;
+
+

Text style

+
    +
  • Format: (bold|italic|underline|strikethrough|none)
  • +
+

Text style indicates how the highlighted text is emphasized. None indicates that no emphasis +should be applied.

+
    +
  • bold: make the text thicker then the surrounding text.
  • +
  • italic: put the highlighted text in script type (slanted).
  • +
  • underline: put a line under the highlighted text.
  • +
  • strikethrough: put a line through the highlighted text.
  • +
+

Line style

+
    +
  • Format: (dash|solid)
  • +
+

Indicates how a line should be drawn. +It currently supports: + * dash: a dashed line, where the gap is the same width as the dash + * solid: a solid line

+

Distance

+
    +
  • Format: {Integer}px
  • +
  • Format: {Real}em
  • +
  • Format: {Real}ch
  • +
  • Format: {Real}%
  • +
  • Format: {Integer}mm
  • +
+

A distance can be specified in 3 different units:

+
    +
  • px: Screen pixels.
  • +
  • em: Relative to text height.
  • +
  • ch: Relative to width of a single number.
  • +
  • mm: Actual size in millimeters (based on dpi).
  • +
  • %: Percentage of the monitor size.
  • +
+

Distances used in the horizontal direction use the monitor width. Distances in +the vertical direction use the monitor height. +For example:

+
   padding: 10%;
+
+

On a full-HD (1920x1080) monitor, it defines a padding of 192 pixels on the left +and right side and 108 pixels on the top and bottom.

+

Calculating sizes

+

Rofi supports some maths in calculating sizes. For this it uses the CSS syntax:

+
width: calc( 100% - 37px );
+
+

It supports the following operations:

+
    +
  • + : Add
  • +
  • - : Subtract
  • +
  • / : Divide
  • +
  • * : Multiply
  • +
  • % : Multiply
  • +
  • min : Minimum of l or rvalue;
  • +
  • max : Maximum of l or rvalue;
  • +
+

It uses the C precedence ordering.

+

Padding

+
    +
  • Format: {Integer}
  • +
  • Format: {Distance}
  • +
  • Format: {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance} {Distance}
  • +
+

If no unit is specified, pixels are assumed.

+

The different number of fields in the formats are parsed like:

+
    +
  • 1 field: all
  • +
  • 2 fields: top&bottom left&right
  • +
  • 3 fields: top, left&right, bottom
  • +
  • 4 fields: top, right, bottom, left
  • +
+

Border

+
    +
  • Format: {Integer}
  • +
  • Format: {Distance}
  • +
  • Format: {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style} {Distance} {Line style}
  • +
+

Borders are identical to padding, except that each distance field has a line +style property.

+
+

When no unit is specified, pixels are assumed.

+
+

Position

+

Indicate a place on the window/monitor.

+
    +
  • Format: (center|east|north|west|south|north east|north west|south west|south east)
  • +
+

+north west   |    north    |  north east
+-------------|-------------|------------
+      west   |   center    |  east
+-------------|-------------|------------
+south west   |    south    |  south east
+
+

Visibility

+

It is possible to hide widgets:

+

inputbar { + enabled: false; +}

+

Reference

+
    +
  • Format: @{PROPERTY NAME}
  • +
+

A reference can point to another reference. Currently, the maximum number of redirects is 20. +A property always refers to another property. It cannot be used for a subpart of the property. +For example, this is not valid:

+
highlight: bold @pink;
+
+

But this is:

+
* {
+    myhigh: bold #FAA;
+}
+
+window {
+    highlight: @myhigh;
+}
+
+
    +
  • Format: var(PROPERTY NAME, DEFAULT)
  • +
+

A reference can point to another reference. Currently, the maximum number of redirects is 20. +A property always refers to another property. It cannot be used for a subpart of the property.

+

Example:

+
window {
+    width: var( width, 30%);
+}
+
+

If the property width is set globally (*{}) that value is used, if the property +width is not set, the default value is used.

+

Orientation

+
    +
  • Format: (horizontal|vertical)
  • +
+

Specify the orientation of the widget.

+

Cursor

+
    +
  • Format: (default|pointer|text)
  • +
+

Specify the type of mouse cursor that is set when the mouse pointer is over the widget.

+

List of keywords

+
    +
  • Format: [ keyword, keyword ]
  • +
+

A list starts with a '[' and ends with a ']'. The entries in the list are comma-separated. +The keyword in the list refers to an widget name.

+

Environment variable

+
    +
  • Format: ${:alnum:}
  • +
+

This will parse the environment variable as the property value. (that then can be any of the above types). +The environment variable should be an alphanumeric string without white-space.

+
* {
+    background-color: ${BG};
+}
+
+
    +
  • Format: env(ENVIRONMENT, default)
  • +
+

This will parse the environment variable as the property value. (that then can be any of the above types). +The environment variable should be an alphanumeric string without white-space. +If the environment value is not found, the default value is used.

+
window {
+    width: env(WIDTH, 40%);
+}
+
+

If environment WIDTH is set, then that value is parsed, otherwise the default value (40%).

+

Inherit

+
    +
  • Format: inherit
  • +
+

Inherits the property from its parent widget.

+
mainbox {
+    border-color: inherit;
+}
+
+

ELEMENTS PATHS

+

Element paths exists of two parts, the first part refers to the actual widget by name. +Some widgets have an extra state.

+

For example:

+
element selected {
+}
+
+

Here element selected is the name of the widget, selected is the state of the widget.

+

The difference between dots and spaces is purely cosmetic. These are all the same:

+
element .selected {
+
+element.selected {
+}
+element selected {
+}
+
+

SUPPORTED ELEMENT PATH

+

Name

+

The current widgets available in rofi:

+
    +
  • window
  • +
  • overlay: the overlay widget.
  • +
  • mainbox: The mainbox box.
      +
    • inputbar: The input bar box.
    • +
    • box: the horizontal @box packing the widgets
    • +
    • case-indicator: the case/sort indicator @textbox
    • +
    • prompt: the prompt @textbox
    • +
    • entry: the main entry @textbox
    • +
    • num-rows: Shows the total number of rows.
    • +
    • num-filtered-rows: Shows the total number of rows after filtering.
    • +
    • listview: The listview.
    • +
    • scrollbar: the listview scrollbar
    • +
    • element: a box in the listview holding the entries
        +
      • element-icon: the widget in the listview's entry showing the (optional) icon
      • +
      • element-index: the widget in the listview's entry keybindable index (1,2,3..0)
      • +
      • element-text: the widget in the listview's entry showing the text.
      • +
      +
    • +
    • mode-switcher: the main horizontal @box packing the buttons.
    • +
    • button: the buttons @textbox for each mode
    • +
    • message: The container holding the textbox.
    • +
    • textbox: the message textbox
    • +
    +
  • +
+

Note that these path names match the default theme. Themes that provide a custom layout will have different +elements, and structure.

+

State

+

State: State of widget

+

Optional flag(s) indicating state of the widget, used for theming.

+

These are appended after the name or class of the widget.

+

Example:

+

button selected.normal { }

+

element selected.urgent { }

+

Currently only the entrybox and scrollbar have states:

+

Entrybox:

+

{visible modifier}.{state}

+

Where visible modifier can be: + * normal: no modification + * selected: the entry is selected/highlighted by user + * alternate: the entry is at an alternating row (uneven row)

+

Where state is: + * normal: no modification + * urgent: this entry is marked urgent + * active: this entry is marked active

+

These can be mixed.

+

Example:

+
nametotextbox selected.active {
+    background-color: #003642;
+    text-color: #008ed4;
+}
+
+

Sets all selected textboxes marked active to the given text and background color. +Note that a state modifies the original element, it therefore contains all the properties of that element.

+

Scrollbar

+

The scrollbar uses the handle state when drawing the small scrollbar handle. +This allows the colors used for drawing the handle to be set independently.

+

SUPPORTED PROPERTIES

+

The following properties are currently supported:

+

all widgets:

+
    +
  • enabled: enable/disable the widget
  • +
  • padding: padding + Padding on the inside of the widget
  • +
  • margin: padding + Margin on the outside of the widget
  • +
  • border: border + Border around the widget (between padding and margin)/
  • +
  • border-radius: padding + Sets a radius on the corners of the borders.
  • +
  • background-color: color + Background color
  • +
  • background-image: image + Background image
  • +
  • border-color: color + Color of the border
  • +
  • cursor: cursor + Type of mouse cursor that is set when the mouse pointer is hovered over the widget.
  • +
+

window:

+
    +
  • +

    font: string + The font used in the window

    +
  • +
  • +

    transparency: string + Indicating if transparency should be used and what type: + real - True transparency. Only works with a compositor. + background - Take a screenshot of the background image and use that. + screenshot - Take a screenshot of the screen and use that. + Path to png file - Use an image.

    +
  • +
  • +

    location: position + The place of the anchor on the monitor

    +
  • +
  • anchor: anchor + The anchor position on the window
  • +
  • fullscreen: boolean + Window is fullscreen.
  • +
  • width: distance + The width of the window
  • +
  • x-offset: distance
  • +
  • y-offset: distance + The offset of the window to the anchor point, allowing you to push the window left/right/up/down
  • +
+

scrollbar:

+
    +
  • background-color: color
  • +
  • handle-width: distance
  • +
  • handle-color: color
  • +
  • border-color: color
  • +
+

box:

+
    +
  • orientation: orientation + Set the direction the elements are packed.
  • +
  • spacing: distance + Distance between the packed elements.
  • +
+

textbox:

+
    +
  • background-color: color
  • +
  • border-color: the color used for the border around the widget.
  • +
  • font: the font used by this textbox (string).
  • +
  • str: the string to display by this textbox (string).
  • +
  • vertical-align: Vertical alignment of the text. A number between 0 (top) and 1 (bottom).
  • +
  • horizontal-align: Horizontal alignment of the text. A number between 0 (left) and 1 (right).
  • +
  • text-color: the text color to use.
  • +
  • highlight: text style {color}. + color is optional, multiple highlight styles can be added like: bold underline italic #000000; + This option is only available on the element-text widget.
  • +
  • width: override the desired width for the textbox.
  • +
  • content: Set the displayed text (String).
  • +
  • placeholder: Set the displayed text (String) when nothing is entered.
  • +
  • placeholder-color: Color of the placeholder text.
  • +
  • blink: Enable/Disable blinking on an input textbox (Boolean).
  • +
  • markup: Force markup on, beware that only valid pango markup strings are shown.
  • +
+

listview:

+
    +
  • columns: integer + Number of columns to show (at least 1)
  • +
  • fixed-height: boolean + Always show lines rows, even if fewer elements are available.
  • +
  • dynamic: boolean + True if the size should change when filtering the list, False if it should keep the original height.
  • +
  • scrollbar: boolean + If the scrollbar should be enabled/disabled.
  • +
  • scrollbar-width: distance + Width of the scrollbar
  • +
  • cycle: boolean + When navigating, it should wrap around
  • +
  • spacing: distance + Spacing between the elements (both vertical and horizontal)
  • +
  • lines: integer + Number of rows to show in the list view.
  • +
  • layout: orientation + Indicate how elements are stacked. Horizontal implements the dmenu style.
  • +
  • reverse: boolean + Reverse the ordering (top down to bottom up).
  • +
  • fixed-columns: boolean + Do not reduce the number of columns shown when number of visible elements is not enough to fill them all.
  • +
+

Each element is a box called element. Each element can contain an element-icon and element-text.

+

listview text highlight:

+

The element-text widget in the listview is the one used to show the text. +On this widget set the highlight property (only place this property is used) to change +the style of highlighting. +The highlight property consist of the text-style property and a color.

+

To disable highlighting:

+
  element-text {
+    highlight: None;
+  }
+
+

To set to red underlined:

+
  element-text {
+    highlight: underline red;
+  }
+
+

Layout

+

The new format allows the layout of the rofi window to be tweaked extensively. +For each widget, the themer can specify padding, margin, border, font, and more. +It even allows, as an advanced feature, to pack widgets in a custom structure.

+

Basic structure

+

The whole view is made out of boxes that pack other boxes or widgets. +The box can be vertical or horizontal. This is loosely inspired by GTK.

+

The current layout of rofi is structured as follows:

+
|------------------------------------------------------------------------------------|
+| window {BOX:vertical}                                                              |
+| |-------------------------------------------------------------------------------|  |
+| | mainbox  {BOX:vertical}                                                       |  |
+| | |---------------------------------------------------------------------------| |  |
+| | | inputbar {BOX:horizontal}                                                 | |  |
+| | | |---------| |-| |---------------------------------|---| |---| |---| |---| | |  |
+| | | | prompt  | |:| | entry                           |#fr| | / | |#ns| |ci | | |  |
+| | | |---------| |_| |---------------------------------|---| |---| |---| |---| | |  |
+| | |---------------------------------------------------------------------------| |  |
+| |                                                                               |  |
+| | |---------------------------------------------------------------------------| |  |
+| | | message                                                                   | |  |
+| | | |-----------------------------------------------------------------------| | |  |
+| | | | textbox                                                               | | |  |
+| | | |-----------------------------------------------------------------------| | |  |
+| | |---------------------------------------------------------------------------| |  |
+| |                                                                               |  |
+| | |-----------------------------------------------------------------------------|  |
+| | | listview                                                                    |  |
+| | | |------------------------------------------------------------------------]  |  |
+| | | | element                                                                |  |  |
+| | | | |-----------------| |------------------------------------------------] |  |  |
+| | | | |element-icon     | |element-text                                    | |  |  |
+| | | | |-----------------| |------------------------------------------------| |  |  |
+| | | |------------------------------------------------------------------------]  |  |
+| | |-----------------------------------------------------------------------------|  |
+| |                                                                               |  |
+| | |---------------------------------------------------------------------------| |  |
+| | |  mode-switcher {BOX:horizontal}                                           | |  |
+| | | |---------------|   |---------------|  |--------------| |---------------| | |  |
+| | | | Button        |   | Button        |  | Button       | | Button        | | |  |
+| | | |---------------|   |---------------|  |--------------| |---------------| | |  |
+| | |---------------------------------------------------------------------------| |  |
+| |-------------------------------------------------------------------------------|  |
+|------------------------------------------------------------------------------------|
+
+
+
+
+
    +
  • ci is the case-indicator
  • +
  • fr is the num-filtered-rows
  • +
  • ns is the num-rows
  • +
+
+

Error message structure

+
|-----------------------------------------------------------------------------------|
+| window {BOX:vertical}                                                             |
+| |------------------------------------------------------------------------------|  |
+| | error-message {BOX:vertical}                                                 |  |
+| | |-------------------------------------------------------------------------|  |  |
+| | | textbox                                                                 |  |  |
+| | |-------------------------------------------------------------------------|  |  |
+| |------------------------------------------------------------------------------|  |
+|-----------------------------------------------------------------------------------|
+
+
+
+

Advanced layout

+

The layout of rofi can be tweaked by packing the 'fixed' widgets in a custom structure.

+

The following widgets are fixed, as they provide core rofi functionality:

+
    +
  • prompt
  • +
  • entry
  • +
  • overlay
  • +
  • case-indicator
  • +
  • message
  • +
  • listview
  • +
  • mode-switcher
  • +
  • num-rows
  • +
  • num-filtered-rows
  • +
+

The following keywords are defined and can be used to automatically pack a subset of the widgets. +These are used in the default theme as depicted in the figure above.

+
    +
  • mainbox + Packs: inputbar, message, listview, mode-switcher
  • +
  • inputbar + Packs: prompt,entry,case-indicator
  • +
+

Any widget name starting with textbox is a textbox widget, others are box widgets and can pack other widgets.

+

There are several special widgets that can be used by prefixing the name of the widget:

+

textbox

+

This is a read-only textbox widget. The displayed string can be set with content.

+

Example:

+
textbox-custom {
+  expand: false;
+  content: "My Message";
+}
+
+

Icon

+

This is an icon widget. The displayed icon can be set with filename and size with size. +If the property action is set, it acts as a button. +action can be set to a keybinding name and completes that action. (see rofi -show keys for a list).

+

If the squared property is set to false the widget height and width are not forced to be equal.

+

Example:

+
icon-paste {
+    expand: false;
+    filename: "gtk-paste";
+    size: 24;
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

button

+

This is a textbox widget that can have a 'clickable' action. +The action can be set to: +keybinding: accepts a keybinding name and completes that action. (see rofi -show keys for a list).

+
button-paste {
+    expand: false;
+    content: "My Clickable Message";
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

Children

+

To specify children, set the children +property (this always happens on the box child, see example below):

+
inputbar {
+  children: [prompt,entry,overlay,case-indicator];
+}
+
+

The theme needs to be updated to match the hierarchy specified.

+

Below is an example of a theme emulating dmenu:

+
* {
+    background-color:      Black;
+    text-color:            White;
+    border-color:          White;
+    font:            "Times New Roman 12";
+}
+
+window {
+    anchor:     north;
+    location:   north;
+    width:      100%;
+    padding:    4px;
+    children:   [ horibox ];
+}
+
+horibox {
+    orientation: horizontal;
+    children:   [ prompt, entry, listview ];
+}
+
+listview {
+    layout:     horizontal;
+    spacing:    5px;
+    lines:      10;
+}
+
+entry {
+    expand:     false;
+    width:      10em;
+}
+
+element {
+    padding: 0px 2px;
+}
+element selected {
+    background-color: SteelBlue;
+}
+
+

Padding and margin

+

Just like CSS, rofi uses the box model for each widget.

+
|-------------------------------------------------------------------|
+| margin                                                            |
+|  |-------------------------------------------------------------|  |
+|  | border                                                      |  |
+|  | |---------------------------------------------------------| |  |
+|  | | padding                                                 | |  |
+|  | | |-----------------------------------------------------| | |  |
+|  | | | content                                             | | |  |
+|  | | |-----------------------------------------------------| | |  |
+|  | |---------------------------------------------------------| |  |
+|  |-------------------------------------------------------------|  |
+|-------------------------------------------------------------------|
+
+

Explanation of the different parts:

+
    +
  • Content - The content of the widget.
  • +
  • Padding - Clears an area around the widget. + The padding shows the background color of the widget.
  • +
  • Border - A border that goes around the padding and content. + The border use the border-color of the widget.
  • +
  • Margin - Clears an area outside the border. + The margin is transparent.
  • +
+

The box model allows us to add a border around elements, and to define space between elements.

+

The size of each margin, border, and padding can be set. +For the border, a linestyle and radius can be set.

+

Spacing

+

Widgets that can pack more then one child widget (currently box and listview) have the spacing property. +This property sets the distance between the packed widgets (both horizontally and vertically).

+
|---------------------------------------|
+|  |--------| s |--------| s |-------|  |
+|  | child  | p | child  | p | child |  |
+|  |        | a |        | a |       |  |
+|  |        | c |        | c |       |  |
+|  |        | i |        | i |       |  |
+|  |        | n |        | n |       |  |
+|  |--------| g |--------| g |-------|  |
+|---------------------------------------|
+
+

Advanced box packing

+

More dynamic spacing can be achieved by adding dummy widgets, for example to make one widget centered:

+
|----------------------------------------------------|
+|  |---------------|  |--------|  |---------------|  |
+|  | dummy         |  | child  |  | dummy         |  |
+|  | expand: true; |  |        |  | expand: true; |  |
+|  |               |  |        |  |               |  |
+|  |               |  |        |  |               |  |
+|  |               |  |        |  |               |  |
+|  |---------------|  |--------|  |---------------|  |
+|----------------------------------------------------|
+
+

If both dummy widgets are set to expand, child will be centered. Depending on the expand flag of child the +remaining space will be equally divided between both dummy and child widget (expand enabled), or both dummy widgets +(expand disabled).

+

DEBUGGING

+

To get debug information from the parser, run rofi like:

+
G_MESSAGES_DEBUG=Parser rofi -show run
+
+

Syntax errors are shown in a popup and printed out to command line with the above command.

+

To see the elements queried during running, run:

+
G_MESSAGES_DEBUG=Theme rofi -show run
+
+

To test minor changes, part of the theme can be passed on the command line, for example to set it to full-screen:

+
rofi -theme-str 'window { fullscreen:true;}' -show run
+
+

To print the current theme, run:

+
rofi -dump-theme
+
+

Media support

+

Parts of the theme can be conditionally loaded, like the CSS @media option.

+
@media ( min-width: 120 ) {
+
+}
+
+

It supports the following keys as constraint:

+
    +
  • min-width: load when width is bigger or equal then value.
  • +
  • max-width: load when width is smaller then value.
  • +
  • min-height: load when height is bigger or equal then value.
  • +
  • max-height: load when height is smaller then value.
  • +
  • min-aspect-ratio load when aspect ratio is over value.
  • +
  • max-aspect-ratio: load when aspect ratio is under value.
  • +
  • monitor-id: The monitor id, see rofi -help for id's.
  • +
+

@media takes an integer number or a fraction, for integer number px can be added.

+
@media ( min-width: 120 px ) {
+
+}
+
+

Font Parsing

+

Rofi uses pango for font rendering. The font should be specified in a format that pango +understands. +This normally is the font name followed by the font size. For example:

+
mono 18
+
+

Or

+
FontAwesome 22
+
+

Multiple file handling

+

The rasi file format offers two methods of including other files. +This can be used to modify existing themes, or have multiple variations on a theme.

+
    +
  • import: Import and parse a second file.
  • +
  • theme: Discard theme, and load file as a fresh theme.
  • +
+

Syntax:

+
@import "myfile"
+@theme "mytheme"
+
+

The specified file can either by name, filename,full path.

+

If a filename is provided, it will try to resolve it in the following order:

+
    +
  • ${XDG_CONFIG_HOME}/rofi/themes/
  • +
  • ${XDG_CONFIG_HOME}/rofi/
  • +
  • ${XDG_DATA_HOME}/rofi/themes/
  • +
  • ${INSTALL PREFIX}/share/rofi/themes/
  • +
+

A name is resolved as a filename by appending the .rasi extension.

+

EXAMPLES

+

Several examples are installed together with rofi. These can be found in {datadir}/rofi/themes/, where +{datadir} is the install path of rofi data. When installed using a package manager, this is usually: /usr/share/.

+

SEE ALSO

+

rofi(1), rofi-script(5), rofi-theme-selector(1)

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.2/rofi.1/index.html b/1.7.2/rofi.1/index.html new file mode 100644 index 00000000..14e0d13f --- /dev/null +++ b/1.7.2/rofi.1/index.html @@ -0,0 +1,2710 @@ + + + + + + + + + + + + + + + + + + + + + + Rofi - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

ROFI 1 rofi

+

NAME

+

rofi - A window switcher, application launcher, ssh dialog, dmenu replacement and more

+

SYNOPSIS

+

rofi [ -show mode ]|[ -dmenu ]|[ -e msg ] [ CONFIGURATION ]

+

DESCRIPTION

+

rofi is an X11 pop-up window switcher, run dialog, dmenu replacement, and more. It focuses on +being fast to use and have minimal distraction. It supports keyboard and mouse navigation, type to +filter, tokenized search and more.

+

USAGE

+

rofi's main functionality is to assist in your workflow, allowing you to quickly switch +between windows, start applications or log into a remote machine via ssh. +There are different modi for different types of actions.

+

rofi can also function as (drop-in) replacement for dmenu(1).

+

Running rofi

+

To launch rofi directly in a certain mode, specify a mode with rofi -show <mode>. +To show the run dialog:

+
rofi -show run
+
+

Emulating dmenu

+

rofi can emulate dmenu(1) (a dynamic menu for X11) when launched with the -dmenu flag.

+

The website for dmenu can be found here.

+

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).

+

Display Error message

+

rofi error dialog can also be called from the command line.

+
rofi -e "my message"
+
+

Markup support can be enabled, see CONFIGURATION options.

+

CONFIGURATION

+

There are currently three methods of setting configuration options (evaluated in order below):

+
    +
  • System configuration file (for example /etc/rofi.rasi). + It first checks XDG_CONFIG_DIRS, and then SYSCONFDIR (that is passed at compile time). + It loads the first config file it finds, it does not merge multiple system configuration files.
  • +
  • Rasi theme file: The new theme format can be used to set configuration values.
  • +
  • Command-line options: Arguments passed to rofi.
  • +
+

To get a template config file, run: rofi -dump-config > config.rasi

+

This will contain (commented) all current configuration options, modified options are uncommented.

+

The configuration system supports the following types:

+
    +
  • string
  • +
  • integer (signed and unsigned)
  • +
  • char
  • +
  • boolean
  • +
  • lists
  • +
+

For the syntax of these options, see the rofi-theme(5) manpage.

+

For use on the command line, Boolean options have a non-default command-line +syntax. Example to enable option X:

+
-X
+
+

To disable option X:

+
-no-X
+
+

Below is a list of the most important options:

+

General

+

-help

+

The help option shows the full list of command-line options and the current set values. +These include dynamic (run-time generated) options.

+

-version

+

Show the rofi version and exit.

+

-dump-config

+

Dump the current active configuration, in rasi format, to stdout and exit. +Information about the rasi format can be found in the rofi-theme(5) manpage.

+

-dump-theme

+

Dump the current active theme, in rasi format, to stdout and exit.

+

-rasi-validate filename

+

Try to parse the file and return 0 when successful, non-zero when failed.

+

-threads num

+

Specify the number of threads rofi should use:

+
    +
  • 0: Autodetect the number of supported hardware threads.
  • +
  • 1: Disable threading
  • +
  • +

    2..n: Specify the maximum number of threads to use in the thread pool.

    +

    Default: Autodetect

    +
  • +
+

-display display

+

The X server to contact. Default is $DISPLAY.

+

-dmenu

+

Run rofi in dmenu mode. This allows for interactive scripts. +In dmenu mode, rofi reads from STDIN, and output to STDOUT. +A simple example, displaying three pre-defined options:

+
echo -e "Option #1\nOption #2\nOption #3" | rofi -dmenu
+
+

Or get the options from a script:

+
~/my_script.sh | rofi -dmenu
+
+

-show mode

+

Open rofi in a certain mode. Available modes are window, run, drun, ssh, combi. +The special argument keys can be used to open a searchable list of supported key bindings +(see KEY BINDINGS)

+

To show the run-dialog:

+
rofi -show run
+
+

If -show is the last option passed to rofi, the first enabled modi is shown.

+

-modi mode1,mode2

+

Specify an ordered, comma-separated list of modes to enable. +Enabled modes can be changed at runtime. Default key is Ctrl+Tab. +If no modes are specified, all configured modes will be enabled. +To only show the run and ssh launcher:

+
rofi -modi "run,ssh" -show run
+
+

Custom modes can be added using the internal script mode. Each such mode has two parameters:

+
<name>:<script>
+
+

Example: Have a mode called 'Workspaces' using the i3_switch_workspaces.sh script:

+
rofi -modi "window,run,ssh,Workspaces:i3_switch_workspaces.sh" -show Workspaces
+
+

Notes: The i3 window manager dislikes commas in the command when specifying an exec command. +For that case, # can be used as a separator.

+

TIP: The name is allowed to contain spaces:

+
rofi -modi "My File Browser:fb.sh" -show "My File Browser"
+
+

-case-sensitive

+

Start in case-sensitive mode. +This option can be changed at run-time using the -kb-toggle-case-sensitivity key binding.

+

-cycle

+

Cycle through the result list. Default is 'true'.

+

-filter filter

+

Filter the list by setting text in input bar to filter

+

-config filename

+

Load an alternative configuration file.

+

-cache-dir filename

+

Directory that is used to place temporary files, like history.

+

-scroll-method method

+

Select the scrolling method. 0: Per page, 1: continuous.

+

-normalize-match

+

Normalize the string before matching, so o will match ö, and é matches e.
+This is not a perfect implementation, but works. For now, it disables highlighting of the matched part.

+

-no-lazy-grab

+

Disables lazy grab, this forces the keyboard being grabbed before gui is shown.

+

-no-plugins

+

Disable plugin loading.

+

-plugin-path directory

+

Specify the directory where rofi should look for plugins.

+

-show-icons

+

Show application icons in drun and window modes.

+

-icon-theme

+

Specify icon theme to be used. +If not specified default theme from DE is used, Adwaita and gnome themes act as +fallback themes.

+

-application-fallback-icon

+

Specify an icon to be used when the application icon in run/drun are not yet loaded or is not available.

+

-markup

+

Use Pango markup to format output wherever possible.

+

-normal-window

+

Make rofi react like a normal application window. Useful for scripts like Clerk that are basically an application.

+

-[no-]steal-focus

+

Make rofi steal focus on launch and restore close to window that held it when launched.

+

Matching

+

-matching method

+

Specify the matching algorithm used. +Currently, the following methods are supported:

+
    +
  • normal: match the int string
  • +
  • regex: match a regex input
  • +
  • glob: match a glob pattern
  • +
  • fuzzy: do a fuzzy match
  • +
  • prefix: match prefix
  • +
+

Default: normal

+

Note: glob matching might be slow for larger lists

+

-tokenize

+

Tokenize the input.

+

-drun-categories category1,category2

+

Only show desktop files that are present in the listed categories.

+

-drun-match-fields field1,field2,...

+

When using drun, match only with the specified Desktop entry fields. +The different fields are:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
  • +

    all: all the above

    +

    Default: name,generic,exec,categories,keywords

    +
  • +
+

-drun-display-format

+

The format string for the drun dialog:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
+

Pango markup can be used to formatting the output.

+
Default: {name} [<span weight='light' size='small'><i>({generic})</i></span>]
+
+

Note: Only fields enabled in -drun-match-fields can be used in the format string.

+

-[no-]drun-show-actions

+

Show actions present in the Desktop files.

+
Default: false
+
+

-window-match-fields field1,field2,...

+

When using window mode, match only with the specified fields. +The different fields are:

+
    +
  • title: window's title
  • +
  • class: window's class
  • +
  • role: window's role
  • +
  • name: window's name
  • +
  • desktop: window's current desktop
  • +
  • +

    all: all the above

    +

    Default: all

    +
  • +
+

-matching-negate-char char

+

Set the character used to negate the query (i.e. if it does not match the next keyword). +Set to '\x0' to disable.

+
Default: '-'
+
+

Layout and Theming

+

IMPORTANT: + In newer rofi releases, all the theming options have been moved into the new theme format. They are no longer normal + rofi options that can be passed directly on the command line (there are too many). + Small snippets can be passed on the command line: rofi -theme-str 'window {width: 50%;}' to override a single + setting. They are merged into the current theme. + They can also be appended at the end of the rofi config file to override parts of the theme.

+

Most of the following options are deprecated and should not be used. Please use the new theme format to customize +rofi. More information about the new format can be found in the rofi-theme(5) manpage.

+

-location

+

Specify where the window should be located. The numbers map to the following locations on screen:

+
  1 2 3
+  8 0 4
+  7 6 5
+
+

Default: 0

+

-fixed-num-lines

+

Keep a fixed number of visible lines.

+

-sidebar-mode

+

Open in sidebar-mode. In this mode, a list of all enabled modes is shown at the bottom. +(See -modi option) +To show sidebar, use:

+
rofi -show run -sidebar-mode
+
+

-hover-select

+

Automatically select the entry the mouse is hovering over. This option is best combined with custom mouse bindings. +To utilize hover-select and accept an entry in a single click, use:

+
rofi -show run -hover-select -me-select-entry '' -me-accept-entry MousePrimary
+
+

-eh number

+

Set row height (in chars) +Default: 1

+

-auto-select

+

When one entry is left, automatically select it.

+

-m num

+

-m name

+

-monitor num

+

-monitor name

+

Select monitor to display rofi on. +It accepts as input: primary (if primary output is set), the xrandr output name, or integer number (in order of +detection). Negative numbers are handled differently:

+
    +
  • -1: the currently focused monitor.
  • +
  • -2: the currently focused window (that is, rofi will be displayed on top of the focused window).
  • +
  • -3: Position of mouse (overrides the location setting to get normal context menu + behavior.)
  • +
  • -4: the monitor with the focused window.
  • +
  • +

    -5: the monitor that shows the mouse pointer.

    +

    Default: -5

    +
  • +
+

See rofi -h output for the detected monitors, their position, and size.

+

-theme filename

+

Path to the new theme file format. This overrides the old theme settings.

+

-theme-str string

+

Allow theme parts to be specified on the command line as an override.

+

For example:

+
rofi -theme-str '#window { fullscreen: true; }'
+
+

This option can be specified multiple times. +This is now the method to tweak the theme via the command line.

+

-dpi number

+

Override the default DPI setting.

+
    +
  • If set to 0, it tries to auto-detect based on X11 screen size (similar to i3 and GTK).
  • +
  • If set to 1, it tries to auto-detect based on the size of the monitor that rofi is displayed on (similar to latest Qt 5).
  • +
+

-selected-row selected row

+

Select a certain row.

+

Default: 0

+

PATTERN setting

+

-terminal

+

Specify which terminal to start.

+
rofi -terminal xterm
+
+

Pattern: {terminal}

+

Default: x-terminal-emulator

+

-ssh-client client

+

Override the used ssh client.

+

Pattern: {ssh-client}

+

Default: ssh

+

SSH settings

+

-ssh-command cmd

+

Set the command to execute when starting an ssh session. +The pattern {host} is replaced by the selected ssh entry.

+

Pattern: {ssh-client}

+

Default: {terminal} -e {ssh-client} {host}

+

-parse-hosts

+

Parse the /etc/hosts file for entries.

+

Default: disabled

+

-parse-known-hosts +-no-parse-known-hosts

+

Parse the ~/.ssh/known_hosts file for entries.

+

Default: enabled

+

Run settings

+

-run-command cmd

+

Set command ({cmd}) to execute when running an application. +See PATTERN.

+

Default: {cmd}

+

-run-shell-command cmd

+

Set command to execute when running an application in a shell. +See PATTERN.

+

Default: {terminal} -e {cmd}

+

-run-list-command cmd

+

If set, use an external tool to generate a list of executable commands. Uses run-command.

+

Default: {cmd}

+

Window switcher settings

+

-window-format format

+

Format what is being displayed for windows.

+

format: {field[:len]}

+

field:

+
    +
  • w: desktop name
  • +
  • t: title of window
  • +
  • n: name
  • +
  • r: role
  • +
  • c: class
  • +
+

len: maximum field length (0 for auto-size). If length and window width are negative, field length is width - len.
+If length is positive, the entry will be truncated or padded to fill that length.

+

default: {w} {c} {t}

+

-window-command cmd

+

Set command to execute on selected window for an alt action (-kb-accept-alt). +See PATTERN.

+

Default: "wmctrl -i -R {window}"

+

-window-thumbnail

+

Show window thumbnail (if available) as icon in the window switcher.

+

You can stop rofi from exiting when closing a window (allowing multiple to be closed in a row).

+
configuration {
+  window {
+      close-on-delete: false;
+  }
+}
+
+

Combi settings

+

-combi-modi mode1,mode2

+

The modi to combine in combi mode. +For syntax to -combi-modi, see -modi. +To get one merge view, of window,run, and ssh:

+
rofi -show combi -combi-modi "window,run,ssh" -modi combi
+
+

NOTE: The i3 window manager dislikes commas in the command when specifying an exec command. +For that case, # can be used as a separator.

+

History and Sorting

+

-disable-history +-no-disable-history (re-enable history)

+

Disable history

+

-sort to enable +-no-sort to disable

+

Enable, disable sorting. +This setting can be changed at runtime (see -kb-toggle-sort).

+

-sorting-method 'method' to specify the sorting method.

+

There are 2 sorting methods:

+
    +
  • levenshtein (Default)
  • +
  • fzf sorting.
  • +
+

-max-history-size number

+

Maximum number of entries to store in history. Defaults to 25. (WARNING: can cause slowdowns when set too high)

+

Dmenu specific

+

-sep separator

+

Separator for dmenu. Example: To show a list of 'a' to 'e' with '|' as a separator:

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
+
+

-p prompt

+

Specify the prompt to show in dmenu mode. For example, select 'monkey', a,b,c,d, or e.

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey"
+
+

Default: dmenu

+

-l number of lines to show

+

Maximum number of lines the menu may show before scrolling.

+
rofi -dmenu -l 25
+
+

Default: 15

+

-i

+

Makes dmenu searches case-insensitive

+

-a X

+

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:

+
    +
  • 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'
  • +
+

-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

+

Allows the output of dmenu to be customized (N is the total number of input entries):

+
    +
  • '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)
  • +
+

Default: 's'

+

-select string

+

Select first line that matches the given string

+

-mesg string

+

Add a message line below the filter entry box. Supports Pango markup. +For more information on supported markup, see here

+

-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. +See here for details about Pango markup.

+

-multi-select

+

Allow multiple lines to be selected. Adds a small selection indicator to the left of each entry.

+

-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-match or -auto-select.

+

-async-pre-read number

+

Reads the first number entries blocking, then switches to async mode. +This makes it feel more 'snappy'.

+

default: 25

+

-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.

+

Message dialog

+

-e message

+

Pops up a message dialog (used internally for showing errors) with message. +Message can be multi-line.

+

File browser settings

+

File browser behavior can be controlled via the following options:

+
configuration {
+   filebrowser {
+      /** Directory the file browser starts in. */
+      directory: "/some/directory";
+      /**
+        * Sorting method. Can be set to:
+        *   - "name"
+        *   - "mtime" (modification time)
+        *   - "atime" (access time)
+        *   - "ctime" (change time)
+        */
+      sorting-method: "name";
+      /** Group directories before files. */
+      directories-first: true;
+   }
+}
+
+

Other

+

-drun-use-desktop-cache

+

Build and use a cache with the content of desktop files. Usable for systems with slow hard drives.

+

-drun-reload-desktop-cache

+

If drun-use-desktop-cache is enabled, rebuild a cache with the content of desktop files.

+

-drun-url-launcher command

+

Command to open a Desktop Entry that is a Link.

+

-pid path

+

Make rofi create a pid file and check this on startup. The pid file prevents multiple rofi instances from running simultaneously. This is useful when running rofi from a key-binding daemon.

+

-display-{mode} string

+

Set the name to use for mode. This is used as prompt and in combi-browser.

+

It is now preferred to use the configuration file:

+
configuration {
+  {mode} {
+    display-name: *string*;
+  }
+}
+
+

-click-to-exit +-no-click-to-exit

+

Click the mouse outside the rofi window to exit.

+

Default: enabled

+

PATTERN

+

To launch commands (for example, when using the ssh launcher), the user can enter the used command-line. The following keys can be used that will be replaced at runtime:

+
    +
  • {host}: the host to connect to
  • +
  • {terminal}: the configured terminal (see -terminal-emulator)
  • +
  • {ssh-client}: the configured ssh client (see -ssh-client)
  • +
  • {cmd}: the command to execute
  • +
  • {window}: the window ID of the selected window (in window-command)
  • +
+

DMENU REPLACEMENT

+

If argv[0] (calling command) is dmenu, rofi will start in dmenu mode. +This way, it can be used as a drop-in replacement for dmenu. Just copy or symlink rofi to dmenu in $PATH.

+
ln -s /usr/bin/rofi /usr/bin/dmenu
+
+

THEMING

+

Please see rofi-theme(5) manpage for more information on theming.

+

KEY BINDINGS

+

rofi has the following key bindings:

+
    +
  • Control-v, Insert: Paste from clipboard
  • +
  • Control-Shift-v, Shift-Insert: Paste primary selection
  • +
  • Control-u: Clear the line
  • +
  • Control-a: Beginning of line
  • +
  • Control-e: End of line
  • +
  • Control-f, Right: Forward one character
  • +
  • Alt-f, Control-Right: Forward one word
  • +
  • Control-b, Left: Back one character
  • +
  • Alt-b, Control-Left: Back one word
  • +
  • Control-d, Delete: Delete character
  • +
  • Control-Alt-d: Delete word
  • +
  • Control-h, Backspace, Shift-Backspace: Backspace (delete previous character)
  • +
  • Control-Alt-h: Delete previous word
  • +
  • Control-j,Control-m,Enter: Accept entry
  • +
  • Control-n,Down: Select next entry
  • +
  • Control-p,Up: Select previous entry
  • +
  • Page Up: Go to previous page
  • +
  • Page Down: Go to next page
  • +
  • Control-Page Up: Go to previous column
  • +
  • Control-Page Down: Go to next column
  • +
  • Control-Enter: Use entered text as a command (in ssh/run modi)
  • +
  • Shift-Enter: Launch the application in a terminal (in run mode)
  • +
  • Control-Shift-Enter: As Control-Enter and run the command in terminal (in run mode)
  • +
  • Shift-Enter: Return the selected entry and move to the next item while keeping rofi open. (in dmenu)
  • +
  • Shift-Right: Switch to the next mode. The list can be customized with the -modi argument.
  • +
  • Shift-Left: Switch to the previous mode. The list can be customized with the -modi argument.
  • +
  • Control-Tab: Switch to the next mode. The list can be customized with the -modi argument.
  • +
  • Control-Shift-Tab: Switch to the previous mode. The list can be customized with the -modi argument.
  • +
  • Control-space: Set selected item as input text.
  • +
  • Shift-Del: Delete entry from history.
  • +
  • grave: Toggle case sensitivity.
  • +
  • Alt-grave: Toggle sorting.
  • +
  • Alt-Shift-S: Take a screenshot and store it in the Pictures directory.
  • +
  • Control-l: File complete for run dialog.
  • +
+

This list might not be complete, to get a full list of all key bindings +supported in your rofi, see rofi -h. The options starting with -kb are keybindings.

+

Key bindings can be modified using the configuration systems. Multiple keys can be bound +to one action by comma separating them. For example -kb-primary-paste "Conctrol+v,Insert"

+

To get a searchable list of key bindings, run rofi -show keys.

+

A key binding starting with ! will act when all keys have been released.

+

You can bind certain events to key-actions:

+

Timeout

+

You can configure an action to be taken when rofi has not been interacted +with for a certain amount of seconds. You can specify a keybinding to trigger +after X seconds.

+
configuration {
+  timeout {
+      delay:  15;
+      action: "kb-cancel";
+  }
+}
+
+

Input change

+

When the input of the textbox changes:

+
configuration {
+  inputchange {
+      action: "kb-row-first";
+  }
+}
+
+

Available Modi

+

window

+

Show a list of all the windows and allow switching between them. +Pressing the delete-entry binding (shift-delete) will close the window. +Pressing the accept-custom binding (control-enter or shift-enter) will run a command on the window. +(See option window-command );

+

If there is no match, it will try to launch the input.

+

windowcd

+

Shows a list of the windows on the current desktop and allows switching between them. +Pressing the delete-entry binding (shift-delete) will kill the window. +Pressing the accept-custom binding (control-enter or shift-enter) will run a command on the window. +(See option window-command );

+

If there is no match, it will try to launch the input.

+

run

+

Shows a list of executables in $PATH and can launch them (optional in a terminal). +Pressing the delete-entry binding (shift-delete) will remove this entry from the run history. +Pressing the accept-custom binding (control-enter) will run the command as entered in the entry box. +Pressing the accept-alt binding (shift-enter) will run the command in a terminal.

+

When pressing the mode-complete binding (Control-l), you can use the File Browser mode to launch the application +with a file as the first argument.

+

drun

+

Same as the run launches, but the list is created from the installed desktop files. It automatically launches them +in a terminal if specified in the Desktop File. +Pressing the delete-entry binding (shift-delete) will remove this entry from the run history. +Pressing the accept-custom binding (control-enter) will run the command as entered in the entry box. +Pressing the accept-alt binding (shift-enter) will run the command in a terminal.

+

When pressing the mode-complete binding (Control-l), you can use the File Browser mode to launch the application +passing a file as argument if specified in the desktop file.

+

The DRUN mode tries to follow the XDG Desktop Entry +Specification and should be compatible with +applications using this standard. Some applications create invalid desktop files, rofi will discard these entries. +See the debugging section for more info on DRUN mode, this will print why desktop files are +discarded.

+

There are two advanced options to tweak the behaviour:

+
configuration {
+   drun {
+      /** Parse user desktop files. */
+      parse-user:   true;
+      /** Parse system desktop files. */
+      parse-system: false;
+   }
+}
+
+

ssh

+

Shows a list of SSH targets based on your ssh config file, and allows to quickly ssh into them.

+

keys

+

Shows a searchable list of key bindings.

+

script

+

Allows custom scripted Modi to be added, see the rofi-script(5) manpage for more information.

+

combi

+

Combines multiple modi in one list. Specify which modi are included with the -combi-modi option.

+

When using the combi mode, a !bang can be used to filter the results by modi. +All modi that match the bang as a prefix are included. +For example, say you have specified -combi-modi run,window,windowcd. If your +query begins with the bang !w, only results from the window and windowcd +modi are shown, even if the rest of the input text would match results from run.

+

If no match, the input is handled by the first combined modi.

+

FAQ

+

The text in the window switcher is not nicely aligned.

+

Try using a mono-space font.

+

The window is completely black.

+

Check quotes used on the command-line: you might have used ("smart quotes") instead of " ("machine quotes").

+

What does the icon in the top right show?

+

The indicator shows:

+
` ` Case insensitive and no sorting.
+`-` Case sensitivity enabled, no sorting.
+`+` Case insensitive and Sorting enabled
+`±` Sorting and Case sensitivity enabled"
+
+

EXAMPLES

+

Some basic usage examples of rofi:

+

Show the run dialog:

+
rofi -modi run -show run
+
+

Show the run dialog, and allow switching to Desktop File run dialog (drun):

+
rofi -modi run,drun -show run
+
+

Combine the run and Desktop File run dialog (drun):

+
rofi -modi combi -show combi -combi-modi run,drun
+
+

Combine the run and Desktop File run dialog (drun), and allow switching to window switcher:

+
rofi -modi combi,window -show combi -combi-modi run,drun
+
+

Pop up a text message claiming that this is the end:

+
rofi -e "This is the end"
+
+

Pop up a text message in red, bold font claiming that this is still the end:

+
rofi -e "<span color='red'><b>This is still the end</b></span>" -markup
+
+

Show all key bindings:

+
rofi -show keys
+
+

Use qalc to get a simple calculator in rofi:

+
 rofi -show calc -modi "calc:qalc +u8 -nocurrencies"
+
+

i3

+

In i3 you want to bind rofi to be launched on key release. Otherwise, it cannot grab the keyboard. +See also the i3 manual:

+

Some tools (such as import or xdotool) might be unable to run upon a KeyPress event, because the keyboard/pointer is +still grabbed. For these situations, the --release flag can be used, as it will execute the command after the keys have +been released.

+

LICENSE

+
MIT/X11
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+

WEBSITE

+

rofi website can be found here

+

SUPPORT

+

rofi support can be obtained: + * GitHub Discussions + * Forum (Reddit) + * IRC (#rofi on irc.libera.chat),

+

DEBUGGING

+

To debug, it is smart to first try disabling your custom configuration: +-no-config

+

Disable parsing of configuration. This runs rofi in stock mode.

+

If you run custom C plugins, you can disable them using:

+

-no-plugins

+

Disables the loading of plugins.

+

To further debug the plugin, you can get a trace with (lots of) debug information. This debug output can be enabled for +multiple parts in rofi using the glib debug framework. Debug domains can be enabled by setting the G_MESSAGES_DEBUG +environment variable. At the time of creation of this page, the following debug domains exist:

+
    +
  • all: Show debug information from all domains.
  • +
  • X11Helper: The X11 Helper functions.
  • +
  • View: The main window view functions.
  • +
  • Widgets.Box: The Box widget.
  • +
  • Dialogs.DMenu: The dmenu mode.
  • +
  • Dialogs.Run: The run mode.
  • +
  • Dialogs.DRun: The desktop file run mode.
  • +
  • Dialogs.Window: The window mode.
  • +
  • Dialogs.Script: The script mode.
  • +
  • Dialogs.Combi: The script mode.
  • +
  • Dialogs.Ssh: The ssh mode.
  • +
  • Rofi: The main application.
  • +
  • Timings: Get timing output.
  • +
  • Theme: Theme engine debug output. (warning lots of output).
  • +
  • Widgets.Icon: The Icon widget.
  • +
  • Widgets.Box: The box widget.
  • +
  • Widgets.Container: The container widget.
  • +
  • Widgets.Window: The window widget.
  • +
  • Helpers.IconFetcher: Information about icon lookup.
  • +
+

The output of this can provide useful information when writing an issue.

+

More information (possibly outdated) see this wiki entry.

+

ISSUE TRACKER

+

The rofi issue tracker can be found here

+

When creating an issue, please read this +first.

+

SEE ALSO

+

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

+

AUTHOR

+ +

Original code based on work by: Sean Pringle sean.pringle@gmail.com

+

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

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.3/rofi-debugging.5/index.html b/1.7.3/rofi-debugging.5/index.html new file mode 100644 index 00000000..141252f8 --- /dev/null +++ b/1.7.3/rofi-debugging.5/index.html @@ -0,0 +1,1430 @@ + + + + + + + + + + + + + + + + + + + + + + Debugging - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI DEBUGGING 5 rofi debugging

+

NAME

+

Debugging rofi.

+

When reporting an issue with rofi crashing, or misbehaving. It helps to do some small test +to help pin-point the problem.

+

First try disabling your custom configuration: -no-config

+

This disables the parsing of the configuration files. This runs rofi in stock mode.

+

If you run custom C plugins, you can disable the plugins using: -no-plugins

+

Get the relevant information for an issue

+

Please pastebin the output of the following commands:

+
rofi -help
+rofi -dump-config
+rofi -dump-theme
+
+

rofi -help provides us with the configuration files parsed, the exact version, monitor layout +and more useful information.

+

The rofi -dump-config and rofi -dump-theme output gives us rofi +interpretation of your configuration and theme.

+

Please check the output for identifiable information and remove this.

+

Timing traces

+

To get a timing trace, enable the Timings debug domain.

+
G_MESSAGES_DEBUG=Timings rofi -show drun
+
+

It will show a trace with (useful) timing information at relevant points during the execution. +This will help debugging when rofi is slow to start.

+

Example trace:

+
(process:14942): Timings-DEBUG: 13:47:39.335: 0.000000 (0.000000): Started
+(process:14942): Timings-DEBUG: 13:47:39.335: 0.000126 (0.000126): ../source/rofi.c:main:786 
+(process:14942): Timings-DEBUG: 13:47:39.335: 0.000163 (0.000037): ../source/rofi.c:main:819 
+(process:14942): Timings-DEBUG: 13:47:39.336: 0.000219 (0.000056): ../source/rofi.c:main:826 Setup Locale
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001235 (0.001016): ../source/rofi.c:main:828 Collect MODI
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001264 (0.000029): ../source/rofi.c:main:830 Setup MODI
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001283 (0.000019): ../source/rofi.c:main:834 Setup mainloop
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001369 (0.000086): ../source/rofi.c:main:837 NK Bindings
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001512 (0.000143): ../source/xcb.c:display_setup:1177 Open Display
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001829 (0.000317): ../source/xcb.c:display_setup:1192 Setup XCB
+(process:14942): Timings-DEBUG: 13:47:39.346: 0.010650 (0.008821): ../source/rofi.c:main:844 Setup Display
+(process:14942): Timings-DEBUG: 13:47:39.346: 0.010715 (0.000065): ../source/rofi.c:main:848 Setup abe
+(process:14942): Timings-DEBUG: 13:47:39.350: 0.015101 (0.004386): ../source/rofi.c:main:883 Load cmd config 
+(process:14942): Timings-DEBUG: 13:47:39.351: 0.015275 (0.000174): ../source/rofi.c:main:907 Setup Modi
+(process:14942): Timings-DEBUG: 13:47:39.351: 0.015291 (0.000016): ../source/view.c:rofi_view_workers_initialize:1922 Setup Threadpool, start
+(process:14942): Timings-DEBUG: 13:47:39.351: 0.015349 (0.000058): ../source/view.c:rofi_view_workers_initialize:1945 Setup Threadpool, done
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032018 (0.016669): ../source/rofi.c:main:1000 Setup late Display
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032080 (0.000062): ../source/rofi.c:main:1003 Theme setup
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032109 (0.000029): ../source/rofi.c:startup:668 Startup
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032121 (0.000012): ../source/rofi.c:startup:677 Grab keyboard
+(process:14942): Timings-DEBUG: 13:47:39.368: 0.032214 (0.000093): ../source/view.c:__create_window:701 xcb create window
+(process:14942): Timings-DEBUG: 13:47:39.368: 0.032235 (0.000021): ../source/view.c:__create_window:705 xcb create gc
+(process:14942): Timings-DEBUG: 13:47:39.368: 0.033136 (0.000901): ../source/view.c:__create_window:714 create cairo surface
+(process:14942): Timings-DEBUG: 13:47:39.369: 0.033286 (0.000150): ../source/view.c:__create_window:723 pango cairo font setup
+(process:14942): Timings-DEBUG: 13:47:39.369: 0.033351 (0.000065): ../source/view.c:__create_window:761 configure font
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045896 (0.012545): ../source/view.c:__create_window:769 textbox setup
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045944 (0.000048): ../source/view.c:__create_window:781 setup window attributes
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045955 (0.000011): ../source/view.c:__create_window:791 setup window fullscreen
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045966 (0.000011): ../source/view.c:__create_window:797 setup window name and class
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045974 (0.000008): ../source/view.c:__create_window:808 setup startup notification
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045981 (0.000007): ../source/view.c:__create_window:810 done
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045992 (0.000011): ../source/rofi.c:startup:679 Create Window
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045999 (0.000007): ../source/rofi.c:startup:681 Parse ABE
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.046113 (0.000114): ../source/rofi.c:startup:684 Config sanity check
+(process:14942): Timings-DEBUG: 13:47:39.384: 0.048229 (0.002116): ../source/dialogs/run.c:get_apps:216 start
+(process:14942): Timings-DEBUG: 13:47:39.390: 0.054626 (0.006397): ../source/dialogs/run.c:get_apps:336 stop
+(process:14942): Timings-DEBUG: 13:47:39.390: 0.054781 (0.000155): ../source/dialogs/drun.c:get_apps:634 Get Desktop apps (start)
+(process:14942): Timings-DEBUG: 13:47:39.391: 0.055264 (0.000483): ../source/dialogs/drun.c:get_apps:641 Get Desktop apps (user dir)
+(process:14942): Timings-DEBUG: 13:47:39.418: 0.082884 (0.027620): ../source/dialogs/drun.c:get_apps:659 Get Desktop apps (system dirs)
+(process:14942): Timings-DEBUG: 13:47:39.418: 0.082944 (0.000060): ../source/dialogs/drun.c:get_apps_history:597 Start drun history
+(process:14942): Timings-DEBUG: 13:47:39.418: 0.082977 (0.000033): ../source/dialogs/drun.c:get_apps_history:617 Stop drun history
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083638 (0.000661): ../source/dialogs/drun.c:get_apps:664 Sorting done.
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083685 (0.000047): ../source/view.c:rofi_view_create:1759 
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083700 (0.000015): ../source/view.c:rofi_view_create:1783 Startup notification
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083711 (0.000011): ../source/view.c:rofi_view_create:1786 Get active monitor
+(process:14942): Timings-DEBUG: 13:47:39.420: 0.084693 (0.000982): ../source/view.c:rofi_view_refilter:1028 Filter start
+(process:14942): Timings-DEBUG: 13:47:39.421: 0.085992 (0.001299): ../source/view.c:rofi_view_refilter:1132 Filter done
+(process:14942): Timings-DEBUG: 13:47:39.421: 0.086090 (0.000098): ../source/view.c:rofi_view_update:982 
+(process:14942): Timings-DEBUG: 13:47:39.421: 0.086123 (0.000033): ../source/view.c:rofi_view_update:1002 Background
+(process:14942): Timings-DEBUG: 13:47:39.428: 0.092864 (0.006741): ../source/view.c:rofi_view_update:1008 widgets
+
+

Debug domains

+

To further debug the plugin, you can get a trace with (lots of) debug information. This debug output can be enabled for +multiple parts in rofi using the glib debug framework. Debug domains can be enabled by setting the G_MESSAGES_DEBUG +environment variable. At the time of creation of this page, the following debug domains exist:

+
    +
  • all: Show debug information from all domains.
  • +
  • X11Helper: The X11 Helper functions.
  • +
  • View: The main window view functions.
  • +
  • Widgets.Box: The Box widget.
  • +
  • Modes.DMenu: The dmenu mode.
  • +
  • Modes.Run: The run mode.
  • +
  • Modes.DRun: The desktop file run mode.
  • +
  • Modes.Window: The window mode.
  • +
  • Modes.Script: The script mode.
  • +
  • Modes.Combi: The script mode.
  • +
  • Modes.Ssh: The ssh mode.
  • +
  • Rofi: The main application.
  • +
  • Timings: Get timing output.
  • +
  • Theme: Theme engine debug output. (warning lots of output).
  • +
  • Widgets.Icon: The Icon widget.
  • +
  • Widgets.Box: The box widget.
  • +
  • Widgets.Container: The container widget.
  • +
  • Widgets.Window: The window widget.
  • +
  • Helpers.IconFetcher: Information about icon lookup.
  • +
+

For full list see man rofi.

+

Example: G_MESSAGES_DEBUG=Dialogs.DRun rofi -show drun To get specific output from the Desktop file run dialog.

+

To redirect the debug output to a file (~/rofi.log) add:

+
rofi -show drun -log ~/rofi.log
+
+

Specifying the logfile automatically enabled all log domains. +This can be useful when rofi is launched from a window manager.

+

Creating a backtrace.

+

First make sure you compile rofi with debug symbols:

+
make CFLAGS="-O0 -g3" clean rofi
+
+

Getting a backtrace using GDB is not very handy. Because if rofi get stuck, it grabs keyboard and +mouse. So if it crashes in GDB you are stuck. +The best way to go is to enable core file. (ulimit -c unlimited in bash) then make rofi crash. You +can then load the core in GDB.

+
gdb rofi core
+
+

Then type inside gdb:

+
thread apply all bt
+
+

The output trace is useful when reporting crashes.

+

Some distribution have systemd-coredump, this way you can easily get a backtrace via coredumpctl.

+

SEE ALSO

+

rofi-sensible-terminal(1), dmenu(1), rofi-debugging(5), rofi-theme(5), rofi-script(5), rofi-keys(5),rofi-theme-selector(1)

+

AUTHOR

+ + + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.3/rofi-dmenu.5/index.html b/1.7.3/rofi-dmenu.5/index.html new file mode 100644 index 00000000..d4abdf4f --- /dev/null +++ b/1.7.3/rofi-dmenu.5/index.html @@ -0,0 +1,1502 @@ + + + + + + + + + + + + + + + + + + + + + + Dmenu - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

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.

+

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).

+

BASIC CONCEPT

+

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.

+

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.

+

USAGE

+

By launching rofi with the -dmenu flag it will go into dmenu emulation mode.

+
ls | rofi -dmenu
+
+

DMENU DROP-IN REPLACEMENT

+

If argv[0] (calling command) is dmenu, rofi will start in dmenu mode. +This way, it can be used as a drop-in replacement for dmenu. Just copy or symlink rofi to dmenu in $PATH.

+
ln -s /usr/bin/rofi /usr/bin/dmenu
+
+

DMENU VS SCRIPT MODE

+

Script mode is used to extend rofi, dmenu mode is used to extend a script. +The two do share much of the same input format. Please see the rofi-script(5) manpage for more information.

+

DMENU SPECIFIC COMMANDLINE FLAGS

+

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.

+

-sep separator

+

Separator for dmenu. Example: To show a list of 'a' to 'e' with '|' as a separator:

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
+
+

-p prompt

+

Specify the prompt to show in dmenu mode. For example, select 'monkey', a,b,c,d, or e.

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey"
+
+

Default: dmenu

+

-l number of lines to show

+

Maximum number of lines the menu may show before scrolling.

+
rofi -dmenu -l 25
+
+

Default: 15

+

-i

+

Makes dmenu searches case-insensitive

+

-a X

+

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:

+
    +
  • 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'
  • +
+

-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

+

Allows the output of dmenu to be customized (N is the total number of input entries):

+
    +
  • '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)
  • +
+

Default: 's'

+

-select string

+

Select first line that matches the given string

+

-mesg string

+

Add a message line below the filter entry box. Supports Pango markup. +For more information on supported markup, see here

+

-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. +See here for details about Pango markup.

+

-multi-select

+

Allow multiple lines to be selected. Adds a small selection indicator to the left of each entry.

+

-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-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.

+

-display-columns

+

A comma seperated list of columns to show.

+

-display-column-separator

+

The column separator. This is a regex.

+

default: '\t'

+

-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.

+

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.

+

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)

+

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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.3/rofi-keys.5/index.html b/1.7.3/rofi-keys.5/index.html new file mode 100644 index 00000000..548afc55 --- /dev/null +++ b/1.7.3/rofi-keys.5/index.html @@ -0,0 +1,2694 @@ + + + + + + + + + + + + + + + + + + + + + + Keys - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-KEYS 5 rofi-keys

+

NAME

+

rofi keys - Rofi Key and Mouse bindings

+

DESCRIPTION

+

rofi supports overriding of any of it key and mouse binding.

+

Setting binding

+

Bindings can be done on the commandline (-{bindingname}):

+
rofi -show run -kb-accept-entry 'Control+Shift+space'
+
+

or via the configuration file:

+
configuration {
+  kb-accept-entry: "Control+Shift+space";
+}
+
+

The key can be set by its name (see above) or its keycode:

+
configuration {
+  kb-accept-entry: "Control+Shift+[65]";
+}
+
+

An easy way to look up keycode is xev(1).

+

Multiple keys can be specified for an action as a comma separated list:

+
configuration {
+  kb-accept-entry: "Control+Shift+space,Return";
+}
+
+

By Default rofi reacts on pressing, to act on the release of all keys +prepend the binding with !:

+
configuration {
+  kb-accept-entry: "!Control+Shift+space,Return";
+}
+
+

Unsetting a binding

+

To unset a binding, pass an empty string.

+
configuration {
+  kb-clear-line: "";
+}
+
+

Keyboard Bindings

+

kb-primary-paste:

+

Paste primary selection

+

Default: Control+V,Shift+Insert

+

kb-secondary-paste

+

Paste clipboard

+

Default: Control+v,Insert

+

kb-secondary-copy

+

Copy current selection to clipboard

+

Default: Control+c

+

kb-clear-line

+

Clear input line

+

Default: Control+w

+

kb-move-front

+

Beginning of line

+

Default: Control+a

+

kb-move-end

+

End of line

+

Default: Control+e

+

kb-move-word-back

+

Move back one word

+

Default: Alt+b,Control+Left

+

kb-move-word-forward

+

Move forward one word

+

Default: Alt+f,Control+Right

+

kb-move-char-back

+

Move back one char

+

Default: Left,Control+b

+

kb-move-char-forward

+

Move forward one char

+

Default: Right,Control+f

+

kb-remove-word-back

+

Delete previous word

+

Default: Control+Alt+h,Control+BackSpace

+

kb-remove-word-forward

+

Delete next word

+

Default: Control+Alt+d

+

kb-remove-char-forward

+

Delete next char

+

Default: Delete,Control+d

+

kb-remove-char-back

+

Delete previous char

+

Default: BackSpace,Shift+BackSpace,Control+h

+

kb-remove-to-eol

+

Delete till the end of line

+

Default: Control+k

+

kb-remove-to-sol

+

Delete till the start of line

+

Default: Control+u

+

kb-accept-entry

+

Accept entry

+

Default: Control+j,Control+m,Return,KP_Enter

+

kb-accept-custom

+

Use entered text as command (in ssh/run modes)

+

Default: Control+Return

+

kb-accept-custom-alt

+

Use entered text as command (in ssh/run modes)

+

Default: Control+Shift+Return

+

kb-accept-alt

+

Use alternate accept command.

+

Default: Shift+Return

+

kb-delete-entry

+

Delete entry from history

+

Default: Shift+Delete

+

kb-mode-next

+

Switch to the next mode.

+

Default: Shift+Right,Control+Tab

+

kb-mode-previous

+

Switch to the previous mode.

+

Default: Shift+Left,Control+ISO_Left_Tab

+

kb-mode-complete

+

Start completion for mode.

+

Default: Control+l

+

kb-row-left

+

Go to the previous column

+

Default: Control+Page_Up

+

kb-row-right

+

Go to the next column

+

Default: Control+Page_Down

+

kb-row-up

+

Select previous entry

+

Default: Up,Control+p

+

kb-row-down

+

Select next entry

+

Default: Down,Control+n

+

kb-row-tab

+

Go to next row, if one left, accept it, if no left next mode.

+

Default:

+

kb-element-next

+

Go to next row.

+

Default: Tab

+

kb-element-prev

+

Go to previous row.

+

Default: ISO_Left_Tab

+

kb-page-prev

+

Go to the previous page

+

Default: Page_Up

+

kb-page-next

+

Go to the next page

+

Default: Page_Down

+

kb-row-first

+

Go to the first entry

+

Default: Home,KP_Home

+

kb-row-last

+

Go to the last entry

+

Default: End,KP_End

+

kb-row-select

+

Set selected item as input text

+

Default: Control+space

+

kb-screenshot

+

Take a screenshot of the rofi window

+

Default: Alt+S

+

kb-ellipsize

+

Toggle between ellipsize modes for displayed data

+

Default: Alt+period

+

kb-toggle-case-sensitivity

+

Toggle case sensitivity

+

Default: grave,dead_grave

+

kb-toggle-sort

+

Toggle sort

+

Default: Alt+grave

+

kb-cancel

+

Quit rofi

+

Default: Escape,Control+g,Control+bracketleft

+

kb-custom-1

+

Custom keybinding 1

+

Default: Alt+1

+

kb-custom-2

+

Custom keybinding 2

+

Default: Alt+2

+

kb-custom-3

+

Custom keybinding 3

+

Default: Alt+3

+

kb-custom-4

+

Custom keybinding 4

+

Default: Alt+4

+

kb-custom-5

+

Custom Keybinding 5

+

Default: Alt+5

+

kb-custom-6

+

Custom keybinding 6

+

Default: Alt+6

+

kb-custom-7

+

Custom Keybinding 7

+

Default: Alt+7

+

kb-custom-8

+

Custom keybinding 8

+

Default: Alt+8

+

kb-custom-9

+

Custom keybinding 9

+

Default: Alt+9

+

kb-custom-10

+

Custom keybinding 10

+

Default: Alt+0

+

kb-custom-11

+

Custom keybinding 11

+

Default: Alt+exclam

+

kb-custom-12

+

Custom keybinding 12

+

Default: Alt+at

+

kb-custom-13

+

Custom keybinding 13

+

Default: Alt+numbersign

+

kb-custom-14

+

Custom keybinding 14

+

Default: Alt+dollar

+

kb-custom-15

+

Custom keybinding 15

+

Default: Alt+percent

+

kb-custom-16

+

Custom keybinding 16

+

Default: Alt+dead_circumflex

+

kb-custom-17

+

Custom keybinding 17

+

Default: Alt+ampersand

+

kb-custom-18

+

Custom keybinding 18

+

Default: Alt+asterisk

+

kb-custom-19

+

Custom Keybinding 19

+

Default: Alt+parenleft

+

kb-select-1

+

Select row 1

+

Default: Super+1

+

kb-select-2

+

Select row 2

+

Default: Super+2

+

kb-select-3

+

Select row 3

+

Default: Super+3

+

kb-select-4

+

Select row 4

+

Default: Super+4

+

kb-select-5

+

Select row 5

+

Default: Super+5

+

kb-select-6

+

Select row 6

+

Default: Super+6

+

kb-select-7

+

Select row 7

+

Default: Super+7

+

kb-select-8

+

Select row 8

+

Default: Super+8

+

kb-select-9

+

Select row 9

+

Default: Super+9

+

kb-select-10

+

Select row 10

+

Default: Super+0

+

Mouse Bindings

+

ml-row-left

+

Go to the previous column

+

Default: ScrollLeft

+

ml-row-right

+

Go to the next column

+

Default: ScrollRight

+

ml-row-up

+

Select previous entry

+

Default: ScrollUp

+

ml-row-down

+

Select next entry

+

Default: ScrollDown

+

me-select-entry

+

Select hovered row

+

Default: MousePrimary

+

me-accept-entry

+

Accept hovered row

+

Default: MouseDPrimary

+

me-accept-custom

+

Accept hovered row with custom action

+

Default: Control+MouseDPrimary

+

SEE ALSO

+

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

+

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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.3/rofi-script.5/index.html b/1.7.3/rofi-script.5/index.html new file mode 100644 index 00000000..c612084c --- /dev/null +++ b/1.7.3/rofi-script.5/index.html @@ -0,0 +1,1509 @@ + + + + + + + + + + + + + + + + + + + + + + Script - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-SCRIPT 5 rofi-script

+

NAME

+

rofi script mode - Rofi format for scriptable mode.

+

DESCRIPTION

+

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

+

USAGE

+

To specify a script mode, set a mode with the following syntax: "{name}:{executable}"

+

For example:

+
rofi -show fb -modes "fb:file_browser.sh"
+
+

The name should be unique.

+

API

+

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" ]
+then
+    exit 0
+fi
+echo "reload"
+echo "quit"
+
+
+

This shows two entries, reload and quit. When the quit entry is selected, rofi closes.

+

Environment

+

Rofi sets the following environment variable when executing the script:

+

ROFI_RETV

+

An integer number with the current state:

+
    +
  • 0: Initial call of script.
  • +
  • 1: Selected an entry.
  • +
  • 2: Selected a custom entry.
  • +
  • 10-28: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
  • +
+

ROFI_INFO

+

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

+

ROFI_DATA

+

Environment get set when script sets data option in header.

+

Passing mode options

+

Extra options, like setting the prompt, can be set by the script. +Extra 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:

+
    +
  • prompt: Update the prompt text.
  • +
  • message: Update the message text.
  • +
  • markup-rows: If 'true' renders markup in the row.
  • +
  • urgent: Mark rows as urgent. (for syntax see the urgent option in dmenu mode)
  • +
  • active: Mark rows as active. (for syntax see the active option in dmenu mode)
  • +
  • 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.
  • +
  • no-custom: If set to 'true'; only accept listed entries, ignore custom input.
  • +
  • use-hot-keys: If set to true, it enabled the Custom keybindings for script. Warning this breaks the normal rofi flow.
  • +
  • keep-selection: If set, the selection is not moved to the first entry, but the current position is maintained. The filter is cleared.
  • +
  • new-selection: If keep-selection is set, this allows you to override the selected entry (absolute position).
  • +
  • data: Passed data to the next execution of the script via ROFI_DATA.
  • +
  • theme: Small theme snippet to f.e. change the background color of a widget.
  • +
+

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 entry.

+

For example:

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

The following options are supported:

+
    +
  • icon: Set the icon for that row.
  • +
  • meta: Specify invisible search terms.
  • +
  • nonselectable: If true the row cannot activated.
  • +
  • info: Info that, on selection, gets placed in the ROFI_INFO environment variable. This entry does not get searched.
  • +
+

multiple entries can be passed using the \x1f separator.

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

Executing external program

+

If you want to launch an external program from the script, you need to make sure it is launched in the background. +If not rofi will wait for its output (to display).

+

In bash the best way to do this is using coproc.

+
 coproc ( myApp  > /dev/null  2>&1 )
+
+

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 github.

+

SEE ALSO

+

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

+

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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.3/rofi-theme.5/index.html b/1.7.3/rofi-theme.5/index.html new file mode 100644 index 00000000..fd978515 --- /dev/null +++ b/1.7.3/rofi-theme.5/index.html @@ -0,0 +1,3309 @@ + + + + + + + + + + + + + + + + + + + + + + Themes - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-THEME 5 rofi-theme

+

NAME

+

rofi-theme - Rofi theme format files

+

GETTING STARTED WITH THEMING

+

The easiest way to get started theming rofi is by modifying your existing theme.

+

Themes can be modified/tweaked by adding theming elements to the end of the
+config file. The default location of this file is ~/.config/rofi/config.rasi, +if the file does not exists, you can create it.

+

A basic config:

+
configuration {
+  modes: [ combi ];
+  combi-modes: [ window, drun, run ];
+}
+
+@theme "gruvbox-light"
+
+/* Insert theme modifications after this */
+
+

For example if we want to change the Type to filter text in the entry box we +append the following:

+
entry {
+    placeholder: "Type here";
+}
+
+

In the above section, entry indicates the widget, placeholder is the +property we want to modify and we set it to the string "Type here". +To find the commonly available widgets in rofi, see the 'Basic structure' section.

+

To change the mouse over cursor to a pointer, add:

+
entry {
+    placeholder: "Type here";
+    cursor: pointer;
+}
+
+

For the next modification, we want to add the icon after each text element and +increase the size. First we start by modifying the element widget:

+

+element {
+  orientation: horizontal;
+  children: [ element-text, element-icon ];
+  spacing: 5px;
+}
+
+
+

Resulting in the following packing:

+
┌─────────────────────────────────────────────────────────────────────┐ 
+│ element                                                             │ 
+│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │ 
+│ │element─text                                 │ │ element─icon    │ │ 
+│ └─────────────────────────────────────────────┘ └─────────────────┘ │ 
+└─────────────────────────────────────────────────────────────────────┘ 
+
+

The element (container) widget hold each entry in the listview, we add the +two pre-defined children in the order we want to show. We also specify the +packing direction (orientation) and the spacing between the children +(spacing). We specify the space between the two children in absolute pixels +(px).

+

To increase the icon-size, we need to modify the element-icon widget.

+
element-icon {
+    size: 2.5em;
+}
+
+
┌─────────────────────────────────────────────────────────────────────┐ 
+│ element                                                             │ 
+│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │ 
+│ │element─text                                 │ │    element      │ │ 
+│ │                                             │ │       ─         │ │ 
+│ │                                             │ │     icon        │ │ 
+│ └─────────────────────────────────────────────┘ └─────────────────┘ │ 
+└─────────────────────────────────────────────────────────────────────┘ 
+
+

In this example we specify the size in the em unit.

+

Now lets change the text color of both the entry and the element-text widget to red and background to blue.

+
entry, element-text {
+  text-color: red;
+  background-color: rgb(0,0,255);
+}
+
+

Here we use two different methods of writing down the color, for text-color +we used a named color, for background-color we specify it in rgb. +We also specify the property for multiple widgets by passing a comma separated +list of widget names.

+

If you want to center the text relative to the icon, we can set this:

+
element-text {
+    vertical-align: 0.5;
+}
+
+
┌─────────────────────────────────────────────────────────────────────┐ 
+│ element                                                             │ 
+│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │ 
+│ │                                             │ │    element      │ │ 
+│ │element-text                                 │ │       ─         │ │ 
+│ │                                             │ │     icon        │ │ 
+│ └─────────────────────────────────────────────┘ └─────────────────┘ │ 
+└─────────────────────────────────────────────────────────────────────┘ 
+
+

We can also specify the color and width of the cursor. You could, for example, +create a crimson block cursor like this:

+
entry {
+  cursor-color: rgb(220,20,60);
+  cursor-width: 8px;
+}
+
+

By default, the cursor-color will be the same as the text-color. The cursor-width will always default to 2 pixels.

+

If you want to see the complete theme, including the modification you can run:

+
rofi -dump-theme
+
+

DEFAULT THEME LOADING

+

By default, rofi loads the default theme. This theme is always loaded. +The default configuration contains:

+
@theme "default"
+
+

To unload the default theme, and load another theme, add the @theme statement +to your config.rasi file.

+

If you have a theme loaded via @theme or use the default theme, you can tweak +it by adding overriding elements at the end of your config.rasi file.

+

For the difference between @import and @theme see the Multiple file +handling section in this manpage.

+

To see the default theme, run the following command:

+
rofi -no-config -dump-theme
+
+

DESCRIPTION

+

The need for a new theme format was motivated by the fact that the way rofi handled widgets has changed. From a very +static drawing of lines and text to a nice structured form of packing widgets. This change made it possible to provide a +more flexible theme framework. The old theme format and config file are not flexible enough to expose these options in a +user-friendly way. Therefore, a new file format has been created, replacing the old one.

+

FORMAT SPECIFICATION

+

Encoding

+

The encoding of the file is UTF-8. Both unix (\n) and windows (\r\n) newlines format are supported. But unix is +preferred.

+

Comments

+

C and C++ file comments are supported.

+
    +
  • Anything after // and before a newline is considered a comment.
  • +
  • Everything between /* and */ is a comment, this comment can span multiple lines.
  • +
+

Comments can be nested and the C comments can be inline.

+

The following is valid:

+
// Magic comment.
+property: /* comment */ value;
+
+

However, this is not:

+
prop/*comment*/erty: value;
+
+

White space

+

White space and newlines, like comments, are ignored by the parser.

+

This:

+
property: name;
+
+

Is identical to:

+
     property             :
+name
+
+;
+
+

File extension

+

The preferred file extension for the new theme format is rasi. This is an +abbreviation for rofi advanced style information.

+

Basic Structure

+

Each element has a section with defined properties. Global properties can be defined in section * { }. +Sub-section names begin with an optional hash symbol #.

+

It is advised to define the global properties section on top of the file to +make inheritance of properties clearer.

+
/* Global properties section */
+* {
+    // list of properties
+}
+
+/* Element theme section. */
+{element path} {
+    // list of properties
+}
+{elements... } {
+    // list of properties
+}
+
+

If there are multiple sections with the same name, they are merged. Duplicate properties are overwritten and the last +parsed entry kept.

+

Global properties section

+

A theme can have one or more global properties sections. If there is more than one, +they will be merged.

+

The global properties section denotes the defaults for each element. +Each property of this section can be referenced with @{identifier} +(See Properties section)

+

A global properties section is indicated with a * as element path.

+

Element theme section

+

A theme can have multiple element theme sections.

+

The element path can consist of multiple names separated by whitespace or dots. +Each element may contain any number of letters, numbers and -'s. +The first element in the element path can optionally start with a # (for +historic reasons). Multiple elements can be specified by a ,.

+

This is a valid element name:

+
element normal.normal {
+    background-color: blue;
+}
+button {
+    background-color: blue;
+}
+
+

And is identical to:

+
element normal normal, button {
+    background-color: blue;
+}
+
+

Each section inherits the global properties. Properties can be explicitly +inherited from their parent with the inherit keyword. +In the following example:

+
window {
+ a: 1;
+ b: 2;
+ children: [ mainbox ];
+}
+mainbox {
+    a: inherit;
+    b: 4;
+    c: 8;
+}
+
+

The element mainbox will have the following set of properties (if mainbox +is a child of window):

+
a: 1;
+b: 4;
+c: 8;
+
+

If multiple sections are defined with the same name, they are merged by the +parser. If multiple properties with the same name are defined in one section, +the last encountered property is used.

+

Properties Format

+

The properties in a section consist of:

+
{identifier}: {value};
+
+

Both fields are mandatory for a property.

+

The identifier names the specified property. Identifiers can consist of any +combination of numbers, letters and '-'. It must not contain any whitespace. +The structure of the value defines the type of the property. The current +parser does not define or enforce a certain type of a particular identifier. +When used, values with the wrong type that cannot be converted are ignored.

+

The current theme format supports different types:

+
    +
  • a string
  • +
  • an integer number
  • +
  • a fractional number
  • +
  • a boolean value
  • +
  • a color
  • +
  • image
  • +
  • text style
  • +
  • line style
  • +
  • a distance
  • +
  • a padding
  • +
  • a border
  • +
  • a position
  • +
  • a reference
  • +
  • an orientation
  • +
  • a cursor
  • +
  • a list of keywords
  • +
  • an array of values
  • +
  • an environment variable
  • +
  • Inherit
  • +
+

Some of these types are a combination of other types.

+

String

+
    +
  • Format: "[:print:]+"
  • +
+

A string is always surrounded by double quotes ("). Between the quotes there can be any printable character.

+

For example:

+
font: "Awasome 12";
+
+

The string must be valid UTF-8, special characters can be escaped:

+
text {
+    content: "Line one\n\tIndented line two";
+}
+
+

The following special characters can be escaped: \b, \f, \n, \r, \t, \v, \ and ".

+

Integer

+
    +
  • Format: [-+]?[:digit:]+
  • +
+

An integer may contain any number.

+

For examples:

+
lines: 12;
+
+

Real

+
    +
  • Format: [-+]?[:digit:]+(\.[:digit:]+)?
  • +
+

A real is an integer with an optional fraction.

+

For example:

+
real: 3.4;
+
+

The following is not valid: .3, 3. or scientific notation: 3.4e-3.

+

Boolean

+
    +
  • Format: (true|false)
  • +
+

Boolean value is either true or false. This is case-sensitive.

+

For example:

+
dynamic: false;
+
+

Image

+

rofi support a limited set of background-image formats.

+
    +
  • Format: url("path to image");
  • +
  • Format: url("path to image", scale); + where scale is: none, both, width, height
  • +
  • Format: linear-gradient(stop color,stop1, color, stop2 color, ...);
  • +
  • Format: linear-gradient(to direction, stop color,stop1, color, stop2 color, ...); + where direction is: top,left,right,bottom.
  • +
  • Format: linear-gradient(angle, stop color,stop1, color, stop2 color, ...); + Angle in deg,rad,grad (as used in color).
  • +
+

Where the path is a string, and stop color is of type color.

+

Color

+

rofi supports the color formats as specified in the CSS standard (1,2,3 and some of CSS 4)

+
    +
  • Format: #{HEX}{3} (rgb)
  • +
  • Format: #{HEX}{4} (rgba)
  • +
  • Format: #{HEX}{6} (rrggbb)
  • +
  • Format: #{HEX}{8} (rrggbbaa)
  • +
  • Format: rgb[a]({INTEGER},{INTEGER},{INTEGER}[, {PERCENTAGE}])
  • +
  • Format: rgb[a]({INTEGER}%,{INTEGER}%,{INTEGER}%[, {PERCENTAGE}])
  • +
  • Format: hsl[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])
  • +
  • Format: hwb[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])
  • +
  • Format: cmyk( {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE} ])
  • +
  • Format: {named-color} [ / {PERCENTAGE} ]
  • +
+

The white-space format proposed in CSS4 is also supported.

+

The different values are:

+
    +
  • {HEX} is a hexadecimal number ('0-9a-f' case insensitive).
  • +
  • {INTEGER} value can be between 0 and 255 or 0-100 when representing percentage.
  • +
  • {ANGLE} is the angle on the color wheel, can be in deg, rad, grad or turn. When no unit is specified, degrees is assumed.
  • +
  • {PERCENTAGE} can be between 0-1.0, or 0%-100%
  • +
  • +

    {named-color} is one of the following colors:

    +

    AliceBlue, AntiqueWhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet, Brown, +BurlyWood, CadetBlue, Chartreuse, Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, DarkCyan, +DarkGoldenRod, DarkGray, DarkGrey, DarkGreen, DarkKhaki, DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, +DarkSalmon, DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkSlateGrey, DarkTurquoise, DarkViolet, DeepPink, DeepSkyBlue, +DimGray, DimGrey, DodgerBlue, FireBrick, FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, GoldenRod, +Gray, Grey, Green, GreenYellow, HoneyDew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, +LemonChiffon, LightBlue, LightCoral, LightCyan, LightGoldenRodYellow, LightGray, LightGrey, LightGreen, LightPink, +LightSalmon, LightSeaGreen, LightSkyBlue, LightSlateGray, LightSlateGrey, LightSteelBlue, LightYellow, Lime, LimeGreen, +Linen, Magenta, Maroon, MediumAquaMarine, MediumBlue, MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, +MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, MintCream, MistyRose, Moccasin, NavajoWhite, Navy, +OldLace, Olive, OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenRod, PaleGreen, PaleTurquoise, PaleVioletRed, +PapayaWhip, PeachPuff, Peru, Pink, Plum, PowderBlue, Purple, RebeccaPurple, Red, RosyBrown, RoyalBlue, SaddleBrown, +Salmon, SandyBrown, SeaGreen, SeaShell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray, SlateGrey, Snow, SpringGreen, +SteelBlue, Tan, Teal, Thistle, Tomato, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, YellowGreen,transparent

    +
  • +
+

For example:

+
background-color: #FF0000;
+border-color: rgba(0,0,1, 0.5);
+text-color: SeaGreen;
+
+

or

+
background-color: transparent;
+text-color: Black;
+
+

Text style

+
    +
  • Format: (bold|italic|underline|strikethrough|none)
  • +
+

Text style indicates how the highlighted text is emphasized. None indicates that no emphasis +should be applied.

+
    +
  • bold: make the text thicker then the surrounding text.
  • +
  • italic: put the highlighted text in script type (slanted).
  • +
  • underline: put a line under the text.
  • +
  • strikethrough: put a line through the text.
  • +
+

The following options are available on pango 1.50.0 and up:

+
    +
  • uppercase: Uppercase the text.
  • +
  • lowercase: Lowercase the text.
  • +
+

The following option is disabled as pango crashes on this if there is eel + upsizing or wrapping. This will be re-enabled once fixed:

+
    +
  • capitalize: Capitalize the text.
  • +
+

Line style

+
    +
  • Format: (dash|solid)
  • +
+

Indicates how a line should be drawn. +It currently supports: + * dash: a dashed line, where the gap is the same width as the dash + * solid: a solid line

+

Distance

+
    +
  • Format: {Integer}px
  • +
  • Format: {Real}em
  • +
  • Format: {Real}ch
  • +
  • Format: {Real}%
  • +
  • Format: {Integer}mm
  • +
+

A distance can be specified in 3 different units:

+
    +
  • px: Screen pixels.
  • +
  • em: Relative to text height.
  • +
  • ch: Relative to width of a single number.
  • +
  • mm: Actual size in millimeters (based on dpi).
  • +
  • %: Percentage of the monitor size.
  • +
+

Distances used in the horizontal direction use the monitor width. Distances in +the vertical direction use the monitor height. +For example:

+
   padding: 10%;
+
+

On a full-HD (1920x1080) monitor, it defines a padding of 192 pixels on the left +and right side and 108 pixels on the top and bottom.

+

Calculating sizes

+

Rofi supports some maths in calculating sizes. For this it uses the CSS syntax:

+
width: calc( 100% - 37px );
+
+
width: calc( 20% min 512 );
+
+

It supports the following operations:

+
    +
  • + : Add
  • +
  • - : Subtract
  • +
  • / : Divide
  • +
  • * : Multiply
  • +
  • % : Modulo
  • +
  • min : Minimum of lvalue or rvalue;
  • +
  • max : Maximum of lvalue or rvalue;
  • +
  • floor : Round down lvalue to the next multiple of rvalue
  • +
  • ceil : Round up lvalue to the next multiple of rvalue
  • +
  • round : Round lvalue to the next multiple of rvalue
  • +
+

It uses the C precedence ordering.

+

Padding

+
    +
  • Format: {Integer}
  • +
  • Format: {Distance}
  • +
  • Format: {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance} {Distance}
  • +
+

If no unit is specified, pixels are assumed.

+

The different number of fields in the formats are parsed like:

+
    +
  • 1 field: all
  • +
  • 2 fields: top&bottom left&right
  • +
  • 3 fields: top, left&right, bottom
  • +
  • 4 fields: top, right, bottom, left
  • +
+

Border

+
    +
  • Format: {Integer}
  • +
  • Format: {Distance}
  • +
  • Format: {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style} {Distance} {Line style}
  • +
+

Borders are identical to padding, except that each distance field has a line +style property.

+
+

When no unit is specified, pixels are assumed.

+
+

Position

+

Indicate a place on the window/monitor.

+
┌─────────────┬─────────────┬─────────────┐
+│ north west  │    north    │  north east │
+├─────────────┼─────────────┼─────────────┤
+│   west      │   center    │     east    │
+├─────────────┼─────────────┼─────────────┤
+│ south west  │    south    │  south east │
+└─────────────┴─────────────┴─────────────┘
+
+
    +
  • Format: (center|east|north|west|south|north east|north west|south west|south east)
  • +
+

Visibility

+

It is possible to hide widgets:

+
inputbar {
+    enabled: false;
+}
+
+

Reference

+
    +
  • Format: @{PROPERTY NAME}
  • +
+

A reference can point to another reference. Currently, the maximum number of redirects is 20. +A property always refers to another property. It cannot be used for a subpart of the property. +For example, this is not valid:

+
highlight: bold @pink;
+
+

But this is:

+
* {
+    myhigh: bold #FAA;
+}
+
+window {
+    highlight: @myhigh;
+}
+
+
    +
  • Format: var(PROPERTY NAME, DEFAULT)
  • +
+

A reference can point to another reference. Currently, the maximum number of redirects is 20. +A property always refers to another property. It cannot be used for a subpart of the property.

+

Example:

+
window {
+    width: var( width, 30%);
+}
+
+

If the property width is set globally (*{}) that value is used, if the property +width is not set, the default value is used.

+

Orientation

+
    +
  • Format: (horizontal|vertical)
  • +
+

Specify the orientation of the widget.

+

Cursor

+
    +
  • Format: (default|pointer|text)
  • +
+

Specify the type of mouse cursor that is set when the mouse pointer is over the widget.

+

List of keywords

+
    +
  • Format: [ keyword, keyword ]
  • +
+

A list starts with a '[' and ends with a ']'. The entries in the list are comma-separated. +The keyword in the list refers to an widget name.

+

List of values

+
    +
  • Format: [ value, value, ... ]
  • +
+

An list starts with a '[' and ends with a ']'. The entries in the list are comma-separated.

+

Environment variable

+
    +
  • Format: ${:alnum:}
  • +
+

This will parse the environment variable as the property value. (that then can be any of the above types). +The environment variable should be an alphanumeric string without white-space.

+
* {
+    background-color: ${BG};
+}
+
+
    +
  • Format: env(ENVIRONMENT, default)
  • +
+

This will parse the environment variable as the property value. (that then can be any of the above types). +The environment variable should be an alphanumeric string without white-space. +If the environment value is not found, the default value is used.

+
window {
+    width: env(WIDTH, 40%);
+}
+
+

If environment WIDTH is set, then that value is parsed, otherwise the default value (40%).

+

Inherit

+
    +
  • Format: inherit
  • +
+

Inherits the property from its parent widget.

+
mainbox {
+    border-color: inherit;
+}
+
+

ELEMENTS PATHS

+

Element paths exists of two parts, the first part refers to the actual widget by name. +Some widgets have an extra state.

+

For example:

+
element selected {
+}
+
+

Here element selected is the name of the widget, selected is the state of the widget.

+

The difference between dots and spaces is purely cosmetic. These are all the same:

+
element .selected {
+
+element.selected {
+}
+element selected {
+}
+
+

SUPPORTED ELEMENT PATH

+

Name

+

The current widgets available in rofi:

+
    +
  • window
  • +
  • overlay: the overlay widget.
  • +
  • mainbox: The mainbox box.
      +
    • inputbar: The input bar box.
    • +
    • box: the horizontal @box packing the widgets
    • +
    • case-indicator: the case/sort indicator @textbox
    • +
    • prompt: the prompt @textbox
    • +
    • entry: the main entry @textbox
    • +
    • num-rows: Shows the total number of rows.
    • +
    • num-filtered-rows: Shows the total number of rows after filtering.
    • +
    • textbox-current-entry: Shows the text of the currently selected entry.
    • +
    • icon-current-entry: Shows the icon of the currently selected entry.
    • +
    • listview: The listview.
    • +
    • scrollbar: the listview scrollbar
    • +
    • element: a box in the listview holding the entries
        +
      • element-icon: the widget in the listview's entry showing the (optional) icon
      • +
      • element-index: the widget in the listview's entry keybindable index (1,2,3..0)
      • +
      • element-text: the widget in the listview's entry showing the text.
      • +
      +
    • +
    • mode-switcher: the main horizontal @box packing the buttons.
    • +
    • button: the buttons @textbox for each mode
    • +
    • message: The container holding the textbox.
    • +
    • textbox: the message textbox
    • +
    +
  • +
+

Note that these path names match the default theme. Themes that provide a custom layout will have different +elements, and structure.

+

State

+

State: State of widget

+

Optional flag(s) indicating state of the widget, used for theming.

+

These are appended after the name or class of the widget.

+

Example:

+

button selected.normal { }

+

element selected.urgent { }

+

Currently only the entrybox and scrollbar have states:

+

Entrybox:

+

{visible modifier}.{state}

+

Where visible modifier can be: + * normal: no modification + * selected: the entry is selected/highlighted by user + * alternate: the entry is at an alternating row (uneven row)

+

Where state is: + * normal: no modification + * urgent: this entry is marked urgent + * active: this entry is marked active

+

These can be mixed.

+

Example:

+
nametotextbox selected.active {
+    background-color: #003642;
+    text-color: #008ed4;
+}
+
+

Sets all selected textboxes marked active to the given text and background color. +Note that a state modifies the original element, it therefore contains all the properties of that element.

+

Scrollbar

+

The scrollbar uses the handle state when drawing the small scrollbar handle. +This allows the colors used for drawing the handle to be set independently.

+

SUPPORTED PROPERTIES

+

The following properties are currently supported:

+

all widgets:

+
    +
  • enabled: enable/disable rendering of the widget
  • +
  • padding: padding + Padding on the inside of the widget
  • +
  • margin: padding + Margin on the outside of the widget
  • +
  • border: border + Border around the widget (between padding and margin)/
  • +
  • border-radius: padding + Sets a radius on the corners of the borders.
  • +
  • background-color: color + Background color
  • +
  • background-image: image + Background image
  • +
  • border-color: color + Color of the border
  • +
  • cursor: cursor + Type of mouse cursor that is set when the mouse pointer is hovered over the widget.
  • +
+

window:

+
    +
  • +

    font: string + The font used in the window

    +
  • +
  • +

    transparency: string + Indicating if transparency should be used and what type: + real - True transparency. Only works with a compositor. + background - Take a screenshot of the background image and use that. + screenshot - Take a screenshot of the screen and use that. + Path to png file - Use an image.

    +
  • +
  • +

    location: position + The place of the anchor on the monitor

    +
  • +
  • anchor: anchor + The anchor position on the window
  • +
  • fullscreen: boolean + Window is fullscreen.
  • +
  • width: distance + The width of the window
  • +
  • x-offset: distance
  • +
  • y-offset: distance + The offset of the window to the anchor point, allowing you to push the window left/right/up/down
  • +
+

scrollbar:

+
    +
  • background-color: color
  • +
  • handle-width: distance
  • +
  • handle-color: color
  • +
  • border-color: color
  • +
+

box:

+
    +
  • orientation: orientation + Set the direction the elements are packed.
  • +
  • spacing: distance + Distance between the packed elements.
  • +
+

textbox:

+
    +
  • background-color: color
  • +
  • border-color: the color used for the border around the widget.
  • +
  • font: the font used by this textbox (string).
  • +
  • str/content: the string to display by this textbox (string).
  • +
  • vertical-align: Vertical alignment of the text. A number between 0 (top) and 1 (bottom).
  • +
  • horizontal-align: Horizontal alignment of the text. A number between 0 (left) and 1 (right).
  • +
  • text-color: the text color to use.
  • +
  • text-transform: text style {color} for the whole text.
  • +
  • highlight: text style {color}. + color is optional, multiple highlight styles can be added like: bold underline italic #000000; + This option is only available on the element-text widget.
  • +
  • width: override the desired width for the textbox.
  • +
  • content: Set the displayed text (String).
  • +
  • placeholder: Set the displayed text (String) when nothing is entered.
  • +
  • placeholder-markup: If true, placeholder text supports pango markup for stylizing.
  • +
  • placeholder-color: Color of the placeholder text.
  • +
  • blink: Enable/Disable blinking on an input textbox (Boolean).
  • +
  • markup: Force markup on, beware that only valid pango markup strings are shown.
  • +
  • tab-stops: array of distances + Set the location of tab stops by their distance from the beginning of the line. + Each distance should be greater than the previous one. + The text appears to the right of the tab stop position (other alignments are not supported yet).
  • +
  • cursor-width: The width of the cursor.
  • +
  • cursor-color: The color used to draw the cursor.
  • +
  • cursor-outline: Enable a border (outline) around the cursor. (Boolean)
  • +
  • cursor-outline-width: The width of the border around the cursor. (Double)
  • +
  • cursor-outline-color: The color to use for the cursor outline. (Color)
  • +
  • text-outline: Enable a border (outline) around the text. (Boolean)
  • +
  • text-outline-width: The width of the border around the text. (Double)
  • +
  • text-outline-color: The color to use for the text outline. (Color)
  • +
+

listview:

+
    +
  • columns: integer + Number of columns to show (at least 1)
  • +
  • fixed-height: boolean + Always show lines rows, even if fewer elements are available.
  • +
  • dynamic: boolean + True if the size should change when filtering the list, False if it should keep the original height.
  • +
  • scrollbar: boolean + If the scrollbar should be enabled/disabled.
  • +
  • scrollbar-width: distance + Width of the scrollbar
  • +
  • cycle: boolean + When navigating, it should wrap around
  • +
  • spacing: distance + Spacing between the elements (both vertical and horizontal)
  • +
  • lines: integer + Number of rows to show in the list view.
  • +
  • layout: orientation + Indicate how elements are stacked. Horizontal implements the dmenu style.
  • +
  • reverse: boolean + Reverse the ordering (top down to bottom up).
  • +
  • flow: orientation + The order the elements are layed out. Vertical is the original 'column' view.
  • +
  • fixed-columns: boolean + Do not reduce the number of columns shown when number of visible elements is not enough to fill them all.
  • +
  • require-input: boolean + Listview requires user input to be unhidden. The list is still present and + hitting accept will activate the first entry.
  • +
+

Each element is a box called element. Each element can contain an element-icon and element-text.

+

listview text highlight:

+

The element-text widget in the listview is the one used to show the text. +On this widget set the highlight property (only place this property is used) to change +the style of highlighting. +The highlight property consist of the text-style property and a color.

+

To disable highlighting:

+
  element-text {
+    highlight: None;
+  }
+
+

To set to red underlined:

+
  element-text {
+    highlight: underline red;
+  }
+
+

Layout

+

The new format allows the layout of the rofi window to be tweaked extensively. +For each widget, the themer can specify padding, margin, border, font, and more. +It even allows, as an advanced feature, to pack widgets in a custom structure.

+

Basic structure

+

The whole view is made out of boxes that pack other boxes or widgets. +The box can be vertical or horizontal. This is loosely inspired by GTK.

+

The current layout of rofi is structured as follows:

+
┌────────────────────────────────────────────────────────────────────────────────────┐
+│ window {BOX:vertical}                                                              │
+│ ┌───────────────────────────────────────────────────────────────────────────────┐  │
+│ │ mainbox  {BOX:vertical}                                                       │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │ inputbar {BOX:horizontal}                                                 │ │  │
+│ │ │ ┌─────────┐ ┌─┐ ┌───────────────────────────────┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ │ │  │
+│ │ │ │ prompt  │ │:│ │ entry                         │ │#fr│ │ / │ │#ns│ │ci │ │ │  │
+│ │ │ └─────────┘ └─┘ └───────────────────────────────┘ └───┘ └───┘ └───┘ └───┘ │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ │                                                                               │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │ message                                                                   │ │  │
+│ │ │ ┌───────────────────────────────────────────────────────────────────────┐ │ │  │
+│ │ │ │ textbox                                                               │ │ │  │
+│ │ │ └───────────────────────────────────────────────────────────────────────┘ │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ │                                                                               │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │ listview                                                                  │ │  │
+│ │ │ ┌─────────────────────────────────────────────────────────────────────┐   │ │  │
+│ │ │ │ element                                                             │   │ │  │
+│ │ │ │ ┌─────────────────┐ ┌─────────────────────────────────────────────┐ │   │ │  │
+│ │ │ │ │element─icon     │ │element─text                                 │ │   │ │  │
+│ │ │ │ └─────────────────┘ └─────────────────────────────────────────────┘ │   │ │  │
+│ │ │ └─────────────────────────────────────────────────────────────────────┘   │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ │                                                                               │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │  mode─switcher {BOX:horizontal}                                           │ │  │
+│ │ │ ┌───────────────┐   ┌───────────────┐  ┌──────────────┐ ┌───────────────┐ │ │  │
+│ │ │ │ Button        │   │ Button        │  │ Button       │ │ Button        │ │ │  │
+│ │ │ └───────────────┘   └───────────────┘  └──────────────┘ └───────────────┘ │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ └───────────────────────────────────────────────────────────────────────────────┘  │
+└────────────────────────────────────────────────────────────────────────────────────┘
+
+
+
+
+
    +
  • ci is the case-indicator
  • +
  • fr is the num-filtered-rows
  • +
  • ns is the num-rows
  • +
+
+

Error message structure

+
┌──────────────────────────────────────────────────────────────────────────────────┐
+│ window {BOX:vertical}                                                            │
+│ ┌─────────────────────────────────────────────────────────────────────────────┐  │
+│ │ error─message {BOX:vertical}                                                │  │
+│ │ ┌────────────────────────────────────────────────────────────────────────┐  │  │
+│ │ │ textbox                                                                │  │  │
+│ │ └────────────────────────────────────────────────────────────────────────┘  │  │
+│ └─────────────────────────────────────────────────────────────────────────────┘  │
+└──────────────────────────────────────────────────────────────────────────────────┘
+
+
+

Advanced layout

+

The layout of rofi can be tweaked by packing the 'fixed' widgets in a custom structure.

+

The following widgets are fixed, as they provide core rofi functionality:

+
    +
  • prompt
  • +
  • entry
  • +
  • overlay
  • +
  • case-indicator
  • +
  • message
  • +
  • listview
  • +
  • mode-switcher
  • +
  • num-rows
  • +
  • num-filtered-rows
  • +
+

The following keywords are defined and can be used to automatically pack a subset of the widgets. +These are used in the default theme as depicted in the figure above.

+
    +
  • mainbox + Packs: inputbar, message, listview, mode-switcher
  • +
  • inputbar + Packs: prompt,entry,case-indicator
  • +
+

Any widget name starting with textbox is a textbox widget, others are box widgets and can pack other widgets.

+

There are several special widgets that can be used by prefixing the name of the widget:

+

textbox

+

This is a read-only textbox widget. The displayed string can be set with content.

+

Example:

+
textbox-custom {
+  expand: false;
+  content: "My Message";
+}
+
+

Icon

+

This is an icon widget. The displayed icon can be set with filename and size with size. +If the property action is set, it acts as a button. +action can be set to a keybinding name and completes that action. (see rofi -show keys for a list).

+

If the squared property is set to false the widget height and width are not forced to be equal.

+

Example:

+
icon-paste {
+    expand: false;
+    filename: "gtk-paste";
+    size: 24;
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

button

+

This is a textbox widget that can have a 'clickable' action. +The action can be set to: +keybinding: accepts a keybinding name and completes that action. (see rofi -show keys for a list).

+
button-paste {
+    expand: false;
+    content: "My Clickable Message";
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

Children

+

To specify children, set the children +property (this always happens on the box child, see example below):

+
inputbar {
+  children: [prompt,entry,overlay,case-indicator];
+}
+
+

The theme needs to be updated to match the hierarchy specified.

+

Below is an example of a theme emulating dmenu:

+
* {
+    background-color:      Black;
+    text-color:            White;
+    border-color:          White;
+    font:            "Times New Roman 12";
+}
+
+window {
+    anchor:     north;
+    location:   north;
+    width:      100%;
+    padding:    4px;
+    children:   [ horibox ];
+}
+
+horibox {
+    orientation: horizontal;
+    children:   [ prompt, entry, listview ];
+}
+
+listview {
+    layout:     horizontal;
+    spacing:    5px;
+    lines:      10;
+}
+
+entry {
+    expand:     false;
+    width:      10em;
+}
+
+element {
+    padding: 0px 2px;
+}
+element selected {
+    background-color: SteelBlue;
+}
+
+

Padding and margin

+

Just like CSS, rofi uses the box model for each widget.

+
┌──────────────────────────────────────────────────────────────────┐
+│ margin                                                           │
+│  ┌────────────────────────────────────────────────────────────┐  │
+│  │ border                                                     │  │
+│  │ ┌────────────────────────────────────────────────────────┐ │  │
+│  │ │ padding                                                │ │  │
+│  │ │ ┌────────────────────────────────────────────────────┐ │ │  │
+│  │ │ │ content                                            │ │ │  │
+│  │ │ └────────────────────────────────────────────────────┘ │ │  │
+│  │ └────────────────────────────────────────────────────────┘ │  │
+│  └────────────────────────────────────────────────────────────┘  │
+└──────────────────────────────────────────────────────────────────┘
+
+

Explanation of the different parts:

+
    +
  • Content - The content of the widget.
  • +
  • Padding - Clears an area around the widget. + The padding shows the background color of the widget.
  • +
  • Border - A border that goes around the padding and content. + The border use the border-color of the widget.
  • +
  • Margin - Clears an area outside the border. + The margin is transparent.
  • +
+

The box model allows us to add a border around elements, and to define space between elements.

+

The size of each margin, border, and padding can be set. +For the border, a linestyle and radius can be set.

+

Spacing

+

Widgets that can pack more then one child widget (currently box and listview) have the spacing property. +This property sets the distance between the packed widgets (both horizontally and vertically).

+
┌───────────────────────────────────────┐
+│ ┌────────┐ s ┌────────┐ s ┌────────┐  │
+│ │ child  │ p │ child  │ p │ child  │  │
+│ │        │ a │        │ a │        │  │
+│ │        │ c │        │ c │        │  │
+│ │        │ i │        │ i │        │  │
+│ │        │ n │        │ n │        │  │
+│ └────────┘ g └────────┘ g └────────┘  │
+└───────────────────────────────────────┘
+
+

Advanced box packing

+

More dynamic spacing can be achieved by adding dummy widgets, for example to make one widget centered:

+
┌────────────────────────────────────────────────────┐
+│  ┌───────────────┐  ┌────────┐  ┌───────────────┐  │
+│  │ dummy         │  │ child  │  │ dummy         │  │
+│  │ expand: true; │  │        │  │ expand: true; │  │
+│  │               │  │        │  │               │  │
+│  │               │  │        │  │               │  │
+│  │               │  │        │  │               │  │
+│  └───────────────┘  └────────┘  └───────────────┘  │
+└────────────────────────────────────────────────────┘
+
+

If both dummy widgets are set to expand, child will be centered. Depending on the expand flag of child the +remaining space will be equally divided between both dummy and child widget (expand enabled), or both dummy widgets +(expand disabled).

+

DEBUGGING

+

To get debug information from the parser, run rofi like:

+
G_MESSAGES_DEBUG=Parser rofi -show run
+
+

Syntax errors are shown in a popup and printed out to command line with the above command.

+

To see the elements queried during running, run:

+
G_MESSAGES_DEBUG=Theme rofi -show run
+
+

To test minor changes, part of the theme can be passed on the command line, for example to set it to full-screen:

+
rofi -theme-str 'window { fullscreen:true;}' -show run
+
+

Another syntax to modify theme properties is:

+
rofi -theme+window+fullscreen true -show run
+
+

To print the current theme, run:

+
rofi -dump-theme
+
+

Media support

+

Parts of the theme can be conditionally loaded, like the CSS @media option.

+
@media ( min-width: 120 ) {
+
+}
+
+

It supports the following keys as constraint:

+
    +
  • min-width: load when width is bigger or equal then value.
  • +
  • max-width: load when width is smaller then value.
  • +
  • min-height: load when height is bigger or equal then value.
  • +
  • max-height: load when height is smaller then value.
  • +
  • min-aspect-ratio load when aspect ratio is over value.
  • +
  • max-aspect-ratio: load when aspect ratio is under value.
  • +
  • monitor-id: The monitor id, see rofi -help for id's.
  • +
  • enabled: Boolean option to enable. Supports environment variable.
  • +
+

@media takes an integer number or a fraction, for integer number px can be added.

+
@media ( min-width: 120 px ) {
+
+}
+
+
@media ( enabled: env(DO_LIGHT, false ) {
+
+}
+
+

Font Parsing

+

Rofi uses pango for font rendering. The font should be specified in a format that pango +understands. +This normally is the font name followed by the font size. For example:

+
mono 18
+
+

Or

+
FontAwesome 22
+
+

Icon Handling

+

Rofi supports 3 ways of specifying an icon:

+
    +
  • Filename
  • +
  • icon-name, this is looked up via the icon-theme.
  • +
  • Markup String. It renders a string as an icon.
  • +
+

For the first two options, GdkPixbuf is used to open and render the icons. +This in general gives support for most required image formats. +For the string option it uses Pango to render the string. The string needs to +start with a <span tag, that allows you to set color and font.

+

Markup string:

+
echo -en "testing\0icon\x1f<span color='red'>⏻</span>" | ./rofi -dmenu
+
+

Getting supported icon formats:

+
G_MESSAGES_DEBUG=Helpers.IconFetcher rofi
+
+

This uses the debug framework and prints out a list of supported image file +extensions.

+

Multiple file handling

+

The rasi file format offers two methods of including other files. +This can be used to modify existing themes, or have multiple variations on a theme.

+
    +
  • import: Import and parse a second file.
  • +
  • theme: Discard theme, and load file as a fresh theme.
  • +
+

Syntax:

+
@import "myfile"
+@theme "mytheme"
+
+

The specified file can either by name, filename,full path.

+

If a filename is provided, it will try to resolve it in the following order:

+
    +
  • ${XDG_CONFIG_HOME}/rofi/themes/
  • +
  • ${XDG_CONFIG_HOME}/rofi/
  • +
  • ${XDG_DATA_HOME}/rofi/themes/
  • +
  • ${INSTALL PREFIX}/share/rofi/themes/
  • +
+

A name is resolved as a filename by appending the .rasi extension.

+

EXAMPLES

+

Several examples are installed together with rofi. These can be found in {datadir}/rofi/themes/, where +{datadir} is the install path of rofi data. When installed using a package manager, this is usually: /usr/share/.

+

SEE ALSO

+

rofi(1), rofi-script(5), rofi-theme-selector(1)

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.3/rofi.1/index.html b/1.7.3/rofi.1/index.html new file mode 100644 index 00000000..997df726 --- /dev/null +++ b/1.7.3/rofi.1/index.html @@ -0,0 +1,2624 @@ + + + + + + + + + + + + + + + + + + + + + + Rofi - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

ROFI 1 rofi

+

NAME

+

rofi - A window switcher, application launcher, ssh dialog, dmenu replacement and more

+

SYNOPSIS

+

rofi [ -show mode ]|[ -dmenu ]|[ -e msg ] [ CONFIGURATION ]

+

DESCRIPTION

+

rofi is an X11 pop-up window switcher, run dialog, dmenu replacement, and +more. It focuses on being fast to use and have minimal distraction. It supports +keyboard and mouse navigation, type to filter, tokenized search and more.

+

USAGE

+

rofi's main functionality is to assist in your workflow, allowing you to +quickly switch between windows, start applications or log into a remote machine +via ssh. There are different modes for different types of actions. rofi +is a standalone application and should not be integrated into scripts. For +integration into scripts it has a special mode that functions as a (drop-in) +replacement for dmenu(1). See emulating dmenu below.

+

Running rofi

+

To launch rofi directly in a certain mode, specify a mode with rofi -show <mode>. +To show the drun dialog:

+
    rofi -show drun
+
+

A very useful setup in minimalistic window managers is to combine drun, run +with window mode:

+
  rofi -show combi -modes combi -combi-modes "window,drun,run"
+
+

In this setup it first list all open applications, then all installed +applications. So if you type firefox and hit return, it will switch to the +running firefox, or launch it when it is not running.

+

Emulating dmenu

+

rofi can emulate dmenu(1) (a dynamic menu for X11) when launched with +the -dmenu flag.

+

For more information see rofi-dmenu(5).

+

Display Error message

+

rofi error dialog can also be called from the command line.

+
rofi -e "my message"
+
+

Markup support can be enabled, see CONFIGURATION options.

+

CONFIGURATION

+

There are currently three methods of setting configuration options (evaluated in order below):

+
    +
  • System configuration file (for example /etc/rofi.rasi). + It first checks XDG_CONFIG_DIRS, and then SYSCONFDIR (that is passed at compile time). + It loads the first config file it finds, it does not merge multiple system configuration files.
  • +
  • Rasi theme file: The new theme format can be used to set configuration values.
  • +
  • Command-line options: Arguments passed to rofi.
  • +
+

To get a template config file, run: rofi -dump-config > config.rasi

+

This will contain (commented) all current configuration options, modified options are uncommented.

+

To get a template config file that sets the icon-theme run: rofi -icon-theme hicolor -dump-config.

+

It is strongly recommended to use this as a starting point for your configuration.

+

An empty configuration section in the config file looks like:

+
configuration {
+ // set config options here
+}
+
+

Most of the configuration options mentioned below (beside options like -show, +-dump-config that apply to a single run) can be set here.

+

For example to set the dpi value to 72:

+
configuration {
+    dpi: 72;
+}
+
+

The configuration system supports the following types:

+
    +
  • string
  • +
  • integer (signed and unsigned)
  • +
  • char
  • +
  • boolean
  • +
  • lists
  • +
+

For the syntax of these options, see the rofi-theme(5) manpage.

+

For use on the command line, Boolean options have a non-default command-line +syntax. Example to enable option X:

+
-X
+
+

To disable option X:

+
-no-X
+
+

Below is a list of the most important options:

+

General

+

-help

+

The help option shows the full list of command-line options and the current set +values. These include dynamic (run-time generated) options.

+

-version

+

Show the rofi version and exit.

+

-dump-config

+

Dump the current active configuration, in rasi format, to stdout and exit. +Information about the rasi format can be found in the rofi-theme(5) manpage.

+

-dump-theme

+

Dump the current active theme, in rasi format, to stdout and exit.

+

-rasi-validate filename

+

Try to parse the file and return 0 when successful, non-zero when failed.

+

-list-keybindings

+

List all known keybindings without trying to parse them. This can be used to +look for duplicate bindings.

+

-threads num

+

Specify the number of threads rofi should use:

+
    +
  • 0: Autodetect the number of supported hardware threads.
  • +
  • 1: Disable threading
  • +
  • +

    2..n: Specify the maximum number of threads to use in the thread pool.

    +

    Default: Autodetect

    +
  • +
+

-display display

+

The X server to contact. Default is $DISPLAY.

+

-dmenu

+

Run rofi in dmenu mode. This allows for interactive scripts. +In dmenu mode, rofi reads from STDIN, and output to STDOUT. +A simple example, displaying three pre-defined options:

+
echo -e "Option #1\nOption #2\nOption #3" | rofi -dmenu
+
+

Or get the options from a script:

+
~/my_script.sh | rofi -dmenu
+
+

See the rofi-dmenu(5) manpage for more information.

+

-show mode

+

Open rofi in a certain mode. Available modes are window, run, drun, +ssh, combi. The special argument keys can be used to open a searchable +list of supported key bindings +(see the rofi-keys(5) manpage)

+

To show the run-dialog:

+
rofi -show run
+
+

If -show is the last option passed to rofi, the first enabled modes is shown.

+

-modes mode1,mode2

+

Specify an ordered, comma-separated list of modes to enable. +Enabled modes can be changed at runtime. Default key is Ctrl+Tab. +If no modes are specified, all configured modes will be enabled. +To only show the run and ssh launcher:

+
rofi -modes "run,ssh" -show run
+
+

Custom modes can be added using the internal script mode. Each such mode has +two parameters:

+
<name>:<script>
+
+

Example: Have a mode called 'Workspaces' using the i3_switch_workspaces.sh script:

+
rofi -modes "window,run,ssh,Workspaces:i3_switch_workspaces.sh" -show Workspaces
+
+

Notes: The i3 window manager dislikes commas in the command when specifying an +exec command. For that case, # can be used as a separator.

+

TIP: The name is allowed to contain spaces:

+
rofi -modes "My File Browser:fb.sh" -show "My File Browser"
+
+

-case-sensitive

+

Start in case-sensitive mode. +This option can be changed at run-time using the -kb-toggle-case-sensitivity key binding.

+

-cycle

+

Cycle through the result list. Default is 'true'.

+

-filter filter

+

Filter the list by setting text in input bar to filter

+

-config filename

+

Load an alternative configuration file.

+

-cache-dir filename

+

Directory that is used to place temporary files, like history.

+

-scroll-method method

+

Select the scrolling method. 0: Per page, 1: continuous.

+

-normalize-match

+

Normalize the string before matching, so o will match ö, and é matches e.
+This is not a perfect implementation, but works. For now, it disables highlighting of the matched part.

+

-no-lazy-grab

+

Disables lazy grab, this forces the keyboard being grabbed before gui is shown.

+

-no-plugins

+

Disable plugin loading.

+

-plugin-path directory

+

Specify the directory where rofi should look for plugins.

+

-show-icons

+

Show application icons in drun and window modes.

+

-icon-theme

+

Specify icon theme to be used. +If not specified default theme from DE is used, Adwaita and gnome themes act as +fallback themes.

+

-markup

+

Use Pango markup to format output wherever possible.

+

-normal-window

+

Make rofi react like a normal application window. Useful for scripts like Clerk that are basically an application.

+

-[no-]steal-focus

+

Make rofi steal focus on launch and restore close to window that held it when launched.

+

-refilter-timeout-limit

+

The time (in ms) boundary filter may take before switch from instant to delayed filter mode.

+

Default: 300

+

A fallback icon can be specified for each mode:

+
configuration {
+    <mode>{
+      fallback-icon: "<icon name>";
+    }
+}
+
+

Example

+
configuration {
+    run,drun {
+      fallback-icon: "application-x-addon";
+    }
+}
+
+

Matching

+

-matching method

+

Specify the matching algorithm used. +Currently, the following methods are supported:

+
    +
  • normal: match the int string
  • +
  • regex: match a regex input
  • +
  • glob: match a glob pattern
  • +
  • fuzzy: do a fuzzy match
  • +
  • prefix: match prefix
  • +
+

Default: normal

+

Note: glob matching might be slow for larger lists

+

-tokenize

+

Tokenize the input.

+

-drun-categories category1,category2

+

Only show desktop files that are present in the listed categories.

+

-drun-match-fields field1,field2,...

+

When using drun, match only with the specified Desktop entry fields. +The different fields are:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
  • +

    all: all the above

    +

    Default: name,generic,exec,categories,keywords

    +
  • +
+

-drun-display-format

+

The format string for the drun dialog:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
+

Pango markup can be used to formatting the output.

+
Default: {name} [<span weight='light' size='small'><i>({generic})</i></span>]
+
+

Note: Only fields enabled in -drun-match-fields can be used in the format string.

+

-[no-]drun-show-actions

+

Show actions present in the Desktop files.

+
Default: false
+
+

-window-match-fields field1,field2,...

+

When using window mode, match only with the specified fields. +The different fields are:

+
    +
  • title: window's title
  • +
  • class: window's class
  • +
  • role: window's role
  • +
  • name: window's name
  • +
  • desktop: window's current desktop
  • +
  • +

    all: all the above

    +

    Default: all

    +
  • +
+

-matching-negate-char char

+

Set the character used to negate the query (i.e. if it does not match the next keyword). +Set to '\x0' to disable.

+
Default: '-'
+
+

Layout and Theming

+

IMPORTANT: + In newer rofi releases, all the theming options have been moved into the new theme format. They are no longer normal + rofi options that can be passed directly on the command line (there are too many). + Small snippets can be passed on the command line: rofi -theme-str 'window {width: 50%;}' to override a single + setting. They are merged into the current theme. + They can also be appended at the end of the rofi config file to override parts of the theme.

+

Most of the following options are deprecated and should not be used. Please use the new theme format to customize +rofi. More information about the new format can be found in the rofi-theme(5) manpage.

+

-location

+

Specify where the window should be located. The numbers map to the following locations on screen:

+
  1 2 3
+  8 0 4
+  7 6 5
+
+

Default: 0

+

-fixed-num-lines

+

Keep a fixed number of visible lines.

+

-sidebar-mode

+

Open in sidebar-mode. In this mode, a list of all enabled modes is shown at the bottom. +(See -modes option) +To show sidebar, use:

+
rofi -show run -sidebar-mode
+
+

-hover-select

+

Automatically select the entry the mouse is hovering over. This option is best combined with custom mouse bindings. +To utilize hover-select and accept an entry in a single click, use:

+
rofi -show run -hover-select -me-select-entry '' -me-accept-entry MousePrimary
+
+

-eh number

+

Set row height (in chars) +Default: 1

+

-auto-select

+

When one entry is left, automatically select it.

+

-m num

+

-m name

+

-monitor num

+

-monitor name

+

Select monitor to display rofi on. +It accepts as input: primary (if primary output is set), the xrandr output name, or integer number (in order of +detection). Negative numbers are handled differently:

+
    +
  • -1: the currently focused monitor.
  • +
  • -2: the currently focused window (that is, rofi will be displayed on top of the focused window).
  • +
  • -3: Position of mouse (overrides the location setting to get normal context menu + behavior.)
  • +
  • -4: the monitor with the focused window.
  • +
  • +

    -5: the monitor that shows the mouse pointer.

    +

    Default: -5

    +
  • +
+

See rofi -h output for the detected monitors, their position, and size.

+

-theme filename

+

Path to the new theme file format. This overrides the old theme settings.

+

-theme-str string

+

Allow theme parts to be specified on the command line as an override.

+

For example:

+
rofi -theme-str '#window { fullscreen: true; }'
+
+

This option can be specified multiple times. +This is now the method to tweak the theme via the command line.

+

-dpi number

+

Override the default DPI setting.

+
    +
  • If set to 0, it tries to auto-detect based on X11 screen size (similar to i3 and GTK).
  • +
  • If set to 1, it tries to auto-detect based on the size of the monitor that rofi is displayed on (similar to latest Qt 5).
  • +
+

-selected-row selected row

+

Select a certain row.

+

Default: 0

+

PATTERN setting

+

-terminal

+

Specify which terminal to start.

+
rofi -terminal xterm
+
+

Pattern: {terminal}

+

Default: x-terminal-emulator

+

-ssh-client client

+

Override the used ssh client.

+

Pattern: {ssh-client}

+

Default: ssh

+

SSH settings

+

-ssh-command cmd

+

Set the command to execute when starting an ssh session. +The pattern {host} is replaced by the selected ssh entry.

+

Pattern: {ssh-client}

+

Default: {terminal} -e {ssh-client} {host}

+

-parse-hosts

+

Parse the /etc/hosts file for entries.

+

Default: disabled

+

-parse-known-hosts +-no-parse-known-hosts

+

Parse the ~/.ssh/known_hosts file for entries.

+

Default: enabled

+

Run settings

+

-run-command cmd

+

Set command ({cmd}) to execute when running an application. +See PATTERN.

+

Default: {cmd}

+

Example to run applications in a dedicated cgroup with systemd. Requires a shell to escape and interpolate the unit name correctly.

+
"bash -c 'systemd-run --user --unit=app-rofi-\$(systemd-escape {cmd})-\$RANDOM {cmd}'"
+
+

-run-shell-command cmd

+

Set command to execute when running an application in a shell. +See PATTERN.

+

Default: {terminal} -e {cmd}

+

-run-list-command cmd

+

If set, use an external tool to generate a list of executable commands. Uses run-command.

+

Default: {cmd}

+

Window switcher settings

+

-window-format format

+

Format what is being displayed for windows.

+

format: {field[:len]}

+

field:

+
    +
  • w: desktop name
  • +
  • t: title of window
  • +
  • n: name
  • +
  • r: role
  • +
  • c: class
  • +
+

len: maximum field length (0 for auto-size). If length is negative, the entry will be unchanged. +If length is positive, the entry will be truncated or padded to fill that length.

+

default: {w} {c} {t}

+

-window-command cmd

+

Set command to execute on selected window for an alt action (-kb-accept-alt). +See PATTERN.

+

Default: "wmctrl -i -R {window}"

+

-window-thumbnail

+

Show window thumbnail (if available) as icon in the window switcher.

+

You can stop rofi from exiting when closing a window (allowing multiple to be closed in a row).

+
configuration {
+  window {
+      close-on-delete: false;
+  }
+}
+
+

You can hide the currently active window with the 'hide-active-window' setting:

+
configuration {
+  window {
+      hide-active-window: true;
+  }
+}
+
+

or pass -window-hide-active-window true on command line.

+

You can prefer the icon theme above the window set icon with the 'prefer-icon-theme' setting:

+
configuration {
+  window {
+      prefer-icon-theme: true;
+  }
+}
+
+

or pass -window-prefer-icon-theme true on command line.

+

Combi settings

+

-combi-modes mode1,mode2

+

The modes to combine in combi mode. +For syntax to -combi-modes, see -modes. +To get one merge view, of window,run, and ssh:

+
rofi -show combi -combi-modes "window,run,ssh" -modes combi
+
+

NOTE: The i3 window manager dislikes commas in the command when specifying an exec command. +For that case, # can be used as a separator.

+

-combi-display-format

+

The format string for entries in the combi dialog:

+
    +
  • mode: the mode display name
  • +
  • text: the entry text
  • +
+

Pango markup can be used to formatting the output.

+
Default: {mode} {text}
+
+

Note: This setting is ignored if combi-hide-mode-prefix is enabled.

+

History and Sorting

+

-disable-history +-no-disable-history (re-enable history)

+

Disable history

+

-sort to enable +-no-sort to disable

+

Enable, disable sorting. +This setting can be changed at runtime (see -kb-toggle-sort).

+

-sorting-method 'method' to specify the sorting method.

+

There are 2 sorting methods:

+
    +
  • levenshtein (Default)
  • +
  • fzf sorting.
  • +
+

-max-history-size number

+

Maximum number of entries to store in history. Defaults to 25. (WARNING: can cause slowdowns when set too high)

+

Message dialog

+

-e message

+

Pops up a message dialog (used internally for showing errors) with message. +Message can be multi-line.

+

File browser settings

+

File browser behavior can be controlled via the following options:

+
configuration {
+   filebrowser {
+      /** Directory the file browser starts in. */
+      directory: "/some/directory";
+      /**
+        * Sorting method. Can be set to:
+        *   - "name"
+        *   - "mtime" (modification time)
+        *   - "atime" (access time)
+        *   - "ctime" (change time)
+        */
+      sorting-method: "name";
+      /** Group directories before files. */
+      directories-first: true;
+      /** Show hidden files. */
+      show-hidden: false;
+   }
+}
+
+

The show-hidden can also be triggered with the kb-delete-entry keybinding.

+

Other

+

-drun-use-desktop-cache

+

Build and use a cache with the content of desktop files. Usable for systems with slow hard drives.

+

-drun-reload-desktop-cache

+

If drun-use-desktop-cache is enabled, rebuild a cache with the content of desktop files.

+

-drun-url-launcher command

+

Command to open a Desktop Entry that is a Link.

+

-pid path

+

Make rofi create a pid file and check this on startup. The pid file prevents multiple rofi instances from running simultaneously. This is useful when running rofi from a key-binding daemon.

+

-replace

+

If rofi is already running, based on pid file, try to kill that instance.

+

-display-{mode} string

+

Set the name to use for mode. This is used as prompt and in combi-browser.

+

It is now preferred to use the configuration file:

+
configuration {
+  {mode} {
+    display-name: *string*;
+  }
+}
+
+

-click-to-exit +-no-click-to-exit

+

Click the mouse outside the rofi window to exit.

+

Default: enabled

+

-xserver-i300-workaround

+

Workaround for bug in Xserver. See issue #611 and #1642 on the rofi issue tracker.

+

Default: disabled

+

PATTERN

+

To launch commands (for example, when using the ssh launcher), the user can enter the used command-line. The following keys can be used that will be replaced at runtime:

+
    +
  • {host}: the host to connect to
  • +
  • {terminal}: the configured terminal (see -terminal)
  • +
  • {ssh-client}: the configured ssh client (see -ssh-client)
  • +
  • {cmd}: the command to execute
  • +
  • {window}: the window ID of the selected window (in window-command)
  • +
+

THEMING

+

Please see rofi-theme(5) manpage for more information on theming.

+

KEY BINDINGS

+

Please see the rofi-keys(5) manpage for the keybindings and how to set them up.

+

The keybinding can also be used for actions, when the action is executed the +mentioned keystroke is inserted:

+

Timeout

+

You can configure an action to be taken when rofi has not been interacted +with for a certain amount of seconds. You can specify a keybinding to trigger +after X seconds.

+
configuration {
+  timeout {
+      delay:  15;
+      action: "kb-cancel";
+  }
+}
+
+

Input change

+

When the input of the textbox changes:

+
configuration {
+  inputchange {
+      action: "kb-row-first";
+  }
+}
+
+

Available Modes

+

window

+

Show a list of all the windows and allow switching between them. +Pressing the delete-entry binding (shift-delete) will close the window. +Pressing the accept-custom binding (control-enter or shift-enter) will run a command on the window. +(See option window-command );

+

If there is no match, it will try to launch the input.

+

windowcd

+

Shows a list of the windows on the current desktop and allows switching between them. +Pressing the delete-entry binding (shift-delete) will kill the window. +Pressing the accept-custom binding (control-enter or shift-enter) will run a command on the window. +(See option window-command );

+

If there is no match, it will try to launch the input.

+

run

+

Shows a list of executables in $PATH and can launch them (optional in a terminal). +Pressing the delete-entry binding (shift-delete) will remove this entry from the run history. +Pressing the accept-custom binding (control-enter) will run the command as entered in the entry box. +Pressing the accept-alt binding (shift-enter) will run the command in a terminal.

+

When pressing the mode-complete binding (Control-l), you can use the File Browser mode to launch the application +with a file as the first argument.

+

drun

+

Same as the run launches, but the list is created from the installed desktop files. It automatically launches them +in a terminal if specified in the Desktop File. +Pressing the delete-entry binding (shift-delete) will remove this entry from the run history. +Pressing the accept-custom binding (control-enter) will run the command as entered in the entry box. +Pressing the accept-alt binding (shift-enter) will run the command in a terminal.

+

When pressing the mode-complete binding (Control-l), you can use the File Browser mode to launch the application +passing a file as argument if specified in the desktop file.

+

The DRUN mode tries to follow the XDG Desktop Entry +Specification and should be compatible with +applications using this standard. Some applications create invalid desktop files, rofi will discard these entries. +See the debugging section for more info on DRUN mode, this will print why desktop files are +discarded.

+

There are two advanced options to tweak the behaviour:

+
configuration {
+   drun {
+      /** Parse user desktop files. */
+      parse-user:   true;
+      /** Parse system desktop files. */
+      parse-system: false;
+   }
+}
+
+

ssh

+

Shows a list of SSH targets based on your ssh config file, and allows to quickly ssh into them.

+

keys

+

Shows a searchable list of key bindings.

+

script

+

Allows custom scripted Modes to be added, see the rofi-script(5) manpage for more information.

+

combi

+

Combines multiple modes in one list. Specify which modes are included with the -combi-modes option.

+

When using the combi mode, a !bang can be used to filter the results by modes. +All modes that match the bang as a prefix are included. +For example, say you have specified -combi-modes run,window,windowcd. If your +query begins with the bang !w, only results from the window and windowcd +modes are shown, even if the rest of the input text would match results from run.

+

If no match, the input is handled by the first combined modes.

+

FAQ

+

The text in the window switcher is not nicely aligned.

+

Try using a mono-space font or tabs + the tab-stops setting..

+

The window is completely black.

+

Check quotes used on the command-line: you might have used ("smart quotes") instead of " ("machine quotes").

+

What does the icon in the top right show?

+

The indicator shows:

+
` ` Case insensitive and no sorting.
+`-` Case sensitivity enabled, no sorting.
+`+` Case insensitive and Sorting enabled
+`±` Sorting and Case sensitivity enabled"
+
+

Why do I see different icons for run,drun and window mode

+

Each of these modes uses different methods of resolving the icon:

+
    +
  • Window: It first uses the icon that the application exposes via the X11 + Server, if none is set it does a lookup of the window Class name in the icon theme.
  • +
  • drun: It uses the icon set in the desktop file.
  • +
  • run: It does a lookup using the executable name.
  • +
+

EXAMPLES

+

Some basic usage examples of rofi:

+

Show the run dialog:

+
rofi -modes run -show run
+
+

Show the run dialog, and allow switching to Desktop File run dialog (drun):

+
rofi -modes run,drun -show run
+
+

Combine the run and Desktop File run dialog (drun):

+
rofi -modes combi -show combi -combi-modes run,drun
+
+

Combine the run and Desktop File run dialog (drun), and allow switching to window switcher:

+
rofi -modes combi,window -show combi -combi-modes run,drun
+
+

Pop up a text message claiming that this is the end:

+
rofi -e "This is the end"
+
+

Pop up a text message in red, bold font claiming that this is still the end:

+
rofi -e "<span color='red'><b>This is still the end</b></span>" -markup
+
+

Show all key bindings:

+
rofi -show keys
+
+

i3

+

In i3 you want to bind rofi to be launched on key release. Otherwise, it cannot grab the keyboard. +See also the i3 manual:

+

Some tools (such as import or xdotool) might be unable to run upon a KeyPress event, because the keyboard/pointer is +still grabbed. For these situations, the --release flag can be used, as it will execute the command after the keys have +been released.

+

LICENSE

+
MIT/X11
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+

WEBSITE

+

rofi website can be found here

+

SUPPORT

+

rofi support can be obtained: + * GitHub Discussions + * IRC (#rofi on irc.libera.chat),

+

DEBUGGING

+

For more information see rofi-debugging(5) manpage.

+

ISSUE TRACKER

+

The rofi issue tracker can be found here +Before creating an issue, consider posting a question on the discussion forum first. +When creating an issue, please read this +first.

+

SEE ALSO

+

rofi-sensible-terminal(1), dmenu(1), rofi-debugging(5), rofi-theme(5), rofi-script(5), rofi-keys(5),rofi-theme-selector(1),rofi-dmenu(5)

+

AUTHOR

+ +

Original code based on work by: Sean Pringle sean.pringle@gmail.com

+

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

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.4/rofi-debugging.5/index.html b/1.7.4/rofi-debugging.5/index.html new file mode 100644 index 00000000..39c13dc2 --- /dev/null +++ b/1.7.4/rofi-debugging.5/index.html @@ -0,0 +1,1430 @@ + + + + + + + + + + + + + + + + + + + + + + Debugging - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI DEBUGGING 5 rofi debugging

+

NAME

+

Debugging rofi.

+

When reporting an issue with rofi crashing, or misbehaving. It helps to do some small test +to help pin-point the problem.

+

First try disabling your custom configuration: -no-config

+

This disables the parsing of the configuration files. This runs rofi in stock mode.

+

If you run custom C plugins, you can disable the plugins using: -no-plugins

+

Get the relevant information for an issue

+

Please pastebin the output of the following commands:

+
rofi -help
+rofi -dump-config
+rofi -dump-theme
+
+

rofi -help provides us with the configuration files parsed, the exact version, monitor layout +and more useful information.

+

The rofi -dump-config and rofi -dump-theme output gives us rofi +interpretation of your configuration and theme.

+

Please check the output for identifiable information and remove this.

+

Timing traces

+

To get a timing trace, enable the Timings debug domain.

+
G_MESSAGES_DEBUG=Timings rofi -show drun
+
+

It will show a trace with (useful) timing information at relevant points during the execution. +This will help debugging when rofi is slow to start.

+

Example trace:

+
(process:14942): Timings-DEBUG: 13:47:39.335: 0.000000 (0.000000): Started
+(process:14942): Timings-DEBUG: 13:47:39.335: 0.000126 (0.000126): ../source/rofi.c:main:786 
+(process:14942): Timings-DEBUG: 13:47:39.335: 0.000163 (0.000037): ../source/rofi.c:main:819 
+(process:14942): Timings-DEBUG: 13:47:39.336: 0.000219 (0.000056): ../source/rofi.c:main:826 Setup Locale
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001235 (0.001016): ../source/rofi.c:main:828 Collect MODI
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001264 (0.000029): ../source/rofi.c:main:830 Setup MODI
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001283 (0.000019): ../source/rofi.c:main:834 Setup mainloop
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001369 (0.000086): ../source/rofi.c:main:837 NK Bindings
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001512 (0.000143): ../source/xcb.c:display_setup:1177 Open Display
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001829 (0.000317): ../source/xcb.c:display_setup:1192 Setup XCB
+(process:14942): Timings-DEBUG: 13:47:39.346: 0.010650 (0.008821): ../source/rofi.c:main:844 Setup Display
+(process:14942): Timings-DEBUG: 13:47:39.346: 0.010715 (0.000065): ../source/rofi.c:main:848 Setup abe
+(process:14942): Timings-DEBUG: 13:47:39.350: 0.015101 (0.004386): ../source/rofi.c:main:883 Load cmd config 
+(process:14942): Timings-DEBUG: 13:47:39.351: 0.015275 (0.000174): ../source/rofi.c:main:907 Setup Modi
+(process:14942): Timings-DEBUG: 13:47:39.351: 0.015291 (0.000016): ../source/view.c:rofi_view_workers_initialize:1922 Setup Threadpool, start
+(process:14942): Timings-DEBUG: 13:47:39.351: 0.015349 (0.000058): ../source/view.c:rofi_view_workers_initialize:1945 Setup Threadpool, done
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032018 (0.016669): ../source/rofi.c:main:1000 Setup late Display
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032080 (0.000062): ../source/rofi.c:main:1003 Theme setup
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032109 (0.000029): ../source/rofi.c:startup:668 Startup
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032121 (0.000012): ../source/rofi.c:startup:677 Grab keyboard
+(process:14942): Timings-DEBUG: 13:47:39.368: 0.032214 (0.000093): ../source/view.c:__create_window:701 xcb create window
+(process:14942): Timings-DEBUG: 13:47:39.368: 0.032235 (0.000021): ../source/view.c:__create_window:705 xcb create gc
+(process:14942): Timings-DEBUG: 13:47:39.368: 0.033136 (0.000901): ../source/view.c:__create_window:714 create cairo surface
+(process:14942): Timings-DEBUG: 13:47:39.369: 0.033286 (0.000150): ../source/view.c:__create_window:723 pango cairo font setup
+(process:14942): Timings-DEBUG: 13:47:39.369: 0.033351 (0.000065): ../source/view.c:__create_window:761 configure font
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045896 (0.012545): ../source/view.c:__create_window:769 textbox setup
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045944 (0.000048): ../source/view.c:__create_window:781 setup window attributes
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045955 (0.000011): ../source/view.c:__create_window:791 setup window fullscreen
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045966 (0.000011): ../source/view.c:__create_window:797 setup window name and class
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045974 (0.000008): ../source/view.c:__create_window:808 setup startup notification
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045981 (0.000007): ../source/view.c:__create_window:810 done
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045992 (0.000011): ../source/rofi.c:startup:679 Create Window
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045999 (0.000007): ../source/rofi.c:startup:681 Parse ABE
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.046113 (0.000114): ../source/rofi.c:startup:684 Config sanity check
+(process:14942): Timings-DEBUG: 13:47:39.384: 0.048229 (0.002116): ../source/dialogs/run.c:get_apps:216 start
+(process:14942): Timings-DEBUG: 13:47:39.390: 0.054626 (0.006397): ../source/dialogs/run.c:get_apps:336 stop
+(process:14942): Timings-DEBUG: 13:47:39.390: 0.054781 (0.000155): ../source/dialogs/drun.c:get_apps:634 Get Desktop apps (start)
+(process:14942): Timings-DEBUG: 13:47:39.391: 0.055264 (0.000483): ../source/dialogs/drun.c:get_apps:641 Get Desktop apps (user dir)
+(process:14942): Timings-DEBUG: 13:47:39.418: 0.082884 (0.027620): ../source/dialogs/drun.c:get_apps:659 Get Desktop apps (system dirs)
+(process:14942): Timings-DEBUG: 13:47:39.418: 0.082944 (0.000060): ../source/dialogs/drun.c:get_apps_history:597 Start drun history
+(process:14942): Timings-DEBUG: 13:47:39.418: 0.082977 (0.000033): ../source/dialogs/drun.c:get_apps_history:617 Stop drun history
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083638 (0.000661): ../source/dialogs/drun.c:get_apps:664 Sorting done.
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083685 (0.000047): ../source/view.c:rofi_view_create:1759 
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083700 (0.000015): ../source/view.c:rofi_view_create:1783 Startup notification
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083711 (0.000011): ../source/view.c:rofi_view_create:1786 Get active monitor
+(process:14942): Timings-DEBUG: 13:47:39.420: 0.084693 (0.000982): ../source/view.c:rofi_view_refilter:1028 Filter start
+(process:14942): Timings-DEBUG: 13:47:39.421: 0.085992 (0.001299): ../source/view.c:rofi_view_refilter:1132 Filter done
+(process:14942): Timings-DEBUG: 13:47:39.421: 0.086090 (0.000098): ../source/view.c:rofi_view_update:982 
+(process:14942): Timings-DEBUG: 13:47:39.421: 0.086123 (0.000033): ../source/view.c:rofi_view_update:1002 Background
+(process:14942): Timings-DEBUG: 13:47:39.428: 0.092864 (0.006741): ../source/view.c:rofi_view_update:1008 widgets
+
+

Debug domains

+

To further debug the plugin, you can get a trace with (lots of) debug information. This debug output can be enabled for +multiple parts in rofi using the glib debug framework. Debug domains can be enabled by setting the G_MESSAGES_DEBUG +environment variable. At the time of creation of this page, the following debug domains exist:

+
    +
  • all: Show debug information from all domains.
  • +
  • X11Helper: The X11 Helper functions.
  • +
  • View: The main window view functions.
  • +
  • Widgets.Box: The Box widget.
  • +
  • Modes.DMenu: The dmenu mode.
  • +
  • Modes.Run: The run mode.
  • +
  • Modes.DRun: The desktop file run mode.
  • +
  • Modes.Window: The window mode.
  • +
  • Modes.Script: The script mode.
  • +
  • Modes.Combi: The script mode.
  • +
  • Modes.Ssh: The ssh mode.
  • +
  • Rofi: The main application.
  • +
  • Timings: Get timing output.
  • +
  • Theme: Theme engine debug output. (warning lots of output).
  • +
  • Widgets.Icon: The Icon widget.
  • +
  • Widgets.Box: The box widget.
  • +
  • Widgets.Container: The container widget.
  • +
  • Widgets.Window: The window widget.
  • +
  • Helpers.IconFetcher: Information about icon lookup.
  • +
+

For full list see man rofi.

+

Example: G_MESSAGES_DEBUG=Dialogs.DRun rofi -show drun To get specific output from the Desktop file run dialog.

+

To redirect the debug output to a file (~/rofi.log) add:

+
rofi -show drun -log ~/rofi.log
+
+

Specifying the logfile automatically enabled all log domains. +This can be useful when rofi is launched from a window manager.

+

Creating a backtrace.

+

First make sure you compile rofi with debug symbols:

+
make CFLAGS="-O0 -g3" clean rofi
+
+

Getting a backtrace using GDB is not very handy. Because if rofi get stuck, it grabs keyboard and +mouse. So if it crashes in GDB you are stuck. +The best way to go is to enable core file. (ulimit -c unlimited in bash) then make rofi crash. You +can then load the core in GDB.

+
gdb rofi core
+
+

Then type inside gdb:

+
thread apply all bt
+
+

The output trace is useful when reporting crashes.

+

Some distribution have systemd-coredump, this way you can easily get a backtrace via coredumpctl.

+

SEE ALSO

+

rofi-sensible-terminal(1), dmenu(1), rofi-debugging(5), rofi-theme(5), rofi-script(5), rofi-keys(5),rofi-theme-selector(1)

+

AUTHOR

+ + + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.4/rofi-dmenu.5/index.html b/1.7.4/rofi-dmenu.5/index.html new file mode 100644 index 00000000..da9569bd --- /dev/null +++ b/1.7.4/rofi-dmenu.5/index.html @@ -0,0 +1,1483 @@ + + + + + + + + + + + + + + + + + + + + + + Dmenu - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

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.

+

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).

+

BASIC CONCEPT

+

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.

+

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.

+

USAGE

+

By launching rofi with the -dmenu flag it will go into dmenu emulation mode.

+
ls | rofi -dmenu
+
+

DMENU DROP-IN REPLACEMENT

+

If argv[0] (calling command) is dmenu, rofi will start in dmenu mode. +This way, it can be used as a drop-in replacement for dmenu. Just copy or symlink rofi to dmenu in $PATH.

+
ln -s /usr/bin/rofi /usr/bin/dmenu
+
+

DMENU VS SCRIPT MODE

+

Script mode is used to extend rofi, dmenu mode is used to extend a script. +The two do share much of the same input format. Please see the rofi-script(5) manpage for more information.

+

DMENU SPECIFIC COMMANDLINE FLAGS

+

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.

+

-sep separator

+

Separator for dmenu. Example: To show a list of 'a' to 'e' with '|' as a separator:

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
+
+

-p prompt

+

Specify the prompt to show in dmenu mode. For example, select 'monkey', a,b,c,d, or e.

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey"
+
+

Default: dmenu

+

-l number of lines to show

+

Maximum number of lines the menu may show before scrolling.

+
rofi -dmenu -l 25
+
+

Default: 15

+

-i

+

Makes dmenu searches case-insensitive

+

-a X

+

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:

+
    +
  • 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'
  • +
+

-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

+

Allows the output of dmenu to be customized (N is the total number of input entries):

+
    +
  • '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)
  • +
+

Default: 's'

+

-select string

+

Select first line that matches the given string

+

-mesg string

+

Add a message line below the filter entry box. Supports Pango markup. +For more information on supported markup, see here

+

-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. +See here for details about Pango markup.

+

-multi-select

+

Allow multiple lines to be selected. Adds a small selection indicator to the left of each entry.

+

-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-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.

+

-display-columns

+

A comma seperated list of columns to show.

+

-display-column-separator

+

The column separator. This is a regex.

+

default: '\t'

+

-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.

+

default: "☐ "

+

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)

+

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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.4/rofi-keys.5/index.html b/1.7.4/rofi-keys.5/index.html new file mode 100644 index 00000000..f5f6f915 --- /dev/null +++ b/1.7.4/rofi-keys.5/index.html @@ -0,0 +1,2657 @@ + + + + + + + + + + + + + + + + + + + + + + Keys - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-KEYS 5 rofi-keys

+

NAME

+

rofi keys - Rofi Key and Mouse bindings

+

DESCRIPTION

+

rofi supports overriding of any of it key and mouse binding.

+

Setting binding

+

Bindings can be done on the commandline (-{bindingname}):

+
rofi -show run -kb-accept-entry 'Control+Shift+space'
+
+

or via the configuration file:

+
configuration {
+  kb-accept-entry: "Control+Shift+space";
+}
+
+

The key can be set by its name (see above) or its keycode:

+
configuration {
+  kb-accept-entry: "Control+Shift+[65]";
+}
+
+

An easy way to look up keycode is xev(1).

+

Multiple keys can be specified for an action as a comma separated list:

+
configuration {
+  kb-accept-entry: "Control+Shift+space,Return";
+}
+
+

By Default rofi reacts on pressing, to act on the release of all keys +prepend the binding with !:

+
configuration {
+  kb-accept-entry: "!Control+Shift+space,Return";
+}
+
+

Keyboard Bindings

+

kb-primary-paste:

+

Paste primary selection

+

Default: Control+V,Shift+Insert

+

kb-secondary-paste

+

Paste clipboard

+

Default: Control+v,Insert

+

kb-clear-line

+

Clear input line

+

Default: Control+w

+

kb-move-front

+

Beginning of line

+

Default: Control+a

+

kb-move-end

+

End of line

+

Default: Control+e

+

kb-move-word-back

+

Move back one word

+

Default: Alt+b,Control+Left

+

kb-move-word-forward

+

Move forward one word

+

Default: Alt+f,Control+Right

+

kb-move-char-back

+

Move back one char

+

Default: Left,Control+b

+

kb-move-char-forward

+

Move forward one char

+

Default: Right,Control+f

+

kb-remove-word-back

+

Delete previous word

+

Default: Control+Alt+h,Control+BackSpace

+

kb-remove-word-forward

+

Delete next word

+

Default: Control+Alt+d

+

kb-remove-char-forward

+

Delete next char

+

Default: Delete,Control+d

+

kb-remove-char-back

+

Delete previous char

+

Default: BackSpace,Shift+BackSpace,Control+h

+

kb-remove-to-eol

+

Delete till the end of line

+

Default: Control+k

+

kb-remove-to-sol

+

Delete till the start of line

+

Default: Control+u

+

kb-accept-entry

+

Accept entry

+

Default: Control+j,Control+m,Return,KP_Enter

+

kb-accept-custom

+

Use entered text as command (in ssh/run modes)

+

Default: Control+Return

+

kb-accept-custom-alt

+

Use entered text as command (in ssh/run modes)

+

Default: Control+Shift+Return

+

kb-accept-alt

+

Use alternate accept command.

+

Default: Shift+Return

+

kb-delete-entry

+

Delete entry from history

+

Default: Shift+Delete

+

kb-mode-next

+

Switch to the next mode.

+

Default: Shift+Right,Control+Tab

+

kb-mode-previous

+

Switch to the previous mode.

+

Default: Shift+Left,Control+ISO_Left_Tab

+

kb-mode-complete

+

Start completion for mode.

+

Default: Control+l

+

kb-row-left

+

Go to the previous column

+

Default: Control+Page_Up

+

kb-row-right

+

Go to the next column

+

Default: Control+Page_Down

+

kb-row-up

+

Select previous entry

+

Default: Up,Control+p

+

kb-row-down

+

Select next entry

+

Default: Down,Control+n

+

kb-row-tab

+

Go to next row, if one left, accept it, if no left next mode.

+

Default:

+

kb-element-next

+

Go to next row.

+

Default: Tab

+

kb-element-prev

+

Go to previous row.

+

Default: ISO_Left_Tab

+

kb-page-prev

+

Go to the previous page

+

Default: Page_Up

+

kb-page-next

+

Go to the next page

+

Default: Page_Down

+

kb-row-first

+

Go to the first entry

+

Default: Home,KP_Home

+

kb-row-last

+

Go to the last entry

+

Default: End,KP_End

+

kb-row-select

+

Set selected item as input text

+

Default: Control+space

+

kb-screenshot

+

Take a screenshot of the rofi window

+

Default: Alt+S

+

kb-ellipsize

+

Toggle between ellipsize modes for displayed data

+

Default: Alt+period

+

kb-toggle-case-sensitivity

+

Toggle case sensitivity

+

Default: grave,dead_grave

+

kb-toggle-sort

+

Toggle sort

+

Default: Alt+grave

+

kb-cancel

+

Quit rofi

+

Default: Escape,Control+g,Control+bracketleft

+

kb-custom-1

+

Custom keybinding 1

+

Default: Alt+1

+

kb-custom-2

+

Custom keybinding 2

+

Default: Alt+2

+

kb-custom-3

+

Custom keybinding 3

+

Default: Alt+3

+

kb-custom-4

+

Custom keybinding 4

+

Default: Alt+4

+

kb-custom-5

+

Custom Keybinding 5

+

Default: Alt+5

+

kb-custom-6

+

Custom keybinding 6

+

Default: Alt+6

+

kb-custom-7

+

Custom Keybinding 7

+

Default: Alt+7

+

kb-custom-8

+

Custom keybinding 8

+

Default: Alt+8

+

kb-custom-9

+

Custom keybinding 9

+

Default: Alt+9

+

kb-custom-10

+

Custom keybinding 10

+

Default: Alt+0

+

kb-custom-11

+

Custom keybinding 11

+

Default: Alt+exclam

+

kb-custom-12

+

Custom keybinding 12

+

Default: Alt+at

+

kb-custom-13

+

Custom keybinding 13

+

Default: Alt+numbersign

+

kb-custom-14

+

Custom keybinding 14

+

Default: Alt+dollar

+

kb-custom-15

+

Custom keybinding 15

+

Default: Alt+percent

+

kb-custom-16

+

Custom keybinding 16

+

Default: Alt+dead_circumflex

+

kb-custom-17

+

Custom keybinding 17

+

Default: Alt+ampersand

+

kb-custom-18

+

Custom keybinding 18

+

Default: Alt+asterisk

+

kb-custom-19

+

Custom Keybinding 19

+

Default: Alt+parenleft

+

kb-select-1

+

Select row 1

+

Default: Super+1

+

kb-select-2

+

Select row 2

+

Default: Super+2

+

kb-select-3

+

Select row 3

+

Default: Super+3

+

kb-select-4

+

Select row 4

+

Default: Super+4

+

kb-select-5

+

Select row 5

+

Default: Super+5

+

kb-select-6

+

Select row 6

+

Default: Super+6

+

kb-select-7

+

Select row 7

+

Default: Super+7

+

kb-select-8

+

Select row 8

+

Default: Super+8

+

kb-select-9

+

Select row 9

+

Default: Super+9

+

kb-select-10

+

Select row 10

+

Default: Super+0

+

Mouse Bindings

+

ml-row-left

+

Go to the previous column

+

Default: ScrollLeft

+

ml-row-right

+

Go to the next column

+

Default: ScrollRight

+

ml-row-up

+

Select previous entry

+

Default: ScrollUp

+

ml-row-down

+

Select next entry

+

Default: ScrollDown

+

me-select-entry

+

Select hovered row

+

Default: MousePrimary

+

me-accept-entry

+

Accept hovered row

+

Default: MouseDPrimary

+

me-accept-custom

+

Accept hovered row with custom action

+

Default: Control+MouseDPrimary

+

SEE ALSO

+

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

+

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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.4/rofi-script.5/index.html b/1.7.4/rofi-script.5/index.html new file mode 100644 index 00000000..5d090fc3 --- /dev/null +++ b/1.7.4/rofi-script.5/index.html @@ -0,0 +1,1509 @@ + + + + + + + + + + + + + + + + + + + + + + Script - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-SCRIPT 5 rofi-script

+

NAME

+

rofi script mode - Rofi format for scriptable mode.

+

DESCRIPTION

+

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

+

USAGE

+

To specify a script mode, set a mode with the following syntax: "{name}:{executable}"

+

For example:

+
rofi -show fb -modes "fb:file_browser.sh"
+
+

The name should be unique.

+

API

+

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" ]
+then
+    exit 0
+fi
+echo "reload"
+echo "quit"
+
+
+

This shows two entries, reload and quit. When the quit entry is selected, rofi closes.

+

Environment

+

Rofi sets the following environment variable when executing the script:

+

ROFI_RETV

+

An integer number with the current state:

+
    +
  • 0: Initial call of script.
  • +
  • 1: Selected an entry.
  • +
  • 2: Selected a custom entry.
  • +
  • 10-28: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
  • +
+

ROFI_INFO

+

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

+

ROFI_DATA

+

Environment get set when script sets data option in header.

+

Passing mode options

+

Extra options, like setting the prompt, can be set by the script. +Extra 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:

+
    +
  • prompt: Update the prompt text.
  • +
  • message: Update the message text.
  • +
  • markup-rows: If 'true' renders markup in the row.
  • +
  • urgent: Mark rows as urgent. (for syntax see the urgent option in dmenu mode)
  • +
  • active: Mark rows as active. (for syntax see the active option in dmenu mode)
  • +
  • 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.
  • +
  • no-custom: If set to 'true'; only accept listed entries, ignore custom input.
  • +
  • use-hot-keys: If set to true, it enabled the Custom keybindings for script. Warning this breaks the normal rofi flow.
  • +
  • keep-selection: If set, the selection is not moved to the first entry, but the current position is maintained. The filter is cleared.
  • +
  • new-selection: If keep-selection is set, this allows you to override the selected entry (absolute position).
  • +
  • data: Passed data to the next execution of the script via ROFI_DATA.
  • +
  • theme: Small theme snippet to f.e. change the background color of a widget.
  • +
+

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 entry.

+

For example:

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

The following options are supported:

+
    +
  • icon: Set the icon for that row.
  • +
  • meta: Specify invisible search terms.
  • +
  • nonselectable: If true the row cannot activated.
  • +
  • info: Info that, on selection, gets placed in the ROFI_INFO environment variable. This entry does not get searched.
  • +
+

multiple entries can be passed using the \x1f separator.

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

Executing external program

+

If you want to launch an external program from the script, you need to make sure it is launched in the background. +If not rofi will wait for its output (to display).

+

In bash the best way to do this is using coproc.

+
 coproc ( myApp  > /dev/null  2>&1 )
+
+

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 github.

+

SEE ALSO

+

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

+

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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.4/rofi-theme.5/index.html b/1.7.4/rofi-theme.5/index.html new file mode 100644 index 00000000..f663b472 --- /dev/null +++ b/1.7.4/rofi-theme.5/index.html @@ -0,0 +1,3291 @@ + + + + + + + + + + + + + + + + + + + + + + Themes - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-THEME 5 rofi-theme

+

NAME

+

rofi-theme - Rofi theme format files

+

GETTING STARTED WITH THEMING

+

The easiest way to get started theming rofi is by modifying your existing theme.

+

Themes can be modified/tweaked by adding theming elements to the end of the
+config file. The default location of this file is ~/.config/rofi/config.rasi, +if the file does not exists, you can create it.

+

A basic config:

+
configuration {
+  modes: [ combi ];
+  combi-modes: [ window, drun, run ];
+}
+
+@theme "gruvbox-light"
+
+/* Insert theme modifications after this */
+
+

For example if we want to change the Type to filter text in the entry box we +append the following:

+
entry {
+    placeholder: "Type here";
+}
+
+

In the above section, entry indicates the widget, placeholder is the +property we want to modify and we set it to the string "Type here". +To find the commonly available widgets in rofi, see the 'Basic structure' section.

+

To change the mouse over cursor to a pointer, add:

+
entry {
+    placeholder: "Type here";
+    cursor: pointer;
+}
+
+

For the next modification, we want to add the icon after each text element and +increase the size. First we start by modifying the element widget:

+

+element {
+  orientation: horizontal;
+  children: [ element-text, element-icon ];
+  spacing: 5px;
+}
+
+
+

Resulting in the following packing:

+
┌─────────────────────────────────────────────────────────────────────┐ 
+│ element                                                             │ 
+│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │ 
+│ │element─text                                 │ │ element─icon    │ │ 
+│ └─────────────────────────────────────────────┘ └─────────────────┘ │ 
+└─────────────────────────────────────────────────────────────────────┘ 
+
+

The element (container) widget hold each entry in the listview, we add the +two pre-defined children in the order we want to show. We also specify the +packing direction (orientation) and the spacing between the children +(spacing). We specify the space between the two children in absolute pixels +(px).

+

To increase the icon-size, we need to modify the element-icon widget.

+
element-icon {
+    size: 2.5em;
+}
+
+
┌─────────────────────────────────────────────────────────────────────┐ 
+│ element                                                             │ 
+│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │ 
+│ │element─text                                 │ │    element      │ │ 
+│ │                                             │ │       ─         │ │ 
+│ │                                             │ │     icon        │ │ 
+│ └─────────────────────────────────────────────┘ └─────────────────┘ │ 
+└─────────────────────────────────────────────────────────────────────┘ 
+
+

In this example we specify the size in the em unit.

+

Now lets change the text color of both the entry and the element-text widget to red and background to blue.

+
entry, element-text {
+  text-color: red;
+  background-color: rgb(0,0,255);
+}
+
+

Here we use two different methods of writing down the color, for text-color +we used a named color, for background-color we specify it in rgb. +We also specify the property for multiple widgets by passing a comma separated +list of widget names.

+

If you want to center the text relative to the icon, we can set this:

+
element-text {
+    vertical-align: 0.5;
+}
+
+
┌─────────────────────────────────────────────────────────────────────┐ 
+│ element                                                             │ 
+│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │ 
+│ │                                             │ │    element      │ │ 
+│ │element-text                                 │ │       ─         │ │ 
+│ │                                             │ │     icon        │ │ 
+│ └─────────────────────────────────────────────┘ └─────────────────┘ │ 
+└─────────────────────────────────────────────────────────────────────┘ 
+
+

If you want to see the complete theme, including the modification you can run:

+
rofi -dump-theme
+
+

DEFAULT THEME LOADING

+

By default, rofi loads the default theme. This theme is always loaded. +The default configuration contains:

+
@theme "default"
+
+

To unload the default theme, and load another theme, add the @theme statement +to your config.rasi file.

+

If you have a theme loaded via @theme or use the default theme, you can tweak +it by adding overriding elements at the end of your config.rasi file.

+

For the difference between @import and @theme see the Multiple file +handling section in this manpage.

+

To see the default theme, run the following command:

+
rofi -no-config -dump-theme
+
+

DESCRIPTION

+

The need for a new theme format was motivated by the fact that the way rofi handled widgets has changed. From a very +static drawing of lines and text to a nice structured form of packing widgets. This change made it possible to provide a +more flexible theme framework. The old theme format and config file are not flexible enough to expose these options in a +user-friendly way. Therefore, a new file format has been created, replacing the old one.

+

FORMAT SPECIFICATION

+

Encoding

+

The encoding of the file is UTF-8. Both unix (\n) and windows (\r\n) newlines format are supported. But unix is +preferred.

+

Comments

+

C and C++ file comments are supported.

+
    +
  • Anything after // and before a newline is considered a comment.
  • +
  • Everything between /* and */ is a comment, this comment can span multiple lines.
  • +
+

Comments can be nested and the C comments can be inline.

+

The following is valid:

+
// Magic comment.
+property: /* comment */ value;
+
+

However, this is not:

+
prop/*comment*/erty: value;
+
+

White space

+

White space and newlines, like comments, are ignored by the parser.

+

This:

+
property: name;
+
+

Is identical to:

+
     property             :
+name
+
+;
+
+

File extension

+

The preferred file extension for the new theme format is rasi. This is an +abbreviation for rofi advanced style information.

+

Basic Structure

+

Each element has a section with defined properties. Global properties can be defined in section * { }. +Sub-section names begin with an optional hash symbol #.

+

It is advised to define the global properties section on top of the file to +make inheritance of properties clearer.

+
/* Global properties section */
+* {
+    // list of properties
+}
+
+/* Element theme section. */
+{element path} {
+    // list of properties
+}
+{elements... } {
+    // list of properties
+}
+
+

If there are multiple sections with the same name, they are merged. Duplicate properties are overwritten and the last +parsed entry kept.

+

Global properties section

+

A theme can have one or more global properties sections. If there is more than one, +they will be merged.

+

The global properties section denotes the defaults for each element. +Each property of this section can be referenced with @{identifier} +(See Properties section)

+

A global properties section is indicated with a * as element path.

+

Element theme section

+

A theme can have multiple element theme sections.

+

The element path can consist of multiple names separated by whitespace or dots. +Each element may contain any number of letters, numbers and -'s. +The first element in the element path can optionally start with a # (for +historic reasons). Multiple elements can be specified by a ,.

+

This is a valid element name:

+
element normal.normal {
+    background-color: blue;
+}
+button {
+    background-color: blue;
+}
+
+

And is identical to:

+
element normal normal, button {
+    background-color: blue;
+}
+
+

Each section inherits the global properties. Properties can be explicitly +inherited from their parent with the inherit keyword. +In the following example:

+
window {
+ a: 1;
+ b: 2;
+ children: [ mainbox ];
+}
+mainbox {
+    a: inherit;
+    b: 4;
+    c: 8;
+}
+
+

The element mainbox will have the following set of properties (if mainbox +is a child of window):

+
a: 1;
+b: 4;
+c: 8;
+
+

If multiple sections are defined with the same name, they are merged by the +parser. If multiple properties with the same name are defined in one section, +the last encountered property is used.

+

Properties Format

+

The properties in a section consist of:

+
{identifier}: {value};
+
+

Both fields are mandatory for a property.

+

The identifier names the specified property. Identifiers can consist of any +combination of numbers, letters and '-'. It must not contain any whitespace. +The structure of the value defines the type of the property. The current +parser does not define or enforce a certain type of a particular identifier. +When used, values with the wrong type that cannot be converted are ignored.

+

The current theme format supports different types:

+
    +
  • a string
  • +
  • an integer number
  • +
  • a fractional number
  • +
  • a boolean value
  • +
  • a color
  • +
  • image
  • +
  • text style
  • +
  • line style
  • +
  • a distance
  • +
  • a padding
  • +
  • a border
  • +
  • a position
  • +
  • a reference
  • +
  • an orientation
  • +
  • a cursor
  • +
  • a list of keywords
  • +
  • an array of values
  • +
  • an environment variable
  • +
  • Inherit
  • +
+

Some of these types are a combination of other types.

+

String

+
    +
  • Format: "[:print:]+"
  • +
+

A string is always surrounded by double quotes ("). Between the quotes there can be any printable character.

+

For example:

+
font: "Awasome 12";
+
+

The string must be valid UTF-8, special characters can be escaped:

+
text {
+    content: "Line one\n\tIndented line two";
+}
+
+

The following special characters can be escaped: \b, \f, \n, \r, \t, \v, \ and ".

+

Integer

+
    +
  • Format: [-+]?[:digit:]+
  • +
+

An integer may contain any number.

+

For examples:

+
lines: 12;
+
+

Real

+
    +
  • Format: [-+]?[:digit:]+(\.[:digit:]+)?
  • +
+

A real is an integer with an optional fraction.

+

For example:

+
real: 3.4;
+
+

The following is not valid: .3, 3. or scientific notation: 3.4e-3.

+

Boolean

+
    +
  • Format: (true|false)
  • +
+

Boolean value is either true or false. This is case-sensitive.

+

For example:

+
dynamic: false;
+
+

Image

+

rofi support a limited set of background-image formats.

+
    +
  • Format: url("path to image");
  • +
  • Format: url("path to image", scale); + where scale is: none, both, width, height
  • +
  • Format: linear-gradient(stop color,stop1, color, stop2 color, ...);
  • +
  • Format: linear-gradient(to direction, stop color,stop1, color, stop2 color, ...); + where direction is: top,left,right,bottom.
  • +
  • Format: linear-gradient(angle, stop color,stop1, color, stop2 color, ...); + Angle in deg,rad,grad (as used in color).
  • +
+

Where the path is a string, and stop color is of type color.

+

Color

+

rofi supports the color formats as specified in the CSS standard (1,2,3 and some of CSS 4)

+
    +
  • Format: #{HEX}{3} (rgb)
  • +
  • Format: #{HEX}{4} (rgba)
  • +
  • Format: #{HEX}{6} (rrggbb)
  • +
  • Format: #{HEX}{8} (rrggbbaa)
  • +
  • Format: rgb[a]({INTEGER},{INTEGER},{INTEGER}[, {PERCENTAGE}])
  • +
  • Format: rgb[a]({INTEGER}%,{INTEGER}%,{INTEGER}%[, {PERCENTAGE}])
  • +
  • Format: hsl[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])
  • +
  • Format: hwb[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])
  • +
  • Format: cmyk( {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE} ])
  • +
  • Format: {named-color} [ / {PERCENTAGE} ]
  • +
+

The white-space format proposed in CSS4 is also supported.

+

The different values are:

+
    +
  • {HEX} is a hexadecimal number ('0-9a-f' case insensitive).
  • +
  • {INTEGER} value can be between 0 and 255 or 0-100 when representing percentage.
  • +
  • {ANGLE} is the angle on the color wheel, can be in deg, rad, grad or turn. When no unit is specified, degrees is assumed.
  • +
  • {PERCENTAGE} can be between 0-1.0, or 0%-100%
  • +
  • +

    {named-color} is one of the following colors:

    +

    AliceBlue, AntiqueWhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet, Brown, +BurlyWood, CadetBlue, Chartreuse, Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, DarkCyan, +DarkGoldenRod, DarkGray, DarkGrey, DarkGreen, DarkKhaki, DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, +DarkSalmon, DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkSlateGrey, DarkTurquoise, DarkViolet, DeepPink, DeepSkyBlue, +DimGray, DimGrey, DodgerBlue, FireBrick, FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, GoldenRod, +Gray, Grey, Green, GreenYellow, HoneyDew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, +LemonChiffon, LightBlue, LightCoral, LightCyan, LightGoldenRodYellow, LightGray, LightGrey, LightGreen, LightPink, +LightSalmon, LightSeaGreen, LightSkyBlue, LightSlateGray, LightSlateGrey, LightSteelBlue, LightYellow, Lime, LimeGreen, +Linen, Magenta, Maroon, MediumAquaMarine, MediumBlue, MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, +MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, MintCream, MistyRose, Moccasin, NavajoWhite, Navy, +OldLace, Olive, OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenRod, PaleGreen, PaleTurquoise, PaleVioletRed, +PapayaWhip, PeachPuff, Peru, Pink, Plum, PowderBlue, Purple, RebeccaPurple, Red, RosyBrown, RoyalBlue, SaddleBrown, +Salmon, SandyBrown, SeaGreen, SeaShell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray, SlateGrey, Snow, SpringGreen, +SteelBlue, Tan, Teal, Thistle, Tomato, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, YellowGreen,transparent

    +
  • +
+

For example:

+
background-color: #FF0000;
+border-color: rgba(0,0,1, 0.5);
+text-color: SeaGreen;
+
+

or

+
background-color: transparent;
+text-color: Black;
+
+

Text style

+
    +
  • Format: (bold|italic|underline|strikethrough|none)
  • +
+

Text style indicates how the highlighted text is emphasized. None indicates that no emphasis +should be applied.

+
    +
  • bold: make the text thicker then the surrounding text.
  • +
  • italic: put the highlighted text in script type (slanted).
  • +
  • underline: put a line under the text.
  • +
  • strikethrough: put a line through the text.
  • +
+

The following options are available on pango 1.50.0 and up:

+
    +
  • uppercase: Uppercase the text.
  • +
  • lowercase: Lowercase the text.
  • +
+

The following option is disabled as pango crashes on this if there is eel + upsizing or wrapping. This will be re-enabled once fixed:

+
    +
  • capitalize: Capitalize the text.
  • +
+

Line style

+
    +
  • Format: (dash|solid)
  • +
+

Indicates how a line should be drawn. +It currently supports: + * dash: a dashed line, where the gap is the same width as the dash + * solid: a solid line

+

Distance

+
    +
  • Format: {Integer}px
  • +
  • Format: {Real}em
  • +
  • Format: {Real}ch
  • +
  • Format: {Real}%
  • +
  • Format: {Integer}mm
  • +
+

A distance can be specified in 3 different units:

+
    +
  • px: Screen pixels.
  • +
  • em: Relative to text height.
  • +
  • ch: Relative to width of a single number.
  • +
  • mm: Actual size in millimeters (based on dpi).
  • +
  • %: Percentage of the monitor size.
  • +
+

Distances used in the horizontal direction use the monitor width. Distances in +the vertical direction use the monitor height. +For example:

+
   padding: 10%;
+
+

On a full-HD (1920x1080) monitor, it defines a padding of 192 pixels on the left +and right side and 108 pixels on the top and bottom.

+

Calculating sizes

+

Rofi supports some maths in calculating sizes. For this it uses the CSS syntax:

+
width: calc( 100% - 37px );
+
+
width: calc( 20% min 512 );
+
+

It supports the following operations:

+
    +
  • + : Add
  • +
  • - : Subtract
  • +
  • / : Divide
  • +
  • * : Multiply
  • +
  • % : Modulo
  • +
  • min : Minimum of lvalue or rvalue;
  • +
  • max : Maximum of lvalue or rvalue;
  • +
  • floor : Round down lvalue to the next multiple of rvalue
  • +
  • ceil : Round up lvalue to the next multiple of rvalue
  • +
  • round : Round lvalue to the next multiple of rvalue
  • +
+

It uses the C precedence ordering.

+

Padding

+
    +
  • Format: {Integer}
  • +
  • Format: {Distance}
  • +
  • Format: {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance} {Distance}
  • +
+

If no unit is specified, pixels are assumed.

+

The different number of fields in the formats are parsed like:

+
    +
  • 1 field: all
  • +
  • 2 fields: top&bottom left&right
  • +
  • 3 fields: top, left&right, bottom
  • +
  • 4 fields: top, right, bottom, left
  • +
+

Border

+
    +
  • Format: {Integer}
  • +
  • Format: {Distance}
  • +
  • Format: {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style} {Distance} {Line style}
  • +
+

Borders are identical to padding, except that each distance field has a line +style property.

+
+

When no unit is specified, pixels are assumed.

+
+

Position

+

Indicate a place on the window/monitor.

+
┌─────────────┬─────────────┬─────────────┐
+│ north west  │    north    │  north east │
+├─────────────┼─────────────┼─────────────┤
+│   west      │   center    │     east    │
+├─────────────┼─────────────┼─────────────┤
+│ south west  │    south    │  south east │
+└─────────────┴─────────────┴─────────────┘
+
+
    +
  • Format: (center|east|north|west|south|north east|north west|south west|south east)
  • +
+

Visibility

+

It is possible to hide widgets:

+
inputbar {
+    enabled: false;
+}
+
+

Reference

+
    +
  • Format: @{PROPERTY NAME}
  • +
+

A reference can point to another reference. Currently, the maximum number of redirects is 20. +A property always refers to another property. It cannot be used for a subpart of the property. +For example, this is not valid:

+
highlight: bold @pink;
+
+

But this is:

+
* {
+    myhigh: bold #FAA;
+}
+
+window {
+    highlight: @myhigh;
+}
+
+
    +
  • Format: var(PROPERTY NAME, DEFAULT)
  • +
+

A reference can point to another reference. Currently, the maximum number of redirects is 20. +A property always refers to another property. It cannot be used for a subpart of the property.

+

Example:

+
window {
+    width: var( width, 30%);
+}
+
+

If the property width is set globally (*{}) that value is used, if the property +width is not set, the default value is used.

+

Orientation

+
    +
  • Format: (horizontal|vertical)
  • +
+

Specify the orientation of the widget.

+

Cursor

+
    +
  • Format: (default|pointer|text)
  • +
+

Specify the type of mouse cursor that is set when the mouse pointer is over the widget.

+

List of keywords

+
    +
  • Format: [ keyword, keyword ]
  • +
+

A list starts with a '[' and ends with a ']'. The entries in the list are comma-separated. +The keyword in the list refers to an widget name.

+

List of values

+
    +
  • Format: [ value, value, ... ]
  • +
+

An list starts with a '[' and ends with a ']'. The entries in the list are comma-separated.

+

Environment variable

+
    +
  • Format: ${:alnum:}
  • +
+

This will parse the environment variable as the property value. (that then can be any of the above types). +The environment variable should be an alphanumeric string without white-space.

+
* {
+    background-color: ${BG};
+}
+
+
    +
  • Format: env(ENVIRONMENT, default)
  • +
+

This will parse the environment variable as the property value. (that then can be any of the above types). +The environment variable should be an alphanumeric string without white-space. +If the environment value is not found, the default value is used.

+
window {
+    width: env(WIDTH, 40%);
+}
+
+

If environment WIDTH is set, then that value is parsed, otherwise the default value (40%).

+

Inherit

+
    +
  • Format: inherit
  • +
+

Inherits the property from its parent widget.

+
mainbox {
+    border-color: inherit;
+}
+
+

ELEMENTS PATHS

+

Element paths exists of two parts, the first part refers to the actual widget by name. +Some widgets have an extra state.

+

For example:

+
element selected {
+}
+
+

Here element selected is the name of the widget, selected is the state of the widget.

+

The difference between dots and spaces is purely cosmetic. These are all the same:

+
element .selected {
+
+element.selected {
+}
+element selected {
+}
+
+

SUPPORTED ELEMENT PATH

+

Name

+

The current widgets available in rofi:

+
    +
  • window
  • +
  • overlay: the overlay widget.
  • +
  • mainbox: The mainbox box.
      +
    • inputbar: The input bar box.
    • +
    • box: the horizontal @box packing the widgets
    • +
    • case-indicator: the case/sort indicator @textbox
    • +
    • prompt: the prompt @textbox
    • +
    • entry: the main entry @textbox
    • +
    • num-rows: Shows the total number of rows.
    • +
    • num-filtered-rows: Shows the total number of rows after filtering.
    • +
    • textbox-current-entry: Shows the text of the currently selected entry.
    • +
    • icon-current-entry: Shows the icon of the currently selected entry.
    • +
    • listview: The listview.
    • +
    • scrollbar: the listview scrollbar
    • +
    • element: a box in the listview holding the entries
        +
      • element-icon: the widget in the listview's entry showing the (optional) icon
      • +
      • element-index: the widget in the listview's entry keybindable index (1,2,3..0)
      • +
      • element-text: the widget in the listview's entry showing the text.
      • +
      +
    • +
    • mode-switcher: the main horizontal @box packing the buttons.
    • +
    • button: the buttons @textbox for each mode
    • +
    • message: The container holding the textbox.
    • +
    • textbox: the message textbox
    • +
    +
  • +
+

Note that these path names match the default theme. Themes that provide a custom layout will have different +elements, and structure.

+

State

+

State: State of widget

+

Optional flag(s) indicating state of the widget, used for theming.

+

These are appended after the name or class of the widget.

+

Example:

+

button selected.normal { }

+

element selected.urgent { }

+

Currently only the entrybox and scrollbar have states:

+

Entrybox:

+

{visible modifier}.{state}

+

Where visible modifier can be: + * normal: no modification + * selected: the entry is selected/highlighted by user + * alternate: the entry is at an alternating row (uneven row)

+

Where state is: + * normal: no modification + * urgent: this entry is marked urgent + * active: this entry is marked active

+

These can be mixed.

+

Example:

+
nametotextbox selected.active {
+    background-color: #003642;
+    text-color: #008ed4;
+}
+
+

Sets all selected textboxes marked active to the given text and background color. +Note that a state modifies the original element, it therefore contains all the properties of that element.

+

Scrollbar

+

The scrollbar uses the handle state when drawing the small scrollbar handle. +This allows the colors used for drawing the handle to be set independently.

+

SUPPORTED PROPERTIES

+

The following properties are currently supported:

+

all widgets:

+
    +
  • enabled: enable/disable rendering of the widget
  • +
  • padding: padding + Padding on the inside of the widget
  • +
  • margin: padding + Margin on the outside of the widget
  • +
  • border: border + Border around the widget (between padding and margin)/
  • +
  • border-radius: padding + Sets a radius on the corners of the borders.
  • +
  • background-color: color + Background color
  • +
  • background-image: image + Background image
  • +
  • border-color: color + Color of the border
  • +
  • cursor: cursor + Type of mouse cursor that is set when the mouse pointer is hovered over the widget.
  • +
+

window:

+
    +
  • +

    font: string + The font used in the window

    +
  • +
  • +

    transparency: string + Indicating if transparency should be used and what type: + real - True transparency. Only works with a compositor. + background - Take a screenshot of the background image and use that. + screenshot - Take a screenshot of the screen and use that. + Path to png file - Use an image.

    +
  • +
  • +

    location: position + The place of the anchor on the monitor

    +
  • +
  • anchor: anchor + The anchor position on the window
  • +
  • fullscreen: boolean + Window is fullscreen.
  • +
  • width: distance + The width of the window
  • +
  • x-offset: distance
  • +
  • y-offset: distance + The offset of the window to the anchor point, allowing you to push the window left/right/up/down
  • +
+

scrollbar:

+
    +
  • background-color: color
  • +
  • handle-width: distance
  • +
  • handle-color: color
  • +
  • border-color: color
  • +
+

box:

+
    +
  • orientation: orientation + Set the direction the elements are packed.
  • +
  • spacing: distance + Distance between the packed elements.
  • +
+

textbox:

+
    +
  • background-color: color
  • +
  • border-color: the color used for the border around the widget.
  • +
  • font: the font used by this textbox (string).
  • +
  • str/content: the string to display by this textbox (string).
  • +
  • vertical-align: Vertical alignment of the text. A number between 0 (top) and 1 (bottom).
  • +
  • horizontal-align: Horizontal alignment of the text. A number between 0 (left) and 1 (right).
  • +
  • text-color: the text color to use.
  • +
  • text-transform: text style {color} for the whole text.
  • +
  • highlight: text style {color}. + color is optional, multiple highlight styles can be added like: bold underline italic #000000; + This option is only available on the element-text widget.
  • +
  • width: override the desired width for the textbox.
  • +
  • content: Set the displayed text (String).
  • +
  • placeholder: Set the displayed text (String) when nothing is entered.
  • +
  • placeholder-color: Color of the placeholder text.
  • +
  • blink: Enable/Disable blinking on an input textbox (Boolean).
  • +
  • markup: Force markup on, beware that only valid pango markup strings are shown.
  • +
  • tab-stops: array of distances + Set the location of tab stops by their distance from the beginning of the line. + Each distance should be greater than the previous one. + The text appears to the right of the tab stop position (other alignments are not supported yet).
  • +
+

listview:

+
    +
  • columns: integer + Number of columns to show (at least 1)
  • +
  • fixed-height: boolean + Always show lines rows, even if fewer elements are available.
  • +
  • dynamic: boolean + True if the size should change when filtering the list, False if it should keep the original height.
  • +
  • scrollbar: boolean + If the scrollbar should be enabled/disabled.
  • +
  • scrollbar-width: distance + Width of the scrollbar
  • +
  • cycle: boolean + When navigating, it should wrap around
  • +
  • spacing: distance + Spacing between the elements (both vertical and horizontal)
  • +
  • lines: integer + Number of rows to show in the list view.
  • +
  • layout: orientation + Indicate how elements are stacked. Horizontal implements the dmenu style.
  • +
  • reverse: boolean + Reverse the ordering (top down to bottom up).
  • +
  • flow: orientation + The order the elements are layed out. Vertical is the original 'column' view.
  • +
  • fixed-columns: boolean + Do not reduce the number of columns shown when number of visible elements is not enough to fill them all.
  • +
  • require-input: boolean + Listview requires user input to show up.
  • +
+

Each element is a box called element. Each element can contain an element-icon and element-text.

+

listview text highlight:

+

The element-text widget in the listview is the one used to show the text. +On this widget set the highlight property (only place this property is used) to change +the style of highlighting. +The highlight property consist of the text-style property and a color.

+

To disable highlighting:

+
  element-text {
+    highlight: None;
+  }
+
+

To set to red underlined:

+
  element-text {
+    highlight: underline red;
+  }
+
+

Layout

+

The new format allows the layout of the rofi window to be tweaked extensively. +For each widget, the themer can specify padding, margin, border, font, and more. +It even allows, as an advanced feature, to pack widgets in a custom structure.

+

Basic structure

+

The whole view is made out of boxes that pack other boxes or widgets. +The box can be vertical or horizontal. This is loosely inspired by GTK.

+

The current layout of rofi is structured as follows:

+
┌────────────────────────────────────────────────────────────────────────────────────┐
+│ window {BOX:vertical}                                                              │
+│ ┌───────────────────────────────────────────────────────────────────────────────┐  │
+│ │ mainbox  {BOX:vertical}                                                       │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │ inputbar {BOX:horizontal}                                                 │ │  │
+│ │ │ ┌─────────┐ ┌─┐ ┌───────────────────────────────┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ │ │  │
+│ │ │ │ prompt  │ │:│ │ entry                         │ │#fr│ │ / │ │#ns│ │ci │ │ │  │
+│ │ │ └─────────┘ └─┘ └───────────────────────────────┘ └───┘ └───┘ └───┘ └───┘ │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ │                                                                               │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │ message                                                                   │ │  │
+│ │ │ ┌───────────────────────────────────────────────────────────────────────┐ │ │  │
+│ │ │ │ textbox                                                               │ │ │  │
+│ │ │ └───────────────────────────────────────────────────────────────────────┘ │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ │                                                                               │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │ listview                                                                  │ │  │
+│ │ │ ┌─────────────────────────────────────────────────────────────────────┐   │ │  │
+│ │ │ │ element                                                             │   │ │  │
+│ │ │ │ ┌─────────────────┐ ┌─────────────────────────────────────────────┐ │   │ │  │
+│ │ │ │ │element─icon     │ │element─text                                 │ │   │ │  │
+│ │ │ │ └─────────────────┘ └─────────────────────────────────────────────┘ │   │ │  │
+│ │ │ └─────────────────────────────────────────────────────────────────────┘   │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ │                                                                               │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │  mode─switcher {BOX:horizontal}                                           │ │  │
+│ │ │ ┌───────────────┐   ┌───────────────┐  ┌──────────────┐ ┌───────────────┐ │ │  │
+│ │ │ │ Button        │   │ Button        │  │ Button       │ │ Button        │ │ │  │
+│ │ │ └───────────────┘   └───────────────┘  └──────────────┘ └───────────────┘ │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ └───────────────────────────────────────────────────────────────────────────────┘  │
+└────────────────────────────────────────────────────────────────────────────────────┘
+
+
+
+
+
    +
  • ci is the case-indicator
  • +
  • fr is the num-filtered-rows
  • +
  • ns is the num-rows
  • +
+
+

Error message structure

+
┌──────────────────────────────────────────────────────────────────────────────────┐
+│ window {BOX:vertical}                                                            │
+│ ┌─────────────────────────────────────────────────────────────────────────────┐  │
+│ │ error─message {BOX:vertical}                                                │  │
+│ │ ┌────────────────────────────────────────────────────────────────────────┐  │  │
+│ │ │ textbox                                                                │  │  │
+│ │ └────────────────────────────────────────────────────────────────────────┘  │  │
+│ └─────────────────────────────────────────────────────────────────────────────┘  │
+└──────────────────────────────────────────────────────────────────────────────────┘
+
+
+

Advanced layout

+

The layout of rofi can be tweaked by packing the 'fixed' widgets in a custom structure.

+

The following widgets are fixed, as they provide core rofi functionality:

+
    +
  • prompt
  • +
  • entry
  • +
  • overlay
  • +
  • case-indicator
  • +
  • message
  • +
  • listview
  • +
  • mode-switcher
  • +
  • num-rows
  • +
  • num-filtered-rows
  • +
+

The following keywords are defined and can be used to automatically pack a subset of the widgets. +These are used in the default theme as depicted in the figure above.

+
    +
  • mainbox + Packs: inputbar, message, listview, mode-switcher
  • +
  • inputbar + Packs: prompt,entry,case-indicator
  • +
+

Any widget name starting with textbox is a textbox widget, others are box widgets and can pack other widgets.

+

There are several special widgets that can be used by prefixing the name of the widget:

+

textbox

+

This is a read-only textbox widget. The displayed string can be set with content.

+

Example:

+
textbox-custom {
+  expand: false;
+  content: "My Message";
+}
+
+

Icon

+

This is an icon widget. The displayed icon can be set with filename and size with size. +If the property action is set, it acts as a button. +action can be set to a keybinding name and completes that action. (see rofi -show keys for a list).

+

If the squared property is set to false the widget height and width are not forced to be equal.

+

Example:

+
icon-paste {
+    expand: false;
+    filename: "gtk-paste";
+    size: 24;
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

button

+

This is a textbox widget that can have a 'clickable' action. +The action can be set to: +keybinding: accepts a keybinding name and completes that action. (see rofi -show keys for a list).

+
button-paste {
+    expand: false;
+    content: "My Clickable Message";
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

Children

+

To specify children, set the children +property (this always happens on the box child, see example below):

+
inputbar {
+  children: [prompt,entry,overlay,case-indicator];
+}
+
+

The theme needs to be updated to match the hierarchy specified.

+

Below is an example of a theme emulating dmenu:

+
* {
+    background-color:      Black;
+    text-color:            White;
+    border-color:          White;
+    font:            "Times New Roman 12";
+}
+
+window {
+    anchor:     north;
+    location:   north;
+    width:      100%;
+    padding:    4px;
+    children:   [ horibox ];
+}
+
+horibox {
+    orientation: horizontal;
+    children:   [ prompt, entry, listview ];
+}
+
+listview {
+    layout:     horizontal;
+    spacing:    5px;
+    lines:      10;
+}
+
+entry {
+    expand:     false;
+    width:      10em;
+}
+
+element {
+    padding: 0px 2px;
+}
+element selected {
+    background-color: SteelBlue;
+}
+
+

Padding and margin

+

Just like CSS, rofi uses the box model for each widget.

+
┌──────────────────────────────────────────────────────────────────┐
+│ margin                                                           │
+│  ┌────────────────────────────────────────────────────────────┐  │
+│  │ border                                                     │  │
+│  │ ┌────────────────────────────────────────────────────────┐ │  │
+│  │ │ padding                                                │ │  │
+│  │ │ ┌────────────────────────────────────────────────────┐ │ │  │
+│  │ │ │ content                                            │ │ │  │
+│  │ │ └────────────────────────────────────────────────────┘ │ │  │
+│  │ └────────────────────────────────────────────────────────┘ │  │
+│  └────────────────────────────────────────────────────────────┘  │
+└──────────────────────────────────────────────────────────────────┘
+
+

Explanation of the different parts:

+
    +
  • Content - The content of the widget.
  • +
  • Padding - Clears an area around the widget. + The padding shows the background color of the widget.
  • +
  • Border - A border that goes around the padding and content. + The border use the border-color of the widget.
  • +
  • Margin - Clears an area outside the border. + The margin is transparent.
  • +
+

The box model allows us to add a border around elements, and to define space between elements.

+

The size of each margin, border, and padding can be set. +For the border, a linestyle and radius can be set.

+

Spacing

+

Widgets that can pack more then one child widget (currently box and listview) have the spacing property. +This property sets the distance between the packed widgets (both horizontally and vertically).

+
┌───────────────────────────────────────┐
+│ ┌────────┐ s ┌────────┐ s ┌────────┐  │
+│ │ child  │ p │ child  │ p │ child  │  │
+│ │        │ a │        │ a │        │  │
+│ │        │ c │        │ c │        │  │
+│ │        │ i │        │ i │        │  │
+│ │        │ n │        │ n │        │  │
+│ └────────┘ g └────────┘ g └────────┘  │
+└───────────────────────────────────────┘
+
+

Advanced box packing

+

More dynamic spacing can be achieved by adding dummy widgets, for example to make one widget centered:

+
┌────────────────────────────────────────────────────┐
+│  ┌───────────────┐  ┌────────┐  ┌───────────────┐  │
+│  │ dummy         │  │ child  │  │ dummy         │  │
+│  │ expand: true; │  │        │  │ expand: true; │  │
+│  │               │  │        │  │               │  │
+│  │               │  │        │  │               │  │
+│  │               │  │        │  │               │  │
+│  └───────────────┘  └────────┘  └───────────────┘  │
+└────────────────────────────────────────────────────┘
+
+

If both dummy widgets are set to expand, child will be centered. Depending on the expand flag of child the +remaining space will be equally divided between both dummy and child widget (expand enabled), or both dummy widgets +(expand disabled).

+

DEBUGGING

+

To get debug information from the parser, run rofi like:

+
G_MESSAGES_DEBUG=Parser rofi -show run
+
+

Syntax errors are shown in a popup and printed out to command line with the above command.

+

To see the elements queried during running, run:

+
G_MESSAGES_DEBUG=Theme rofi -show run
+
+

To test minor changes, part of the theme can be passed on the command line, for example to set it to full-screen:

+
rofi -theme-str 'window { fullscreen:true;}' -show run
+
+

Another syntax to modify theme properties is:

+
rofi -theme+window+fullscreen true -show run
+
+

To print the current theme, run:

+
rofi -dump-theme
+
+

Media support

+

Parts of the theme can be conditionally loaded, like the CSS @media option.

+
@media ( min-width: 120 ) {
+
+}
+
+

It supports the following keys as constraint:

+
    +
  • min-width: load when width is bigger or equal then value.
  • +
  • max-width: load when width is smaller then value.
  • +
  • min-height: load when height is bigger or equal then value.
  • +
  • max-height: load when height is smaller then value.
  • +
  • min-aspect-ratio load when aspect ratio is over value.
  • +
  • max-aspect-ratio: load when aspect ratio is under value.
  • +
  • monitor-id: The monitor id, see rofi -help for id's.
  • +
  • enabled: Boolean option to enable. Supports environment variable.
  • +
+

@media takes an integer number or a fraction, for integer number px can be added.

+
@media ( min-width: 120 px ) {
+
+}
+
+
@media ( enabled: env(DO_LIGHT, false ) {
+
+}
+
+

Font Parsing

+

Rofi uses pango for font rendering. The font should be specified in a format that pango +understands. +This normally is the font name followed by the font size. For example:

+
mono 18
+
+

Or

+
FontAwesome 22
+
+

Icon Handling

+

Rofi supports 3 ways of specifying an icon:

+
    +
  • Filename
  • +
  • icon-name, this is looked up via the icon-theme.
  • +
  • Markup String. It renders a string as an icon.
  • +
+

For the first two options, GdkPixbuf is used to open and render the icons. +This in general gives support for most required image formats. +For the string option it uses Pango to render the string. The string needs to +start with a <span tag, that allows you to set color and font.

+

Markup string:

+
echo -en "testing\0icon\x1f<span color='red'>⏻</span>" | ./rofi -dmenu
+
+

Getting supported icon formats:

+
G_MESSAGES_DEBUG=Helpers.IconFetcher rofi
+
+

This uses the debug framework and prints out a list of supported image file +extensions.

+

Multiple file handling

+

The rasi file format offers two methods of including other files. +This can be used to modify existing themes, or have multiple variations on a theme.

+
    +
  • import: Import and parse a second file.
  • +
  • theme: Discard theme, and load file as a fresh theme.
  • +
+

Syntax:

+
@import "myfile"
+@theme "mytheme"
+
+

The specified file can either by name, filename,full path.

+

If a filename is provided, it will try to resolve it in the following order:

+
    +
  • ${XDG_CONFIG_HOME}/rofi/themes/
  • +
  • ${XDG_CONFIG_HOME}/rofi/
  • +
  • ${XDG_DATA_HOME}/rofi/themes/
  • +
  • ${INSTALL PREFIX}/share/rofi/themes/
  • +
+

A name is resolved as a filename by appending the .rasi extension.

+

EXAMPLES

+

Several examples are installed together with rofi. These can be found in {datadir}/rofi/themes/, where +{datadir} is the install path of rofi data. When installed using a package manager, this is usually: /usr/share/.

+

SEE ALSO

+

rofi(1), rofi-script(5), rofi-theme-selector(1)

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.4/rofi.1/index.html b/1.7.4/rofi.1/index.html new file mode 100644 index 00000000..59be0312 --- /dev/null +++ b/1.7.4/rofi.1/index.html @@ -0,0 +1,2608 @@ + + + + + + + + + + + + + + + + + + + + + + Rofi - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

ROFI 1 rofi

+

NAME

+

rofi - A window switcher, application launcher, ssh dialog, dmenu replacement and more

+

SYNOPSIS

+

rofi [ -show mode ]|[ -dmenu ]|[ -e msg ] [ CONFIGURATION ]

+

DESCRIPTION

+

rofi is an X11 pop-up window switcher, run dialog, dmenu replacement, and +more. It focuses on being fast to use and have minimal distraction. It supports +keyboard and mouse navigation, type to filter, tokenized search and more.

+

USAGE

+

rofi's main functionality is to assist in your workflow, allowing you to +quickly switch between windows, start applications or log into a remote machine +via ssh. There are different modes for different types of actions. rofi +is a standalone application and should not be integrated into scripts. For +integration into scripts it has a special mode that functions as a (drop-in) +replacement for dmenu(1). See emulating dmenu below.

+

Running rofi

+

To launch rofi directly in a certain mode, specify a mode with rofi -show <mode>. +To show the drun dialog:

+
    rofi -show drun
+
+

A very useful setup in minimalistic window managers is to combine drun, run +with window mode:

+
  rofi -show combi -modes combi -combi-modes "window,drun,run"
+
+

In this setup it first list all open applications, then all installed +applications. So if you type firefox and hit return, it will switch to the +running firefox, or launch it when it is not running.

+

Emulating dmenu

+

rofi can emulate dmenu(1) (a dynamic menu for X11) when launched with +the -dmenu flag.

+

For more information see rofi-dmenu(5).

+

Display Error message

+

rofi error dialog can also be called from the command line.

+
rofi -e "my message"
+
+

Markup support can be enabled, see CONFIGURATION options.

+

CONFIGURATION

+

There are currently three methods of setting configuration options (evaluated in order below):

+
    +
  • System configuration file (for example /etc/rofi.rasi). + It first checks XDG_CONFIG_DIRS, and then SYSCONFDIR (that is passed at compile time). + It loads the first config file it finds, it does not merge multiple system configuration files.
  • +
  • Rasi theme file: The new theme format can be used to set configuration values.
  • +
  • Command-line options: Arguments passed to rofi.
  • +
+

To get a template config file, run: rofi -dump-config > config.rasi

+

This will contain (commented) all current configuration options, modified options are uncommented.

+

To get a template config file that sets the icon-theme run: rofi -icon-theme hicolor -dump-config.

+

It is strongly recommended to use this as a starting point for your configuration.

+

An empty configuration section in the config file looks like:

+
configuration {
+ // set config options here
+}
+
+

Most of the configuration options mentioned below (beside options like -show, +-dump-config that apply to a single run) can be set here.

+

For example to set the dpi value to 72:

+
configuration {
+    dpi: 72;
+}
+
+

The configuration system supports the following types:

+
    +
  • string
  • +
  • integer (signed and unsigned)
  • +
  • char
  • +
  • boolean
  • +
  • lists
  • +
+

For the syntax of these options, see the rofi-theme(5) manpage.

+

For use on the command line, Boolean options have a non-default command-line +syntax. Example to enable option X:

+
-X
+
+

To disable option X:

+
-no-X
+
+

Below is a list of the most important options:

+

General

+

-help

+

The help option shows the full list of command-line options and the current set +values. These include dynamic (run-time generated) options.

+

-version

+

Show the rofi version and exit.

+

-dump-config

+

Dump the current active configuration, in rasi format, to stdout and exit. +Information about the rasi format can be found in the rofi-theme(5) manpage.

+

-dump-theme

+

Dump the current active theme, in rasi format, to stdout and exit.

+

-rasi-validate filename

+

Try to parse the file and return 0 when successful, non-zero when failed.

+

-threads num

+

Specify the number of threads rofi should use:

+
    +
  • 0: Autodetect the number of supported hardware threads.
  • +
  • 1: Disable threading
  • +
  • +

    2..n: Specify the maximum number of threads to use in the thread pool.

    +

    Default: Autodetect

    +
  • +
+

-display display

+

The X server to contact. Default is $DISPLAY.

+

-dmenu

+

Run rofi in dmenu mode. This allows for interactive scripts. +In dmenu mode, rofi reads from STDIN, and output to STDOUT. +A simple example, displaying three pre-defined options:

+
echo -e "Option #1\nOption #2\nOption #3" | rofi -dmenu
+
+

Or get the options from a script:

+
~/my_script.sh | rofi -dmenu
+
+

See the rofi-dmenu(5) manpage for more information.

+

-show mode

+

Open rofi in a certain mode. Available modes are window, run, drun, +ssh, combi. The special argument keys can be used to open a searchable +list of supported key bindings +(see the rofi-keys(5) manpage)

+

To show the run-dialog:

+
rofi -show run
+
+

If -show is the last option passed to rofi, the first enabled modes is shown.

+

-modes mode1,mode2

+

Specify an ordered, comma-separated list of modes to enable. +Enabled modes can be changed at runtime. Default key is Ctrl+Tab. +If no modes are specified, all configured modes will be enabled. +To only show the run and ssh launcher:

+
rofi -modes "run,ssh" -show run
+
+

Custom modes can be added using the internal script mode. Each such mode has +two parameters:

+
<name>:<script>
+
+

Example: Have a mode called 'Workspaces' using the i3_switch_workspaces.sh script:

+
rofi -modes "window,run,ssh,Workspaces:i3_switch_workspaces.sh" -show Workspaces
+
+

Notes: The i3 window manager dislikes commas in the command when specifying an +exec command. For that case, # can be used as a separator.

+

TIP: The name is allowed to contain spaces:

+
rofi -modes "My File Browser:fb.sh" -show "My File Browser"
+
+

-case-sensitive

+

Start in case-sensitive mode. +This option can be changed at run-time using the -kb-toggle-case-sensitivity key binding.

+

-cycle

+

Cycle through the result list. Default is 'true'.

+

-filter filter

+

Filter the list by setting text in input bar to filter

+

-config filename

+

Load an alternative configuration file.

+

-cache-dir filename

+

Directory that is used to place temporary files, like history.

+

-scroll-method method

+

Select the scrolling method. 0: Per page, 1: continuous.

+

-normalize-match

+

Normalize the string before matching, so o will match ö, and é matches e.
+This is not a perfect implementation, but works. For now, it disables highlighting of the matched part.

+

-no-lazy-grab

+

Disables lazy grab, this forces the keyboard being grabbed before gui is shown.

+

-no-plugins

+

Disable plugin loading.

+

-plugin-path directory

+

Specify the directory where rofi should look for plugins.

+

-show-icons

+

Show application icons in drun and window modes.

+

-icon-theme

+

Specify icon theme to be used. +If not specified default theme from DE is used, Adwaita and gnome themes act as +fallback themes.

+

-markup

+

Use Pango markup to format output wherever possible.

+

-normal-window

+

Make rofi react like a normal application window. Useful for scripts like Clerk that are basically an application.

+

-[no-]steal-focus

+

Make rofi steal focus on launch and restore close to window that held it when launched.

+

-refilter-timeout-limit

+

The limit of elements that is used to switch from instant to delayed filter mode.

+

Default: 8192

+

A fallback icon can be specified for each mode:

+
configuration {
+    <mode>{
+      fallback-icon: "<icon name>";
+    }
+}
+
+

Example

+
configuration {
+    run,drun {
+      fallback-icon: "application-x-addon";
+    }
+}
+
+

Matching

+

-matching method

+

Specify the matching algorithm used. +Currently, the following methods are supported:

+
    +
  • normal: match the int string
  • +
  • regex: match a regex input
  • +
  • glob: match a glob pattern
  • +
  • fuzzy: do a fuzzy match
  • +
  • prefix: match prefix
  • +
+

Default: normal

+

Note: glob matching might be slow for larger lists

+

-tokenize

+

Tokenize the input.

+

-drun-categories category1,category2

+

Only show desktop files that are present in the listed categories.

+

-drun-match-fields field1,field2,...

+

When using drun, match only with the specified Desktop entry fields. +The different fields are:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
  • +

    all: all the above

    +

    Default: name,generic,exec,categories,keywords

    +
  • +
+

-drun-display-format

+

The format string for the drun dialog:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
+

Pango markup can be used to formatting the output.

+
Default: {name} [<span weight='light' size='small'><i>({generic})</i></span>]
+
+

Note: Only fields enabled in -drun-match-fields can be used in the format string.

+

-[no-]drun-show-actions

+

Show actions present in the Desktop files.

+
Default: false
+
+

-window-match-fields field1,field2,...

+

When using window mode, match only with the specified fields. +The different fields are:

+
    +
  • title: window's title
  • +
  • class: window's class
  • +
  • role: window's role
  • +
  • name: window's name
  • +
  • desktop: window's current desktop
  • +
  • +

    all: all the above

    +

    Default: all

    +
  • +
+

-matching-negate-char char

+

Set the character used to negate the query (i.e. if it does not match the next keyword). +Set to '\x0' to disable.

+
Default: '-'
+
+

Layout and Theming

+

IMPORTANT: + In newer rofi releases, all the theming options have been moved into the new theme format. They are no longer normal + rofi options that can be passed directly on the command line (there are too many). + Small snippets can be passed on the command line: rofi -theme-str 'window {width: 50%;}' to override a single + setting. They are merged into the current theme. + They can also be appended at the end of the rofi config file to override parts of the theme.

+

Most of the following options are deprecated and should not be used. Please use the new theme format to customize +rofi. More information about the new format can be found in the rofi-theme(5) manpage.

+

-location

+

Specify where the window should be located. The numbers map to the following locations on screen:

+
  1 2 3
+  8 0 4
+  7 6 5
+
+

Default: 0

+

-fixed-num-lines

+

Keep a fixed number of visible lines.

+

-sidebar-mode

+

Open in sidebar-mode. In this mode, a list of all enabled modes is shown at the bottom. +(See -modes option) +To show sidebar, use:

+
rofi -show run -sidebar-mode
+
+

-hover-select

+

Automatically select the entry the mouse is hovering over. This option is best combined with custom mouse bindings. +To utilize hover-select and accept an entry in a single click, use:

+
rofi -show run -hover-select -me-select-entry '' -me-accept-entry MousePrimary
+
+

-eh number

+

Set row height (in chars) +Default: 1

+

-auto-select

+

When one entry is left, automatically select it.

+

-m num

+

-m name

+

-monitor num

+

-monitor name

+

Select monitor to display rofi on. +It accepts as input: primary (if primary output is set), the xrandr output name, or integer number (in order of +detection). Negative numbers are handled differently:

+
    +
  • -1: the currently focused monitor.
  • +
  • -2: the currently focused window (that is, rofi will be displayed on top of the focused window).
  • +
  • -3: Position of mouse (overrides the location setting to get normal context menu + behavior.)
  • +
  • -4: the monitor with the focused window.
  • +
  • +

    -5: the monitor that shows the mouse pointer.

    +

    Default: -5

    +
  • +
+

See rofi -h output for the detected monitors, their position, and size.

+

-theme filename

+

Path to the new theme file format. This overrides the old theme settings.

+

-theme-str string

+

Allow theme parts to be specified on the command line as an override.

+

For example:

+
rofi -theme-str '#window { fullscreen: true; }'
+
+

This option can be specified multiple times. +This is now the method to tweak the theme via the command line.

+

-dpi number

+

Override the default DPI setting.

+
    +
  • If set to 0, it tries to auto-detect based on X11 screen size (similar to i3 and GTK).
  • +
  • If set to 1, it tries to auto-detect based on the size of the monitor that rofi is displayed on (similar to latest Qt 5).
  • +
+

-selected-row selected row

+

Select a certain row.

+

Default: 0

+

PATTERN setting

+

-terminal

+

Specify which terminal to start.

+
rofi -terminal xterm
+
+

Pattern: {terminal}

+

Default: x-terminal-emulator

+

-ssh-client client

+

Override the used ssh client.

+

Pattern: {ssh-client}

+

Default: ssh

+

SSH settings

+

-ssh-command cmd

+

Set the command to execute when starting an ssh session. +The pattern {host} is replaced by the selected ssh entry.

+

Pattern: {ssh-client}

+

Default: {terminal} -e {ssh-client} {host}

+

-parse-hosts

+

Parse the /etc/hosts file for entries.

+

Default: disabled

+

-parse-known-hosts +-no-parse-known-hosts

+

Parse the ~/.ssh/known_hosts file for entries.

+

Default: enabled

+

Run settings

+

-run-command cmd

+

Set command ({cmd}) to execute when running an application. +See PATTERN.

+

Default: {cmd}

+

-run-shell-command cmd

+

Set command to execute when running an application in a shell. +See PATTERN.

+

Default: {terminal} -e {cmd}

+

-run-list-command cmd

+

If set, use an external tool to generate a list of executable commands. Uses run-command.

+

Default: {cmd}

+

Window switcher settings

+

-window-format format

+

Format what is being displayed for windows.

+

format: {field[:len]}

+

field:

+
    +
  • w: desktop name
  • +
  • t: title of window
  • +
  • n: name
  • +
  • r: role
  • +
  • c: class
  • +
+

len: maximum field length (0 for auto-size). If length and window width are negative, field length is width - len.
+If length is positive, the entry will be truncated or padded to fill that length.

+

default: {w} {c} {t}

+

-window-command cmd

+

Set command to execute on selected window for an alt action (-kb-accept-alt). +See PATTERN.

+

Default: "wmctrl -i -R {window}"

+

-window-thumbnail

+

Show window thumbnail (if available) as icon in the window switcher.

+

You can stop rofi from exiting when closing a window (allowing multiple to be closed in a row).

+
configuration {
+  window {
+      close-on-delete: false;
+  }
+}
+
+

You can hide the currently active window with the 'hide-active-window' setting:

+
configuration {
+  window {
+      hide-active-window: true;
+  }
+}
+
+

or pass -window-hide-active-window true on command line.

+

Combi settings

+

-combi-modes mode1,mode2

+

The modes to combine in combi mode. +For syntax to -combi-modes, see -modes. +To get one merge view, of window,run, and ssh:

+
rofi -show combi -combi-modes "window,run,ssh" -modes combi
+
+

NOTE: The i3 window manager dislikes commas in the command when specifying an exec command. +For that case, # can be used as a separator.

+

-combi-display-format

+

The format string for entries in the combi dialog:

+
    +
  • mode: the mode display name
  • +
  • text: the entry text
  • +
+

Pango markup can be used to formatting the output.

+
Default: {mode} {text}
+
+

Note: This setting is ignored if combi-hide-mode-prefix is enabled.

+

History and Sorting

+

-disable-history +-no-disable-history (re-enable history)

+

Disable history

+

-sort to enable +-no-sort to disable

+

Enable, disable sorting. +This setting can be changed at runtime (see -kb-toggle-sort).

+

-sorting-method 'method' to specify the sorting method.

+

There are 2 sorting methods:

+
    +
  • levenshtein (Default)
  • +
  • fzf sorting.
  • +
+

-max-history-size number

+

Maximum number of entries to store in history. Defaults to 25. (WARNING: can cause slowdowns when set too high)

+

Message dialog

+

-e message

+

Pops up a message dialog (used internally for showing errors) with message. +Message can be multi-line.

+

File browser settings

+

File browser behavior can be controlled via the following options:

+
configuration {
+   filebrowser {
+      /** Directory the file browser starts in. */
+      directory: "/some/directory";
+      /**
+        * Sorting method. Can be set to:
+        *   - "name"
+        *   - "mtime" (modification time)
+        *   - "atime" (access time)
+        *   - "ctime" (change time)
+        */
+      sorting-method: "name";
+      /** Group directories before files. */
+      directories-first: true;
+   }
+}
+
+

Other

+

-drun-use-desktop-cache

+

Build and use a cache with the content of desktop files. Usable for systems with slow hard drives.

+

-drun-reload-desktop-cache

+

If drun-use-desktop-cache is enabled, rebuild a cache with the content of desktop files.

+

-drun-url-launcher command

+

Command to open a Desktop Entry that is a Link.

+

-pid path

+

Make rofi create a pid file and check this on startup. The pid file prevents multiple rofi instances from running simultaneously. This is useful when running rofi from a key-binding daemon.

+

-replace

+

If rofi is already running, based on pid file, try to kill that instance.

+

-display-{mode} string

+

Set the name to use for mode. This is used as prompt and in combi-browser.

+

It is now preferred to use the configuration file:

+
configuration {
+  {mode} {
+    display-name: *string*;
+  }
+}
+
+

-click-to-exit +-no-click-to-exit

+

Click the mouse outside the rofi window to exit.

+

Default: enabled

+

-xserver-i300-workaround

+

Workaround for bug in Xserver. See issue #611 and #1642 on the rofi issue tracker.

+

Default: disabled

+

PATTERN

+

To launch commands (for example, when using the ssh launcher), the user can enter the used command-line. The following keys can be used that will be replaced at runtime:

+
    +
  • {host}: the host to connect to
  • +
  • {terminal}: the configured terminal (see -terminal)
  • +
  • {ssh-client}: the configured ssh client (see -ssh-client)
  • +
  • {cmd}: the command to execute
  • +
  • {window}: the window ID of the selected window (in window-command)
  • +
+

THEMING

+

Please see rofi-theme(5) manpage for more information on theming.

+

KEY BINDINGS

+

Please see the rofi-keys(5) manpage for the keybindings and how to set them up.

+

The keybinding can also be used for actions, when the action is executed the +mentioned keystroke is inserted:

+

Timeout

+

You can configure an action to be taken when rofi has not been interacted +with for a certain amount of seconds. You can specify a keybinding to trigger +after X seconds.

+
configuration {
+  timeout {
+      delay:  15;
+      action: "kb-cancel";
+  }
+}
+
+

Input change

+

When the input of the textbox changes:

+
configuration {
+  inputchange {
+      action: "kb-row-first";
+  }
+}
+
+

Available Modes

+

window

+

Show a list of all the windows and allow switching between them. +Pressing the delete-entry binding (shift-delete) will close the window. +Pressing the accept-custom binding (control-enter or shift-enter) will run a command on the window. +(See option window-command );

+

If there is no match, it will try to launch the input.

+

windowcd

+

Shows a list of the windows on the current desktop and allows switching between them. +Pressing the delete-entry binding (shift-delete) will kill the window. +Pressing the accept-custom binding (control-enter or shift-enter) will run a command on the window. +(See option window-command );

+

If there is no match, it will try to launch the input.

+

run

+

Shows a list of executables in $PATH and can launch them (optional in a terminal). +Pressing the delete-entry binding (shift-delete) will remove this entry from the run history. +Pressing the accept-custom binding (control-enter) will run the command as entered in the entry box. +Pressing the accept-alt binding (shift-enter) will run the command in a terminal.

+

When pressing the mode-complete binding (Control-l), you can use the File Browser mode to launch the application +with a file as the first argument.

+

drun

+

Same as the run launches, but the list is created from the installed desktop files. It automatically launches them +in a terminal if specified in the Desktop File. +Pressing the delete-entry binding (shift-delete) will remove this entry from the run history. +Pressing the accept-custom binding (control-enter) will run the command as entered in the entry box. +Pressing the accept-alt binding (shift-enter) will run the command in a terminal.

+

When pressing the mode-complete binding (Control-l), you can use the File Browser mode to launch the application +passing a file as argument if specified in the desktop file.

+

The DRUN mode tries to follow the XDG Desktop Entry +Specification and should be compatible with +applications using this standard. Some applications create invalid desktop files, rofi will discard these entries. +See the debugging section for more info on DRUN mode, this will print why desktop files are +discarded.

+

There are two advanced options to tweak the behaviour:

+
configuration {
+   drun {
+      /** Parse user desktop files. */
+      parse-user:   true;
+      /** Parse system desktop files. */
+      parse-system: false;
+   }
+}
+
+

ssh

+

Shows a list of SSH targets based on your ssh config file, and allows to quickly ssh into them.

+

keys

+

Shows a searchable list of key bindings.

+

script

+

Allows custom scripted Modes to be added, see the rofi-script(5) manpage for more information.

+

combi

+

Combines multiple modes in one list. Specify which modes are included with the -combi-modes option.

+

When using the combi mode, a !bang can be used to filter the results by modes. +All modes that match the bang as a prefix are included. +For example, say you have specified -combi-modes run,window,windowcd. If your +query begins with the bang !w, only results from the window and windowcd +modes are shown, even if the rest of the input text would match results from run.

+

If no match, the input is handled by the first combined modes.

+

FAQ

+

The text in the window switcher is not nicely aligned.

+

Try using a mono-space font or tabs + the tab-stops setting..

+

The window is completely black.

+

Check quotes used on the command-line: you might have used ("smart quotes") instead of " ("machine quotes").

+

What does the icon in the top right show?

+

The indicator shows:

+
` ` Case insensitive and no sorting.
+`-` Case sensitivity enabled, no sorting.
+`+` Case insensitive and Sorting enabled
+`±` Sorting and Case sensitivity enabled"
+
+

Why do I see different icons for run,drun and window mode

+

Each of these modes uses different methods of resolving the icon:

+
    +
  • Window: It first uses the icon that the application exposes via the X11 + Server, if none is set it does a lookup of the window Class name in the icon theme.
  • +
  • drun: It uses the icon set in the desktop file.
  • +
  • run: It does a lookup using the executable name.
  • +
+

EXAMPLES

+

Some basic usage examples of rofi:

+

Show the run dialog:

+
rofi -modes run -show run
+
+

Show the run dialog, and allow switching to Desktop File run dialog (drun):

+
rofi -modes run,drun -show run
+
+

Combine the run and Desktop File run dialog (drun):

+
rofi -modes combi -show combi -combi-modes run,drun
+
+

Combine the run and Desktop File run dialog (drun), and allow switching to window switcher:

+
rofi -modes combi,window -show combi -combi-modes run,drun
+
+

Pop up a text message claiming that this is the end:

+
rofi -e "This is the end"
+
+

Pop up a text message in red, bold font claiming that this is still the end:

+
rofi -e "<span color='red'><b>This is still the end</b></span>" -markup
+
+

Show all key bindings:

+
rofi -show keys
+
+

i3

+

In i3 you want to bind rofi to be launched on key release. Otherwise, it cannot grab the keyboard. +See also the i3 manual:

+

Some tools (such as import or xdotool) might be unable to run upon a KeyPress event, because the keyboard/pointer is +still grabbed. For these situations, the --release flag can be used, as it will execute the command after the keys have +been released.

+

LICENSE

+
MIT/X11
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+

WEBSITE

+

rofi website can be found here

+

SUPPORT

+

rofi support can be obtained: + * GitHub Discussions + * Forum (Reddit) + * IRC (#rofi on irc.libera.chat),

+

DEBUGGING

+

For more information see rofi-debugging(5) manpage.

+

ISSUE TRACKER

+

The rofi issue tracker can be found here +Before creating an issue, consider posting a question on the discussion forum first. +When creating an issue, please read this +first.

+

SEE ALSO

+

rofi-sensible-terminal(1), dmenu(1), rofi-debugging(5), rofi-theme(5), rofi-script(5), rofi-keys(5),rofi-theme-selector(1),rofi-dmenu(5)

+

AUTHOR

+ +

Original code based on work by: Sean Pringle sean.pringle@gmail.com

+

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

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.5/rofi-debugging.5/index.html b/1.7.5/rofi-debugging.5/index.html new file mode 100644 index 00000000..a5c7ef02 --- /dev/null +++ b/1.7.5/rofi-debugging.5/index.html @@ -0,0 +1,1430 @@ + + + + + + + + + + + + + + + + + + + + + + Debugging - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI DEBUGGING 5 rofi debugging

+

NAME

+

Debugging rofi.

+

When reporting an issue with rofi crashing, or misbehaving. It helps to do some small test +to help pin-point the problem.

+

First try disabling your custom configuration: -no-config

+

This disables the parsing of the configuration files. This runs rofi in stock mode.

+

If you run custom C plugins, you can disable the plugins using: -no-plugins

+

Get the relevant information for an issue

+

Please pastebin the output of the following commands:

+
rofi -help
+rofi -dump-config
+rofi -dump-theme
+
+

rofi -help provides us with the configuration files parsed, the exact version, monitor layout +and more useful information.

+

The rofi -dump-config and rofi -dump-theme output gives us rofi +interpretation of your configuration and theme.

+

Please check the output for identifiable information and remove this.

+

Timing traces

+

To get a timing trace, enable the Timings debug domain.

+
G_MESSAGES_DEBUG=Timings rofi -show drun
+
+

It will show a trace with (useful) timing information at relevant points during the execution. +This will help debugging when rofi is slow to start.

+

Example trace:

+
(process:14942): Timings-DEBUG: 13:47:39.335: 0.000000 (0.000000): Started
+(process:14942): Timings-DEBUG: 13:47:39.335: 0.000126 (0.000126): ../source/rofi.c:main:786 
+(process:14942): Timings-DEBUG: 13:47:39.335: 0.000163 (0.000037): ../source/rofi.c:main:819 
+(process:14942): Timings-DEBUG: 13:47:39.336: 0.000219 (0.000056): ../source/rofi.c:main:826 Setup Locale
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001235 (0.001016): ../source/rofi.c:main:828 Collect MODI
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001264 (0.000029): ../source/rofi.c:main:830 Setup MODI
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001283 (0.000019): ../source/rofi.c:main:834 Setup mainloop
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001369 (0.000086): ../source/rofi.c:main:837 NK Bindings
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001512 (0.000143): ../source/xcb.c:display_setup:1177 Open Display
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001829 (0.000317): ../source/xcb.c:display_setup:1192 Setup XCB
+(process:14942): Timings-DEBUG: 13:47:39.346: 0.010650 (0.008821): ../source/rofi.c:main:844 Setup Display
+(process:14942): Timings-DEBUG: 13:47:39.346: 0.010715 (0.000065): ../source/rofi.c:main:848 Setup abe
+(process:14942): Timings-DEBUG: 13:47:39.350: 0.015101 (0.004386): ../source/rofi.c:main:883 Load cmd config 
+(process:14942): Timings-DEBUG: 13:47:39.351: 0.015275 (0.000174): ../source/rofi.c:main:907 Setup Modi
+(process:14942): Timings-DEBUG: 13:47:39.351: 0.015291 (0.000016): ../source/view.c:rofi_view_workers_initialize:1922 Setup Threadpool, start
+(process:14942): Timings-DEBUG: 13:47:39.351: 0.015349 (0.000058): ../source/view.c:rofi_view_workers_initialize:1945 Setup Threadpool, done
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032018 (0.016669): ../source/rofi.c:main:1000 Setup late Display
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032080 (0.000062): ../source/rofi.c:main:1003 Theme setup
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032109 (0.000029): ../source/rofi.c:startup:668 Startup
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032121 (0.000012): ../source/rofi.c:startup:677 Grab keyboard
+(process:14942): Timings-DEBUG: 13:47:39.368: 0.032214 (0.000093): ../source/view.c:__create_window:701 xcb create window
+(process:14942): Timings-DEBUG: 13:47:39.368: 0.032235 (0.000021): ../source/view.c:__create_window:705 xcb create gc
+(process:14942): Timings-DEBUG: 13:47:39.368: 0.033136 (0.000901): ../source/view.c:__create_window:714 create cairo surface
+(process:14942): Timings-DEBUG: 13:47:39.369: 0.033286 (0.000150): ../source/view.c:__create_window:723 pango cairo font setup
+(process:14942): Timings-DEBUG: 13:47:39.369: 0.033351 (0.000065): ../source/view.c:__create_window:761 configure font
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045896 (0.012545): ../source/view.c:__create_window:769 textbox setup
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045944 (0.000048): ../source/view.c:__create_window:781 setup window attributes
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045955 (0.000011): ../source/view.c:__create_window:791 setup window fullscreen
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045966 (0.000011): ../source/view.c:__create_window:797 setup window name and class
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045974 (0.000008): ../source/view.c:__create_window:808 setup startup notification
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045981 (0.000007): ../source/view.c:__create_window:810 done
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045992 (0.000011): ../source/rofi.c:startup:679 Create Window
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045999 (0.000007): ../source/rofi.c:startup:681 Parse ABE
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.046113 (0.000114): ../source/rofi.c:startup:684 Config sanity check
+(process:14942): Timings-DEBUG: 13:47:39.384: 0.048229 (0.002116): ../source/dialogs/run.c:get_apps:216 start
+(process:14942): Timings-DEBUG: 13:47:39.390: 0.054626 (0.006397): ../source/dialogs/run.c:get_apps:336 stop
+(process:14942): Timings-DEBUG: 13:47:39.390: 0.054781 (0.000155): ../source/dialogs/drun.c:get_apps:634 Get Desktop apps (start)
+(process:14942): Timings-DEBUG: 13:47:39.391: 0.055264 (0.000483): ../source/dialogs/drun.c:get_apps:641 Get Desktop apps (user dir)
+(process:14942): Timings-DEBUG: 13:47:39.418: 0.082884 (0.027620): ../source/dialogs/drun.c:get_apps:659 Get Desktop apps (system dirs)
+(process:14942): Timings-DEBUG: 13:47:39.418: 0.082944 (0.000060): ../source/dialogs/drun.c:get_apps_history:597 Start drun history
+(process:14942): Timings-DEBUG: 13:47:39.418: 0.082977 (0.000033): ../source/dialogs/drun.c:get_apps_history:617 Stop drun history
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083638 (0.000661): ../source/dialogs/drun.c:get_apps:664 Sorting done.
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083685 (0.000047): ../source/view.c:rofi_view_create:1759 
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083700 (0.000015): ../source/view.c:rofi_view_create:1783 Startup notification
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083711 (0.000011): ../source/view.c:rofi_view_create:1786 Get active monitor
+(process:14942): Timings-DEBUG: 13:47:39.420: 0.084693 (0.000982): ../source/view.c:rofi_view_refilter:1028 Filter start
+(process:14942): Timings-DEBUG: 13:47:39.421: 0.085992 (0.001299): ../source/view.c:rofi_view_refilter:1132 Filter done
+(process:14942): Timings-DEBUG: 13:47:39.421: 0.086090 (0.000098): ../source/view.c:rofi_view_update:982 
+(process:14942): Timings-DEBUG: 13:47:39.421: 0.086123 (0.000033): ../source/view.c:rofi_view_update:1002 Background
+(process:14942): Timings-DEBUG: 13:47:39.428: 0.092864 (0.006741): ../source/view.c:rofi_view_update:1008 widgets
+
+

Debug domains

+

To further debug the plugin, you can get a trace with (lots of) debug information. This debug output can be enabled for +multiple parts in rofi using the glib debug framework. Debug domains can be enabled by setting the G_MESSAGES_DEBUG +environment variable. At the time of creation of this page, the following debug domains exist:

+
    +
  • all: Show debug information from all domains.
  • +
  • X11Helper: The X11 Helper functions.
  • +
  • View: The main window view functions.
  • +
  • Widgets.Box: The Box widget.
  • +
  • Modes.DMenu: The dmenu mode.
  • +
  • Modes.Run: The run mode.
  • +
  • Modes.DRun: The desktop file run mode.
  • +
  • Modes.Window: The window mode.
  • +
  • Modes.Script: The script mode.
  • +
  • Modes.Combi: The script mode.
  • +
  • Modes.Ssh: The ssh mode.
  • +
  • Rofi: The main application.
  • +
  • Timings: Get timing output.
  • +
  • Theme: Theme engine debug output. (warning lots of output).
  • +
  • Widgets.Icon: The Icon widget.
  • +
  • Widgets.Box: The box widget.
  • +
  • Widgets.Container: The container widget.
  • +
  • Widgets.Window: The window widget.
  • +
  • Helpers.IconFetcher: Information about icon lookup.
  • +
+

For full list see man rofi.

+

Example: G_MESSAGES_DEBUG=Dialogs.DRun rofi -show drun To get specific output from the Desktop file run dialog.

+

To redirect the debug output to a file (~/rofi.log) add:

+
rofi -show drun -log ~/rofi.log
+
+

Specifying the logfile automatically enabled all log domains. +This can be useful when rofi is launched from a window manager.

+

Creating a backtrace.

+

First make sure you compile rofi with debug symbols:

+
make CFLAGS="-O0 -g3" clean rofi
+
+

Getting a backtrace using GDB is not very handy. Because if rofi get stuck, it grabs keyboard and +mouse. So if it crashes in GDB you are stuck. +The best way to go is to enable core file. (ulimit -c unlimited in bash) then make rofi crash. You +can then load the core in GDB.

+
gdb rofi core
+
+

Then type inside gdb:

+
thread apply all bt
+
+

The output trace is useful when reporting crashes.

+

Some distribution have systemd-coredump, this way you can easily get a backtrace via coredumpctl.

+

SEE ALSO

+

rofi-sensible-terminal(1), dmenu(1), rofi-debugging(5), rofi-theme(5), rofi-script(5), rofi-keys(5),rofi-theme-selector(1)

+

AUTHOR

+ + + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.5/rofi-dmenu.5/index.html b/1.7.5/rofi-dmenu.5/index.html new file mode 100644 index 00000000..46f77df6 --- /dev/null +++ b/1.7.5/rofi-dmenu.5/index.html @@ -0,0 +1,1483 @@ + + + + + + + + + + + + + + + + + + + + + + Dmenu - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

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.

+

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).

+

BASIC CONCEPT

+

In dmenu mode, rofi reads data from standard in, splits them into separate entries and displays them. +If the user selects a row, this is printed out to standard out, allowing the script to process it further.

+

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.

+

USAGE

+

By launching rofi with the -dmenu flag it will go into dmenu emulation mode.

+
ls | rofi -dmenu
+
+

DMENU DROP-IN REPLACEMENT

+

If argv[0] (calling command) is dmenu, rofi will start in dmenu mode. +This way, it can be used as a drop-in replacement for dmenu. Just copy or symlink rofi to dmenu in $PATH.

+
ln -s /usr/bin/rofi /usr/bin/dmenu
+
+

DMENU VS SCRIPT MODE

+

Script mode is used to extend rofi, dmenu mode is used to extend a script. +The two do share much of the same input format. Please see the rofi-script(5) manpage for more information.

+

DMENU SPECIFIC COMMANDLINE FLAGS

+

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.

+

-sep separator

+

Separator for dmenu. Example: To show a list of 'a' to 'e' with '|' as a separator:

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
+
+

-p prompt

+

Specify the prompt to show in dmenu mode. For example, select 'monkey', a,b,c,d, or e.

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey"
+
+

Default: dmenu

+

-l number of lines to show

+

Maximum number of lines the menu may show before scrolling.

+
rofi -dmenu -l 25
+
+

Default: 15

+

-i

+

Makes dmenu searches case-insensitive

+

-a X

+

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:

+
    +
  • 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'
  • +
+

-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

+

Allows the output of dmenu to be customized (N is the total number of input entries):

+
    +
  • '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)
  • +
+

Default: 's'

+

-select string

+

Select first line that matches the given string

+

-mesg string

+

Add a message line below the filter entry box. Supports Pango markup. +For more information on supported markup, see here

+

-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. +See here for details about Pango markup.

+

-multi-select

+

Allow multiple lines to be selected. Adds a small selection indicator to the left of each entry.

+

-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-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.

+

-display-columns

+

A comma seperated list of columns to show.

+

-display-column-separator

+

The column separator. This is a regex.

+

default: '\t'

+

-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.

+

default: "☐ "

+

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)

+

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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.5/rofi-keys.5/index.html b/1.7.5/rofi-keys.5/index.html new file mode 100644 index 00000000..7a0870a0 --- /dev/null +++ b/1.7.5/rofi-keys.5/index.html @@ -0,0 +1,2657 @@ + + + + + + + + + + + + + + + + + + + + + + Keys - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-KEYS 5 rofi-keys

+

NAME

+

rofi keys - Rofi Key and Mouse bindings

+

DESCRIPTION

+

rofi supports overriding of any of it key and mouse binding.

+

Setting binding

+

Bindings can be done on the commandline (-{bindingname}):

+
rofi -show run -kb-accept-entry 'Control+Shift+space'
+
+

or via the configuration file:

+
configuration {
+  kb-accept-entry: "Control+Shift+space";
+}
+
+

The key can be set by its name (see above) or its keycode:

+
configuration {
+  kb-accept-entry: "Control+Shift+[65]";
+}
+
+

An easy way to look up keycode is xev(1).

+

Multiple keys can be specified for an action as a comma separated list:

+
configuration {
+  kb-accept-entry: "Control+Shift+space,Return";
+}
+
+

By Default rofi reacts on pressing, to act on the release of all keys +prepend the binding with !:

+
configuration {
+  kb-accept-entry: "!Control+Shift+space,Return";
+}
+
+

Keyboard Bindings

+

kb-primary-paste:

+

Paste primary selection

+

Default: Control+V,Shift+Insert

+

kb-secondary-paste

+

Paste clipboard

+

Default: Control+v,Insert

+

kb-clear-line

+

Clear input line

+

Default: Control+w

+

kb-move-front

+

Beginning of line

+

Default: Control+a

+

kb-move-end

+

End of line

+

Default: Control+e

+

kb-move-word-back

+

Move back one word

+

Default: Alt+b,Control+Left

+

kb-move-word-forward

+

Move forward one word

+

Default: Alt+f,Control+Right

+

kb-move-char-back

+

Move back one char

+

Default: Left,Control+b

+

kb-move-char-forward

+

Move forward one char

+

Default: Right,Control+f

+

kb-remove-word-back

+

Delete previous word

+

Default: Control+Alt+h,Control+BackSpace

+

kb-remove-word-forward

+

Delete next word

+

Default: Control+Alt+d

+

kb-remove-char-forward

+

Delete next char

+

Default: Delete,Control+d

+

kb-remove-char-back

+

Delete previous char

+

Default: BackSpace,Shift+BackSpace,Control+h

+

kb-remove-to-eol

+

Delete till the end of line

+

Default: Control+k

+

kb-remove-to-sol

+

Delete till the start of line

+

Default: Control+u

+

kb-accept-entry

+

Accept entry

+

Default: Control+j,Control+m,Return,KP_Enter

+

kb-accept-custom

+

Use entered text as command (in ssh/run modes)

+

Default: Control+Return

+

kb-accept-custom-alt

+

Use entered text as command (in ssh/run modes)

+

Default: Control+Shift+Return

+

kb-accept-alt

+

Use alternate accept command.

+

Default: Shift+Return

+

kb-delete-entry

+

Delete entry from history

+

Default: Shift+Delete

+

kb-mode-next

+

Switch to the next mode.

+

Default: Shift+Right,Control+Tab

+

kb-mode-previous

+

Switch to the previous mode.

+

Default: Shift+Left,Control+ISO_Left_Tab

+

kb-mode-complete

+

Start completion for mode.

+

Default: Control+l

+

kb-row-left

+

Go to the previous column

+

Default: Control+Page_Up

+

kb-row-right

+

Go to the next column

+

Default: Control+Page_Down

+

kb-row-up

+

Select previous entry

+

Default: Up,Control+p

+

kb-row-down

+

Select next entry

+

Default: Down,Control+n

+

kb-row-tab

+

Go to next row, if one left, accept it, if no left next mode.

+

Default:

+

kb-element-next

+

Go to next row.

+

Default: Tab

+

kb-element-prev

+

Go to previous row.

+

Default: ISO_Left_Tab

+

kb-page-prev

+

Go to the previous page

+

Default: Page_Up

+

kb-page-next

+

Go to the next page

+

Default: Page_Down

+

kb-row-first

+

Go to the first entry

+

Default: Home,KP_Home

+

kb-row-last

+

Go to the last entry

+

Default: End,KP_End

+

kb-row-select

+

Set selected item as input text

+

Default: Control+space

+

kb-screenshot

+

Take a screenshot of the rofi window

+

Default: Alt+S

+

kb-ellipsize

+

Toggle between ellipsize modes for displayed data

+

Default: Alt+period

+

kb-toggle-case-sensitivity

+

Toggle case sensitivity

+

Default: grave,dead_grave

+

kb-toggle-sort

+

Toggle sort

+

Default: Alt+grave

+

kb-cancel

+

Quit rofi

+

Default: Escape,Control+g,Control+bracketleft

+

kb-custom-1

+

Custom keybinding 1

+

Default: Alt+1

+

kb-custom-2

+

Custom keybinding 2

+

Default: Alt+2

+

kb-custom-3

+

Custom keybinding 3

+

Default: Alt+3

+

kb-custom-4

+

Custom keybinding 4

+

Default: Alt+4

+

kb-custom-5

+

Custom Keybinding 5

+

Default: Alt+5

+

kb-custom-6

+

Custom keybinding 6

+

Default: Alt+6

+

kb-custom-7

+

Custom Keybinding 7

+

Default: Alt+7

+

kb-custom-8

+

Custom keybinding 8

+

Default: Alt+8

+

kb-custom-9

+

Custom keybinding 9

+

Default: Alt+9

+

kb-custom-10

+

Custom keybinding 10

+

Default: Alt+0

+

kb-custom-11

+

Custom keybinding 11

+

Default: Alt+exclam

+

kb-custom-12

+

Custom keybinding 12

+

Default: Alt+at

+

kb-custom-13

+

Custom keybinding 13

+

Default: Alt+numbersign

+

kb-custom-14

+

Custom keybinding 14

+

Default: Alt+dollar

+

kb-custom-15

+

Custom keybinding 15

+

Default: Alt+percent

+

kb-custom-16

+

Custom keybinding 16

+

Default: Alt+dead_circumflex

+

kb-custom-17

+

Custom keybinding 17

+

Default: Alt+ampersand

+

kb-custom-18

+

Custom keybinding 18

+

Default: Alt+asterisk

+

kb-custom-19

+

Custom Keybinding 19

+

Default: Alt+parenleft

+

kb-select-1

+

Select row 1

+

Default: Super+1

+

kb-select-2

+

Select row 2

+

Default: Super+2

+

kb-select-3

+

Select row 3

+

Default: Super+3

+

kb-select-4

+

Select row 4

+

Default: Super+4

+

kb-select-5

+

Select row 5

+

Default: Super+5

+

kb-select-6

+

Select row 6

+

Default: Super+6

+

kb-select-7

+

Select row 7

+

Default: Super+7

+

kb-select-8

+

Select row 8

+

Default: Super+8

+

kb-select-9

+

Select row 9

+

Default: Super+9

+

kb-select-10

+

Select row 10

+

Default: Super+0

+

Mouse Bindings

+

ml-row-left

+

Go to the previous column

+

Default: ScrollLeft

+

ml-row-right

+

Go to the next column

+

Default: ScrollRight

+

ml-row-up

+

Select previous entry

+

Default: ScrollUp

+

ml-row-down

+

Select next entry

+

Default: ScrollDown

+

me-select-entry

+

Select hovered row

+

Default: MousePrimary

+

me-accept-entry

+

Accept hovered row

+

Default: MouseDPrimary

+

me-accept-custom

+

Accept hovered row with custom action

+

Default: Control+MouseDPrimary

+

SEE ALSO

+

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

+

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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.5/rofi-script.5/index.html b/1.7.5/rofi-script.5/index.html new file mode 100644 index 00000000..2e48324a --- /dev/null +++ b/1.7.5/rofi-script.5/index.html @@ -0,0 +1,1509 @@ + + + + + + + + + + + + + + + + + + + + + + Script - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-SCRIPT 5 rofi-script

+

NAME

+

rofi script mode - Rofi format for scriptable mode.

+

DESCRIPTION

+

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

+

USAGE

+

To specify a script mode, set a mode with the following syntax: "{name}:{executable}"

+

For example:

+
rofi -show fb -modes "fb:file_browser.sh"
+
+

The name should be unique.

+

API

+

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" ]
+then
+    exit 0
+fi
+echo "reload"
+echo "quit"
+
+
+

This shows two entries, reload and quit. When the quit entry is selected, rofi closes.

+

Environment

+

Rofi sets the following environment variable when executing the script:

+

ROFI_RETV

+

An integer number with the current state:

+
    +
  • 0: Initial call of script.
  • +
  • 1: Selected an entry.
  • +
  • 2: Selected a custom entry.
  • +
  • 10-28: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
  • +
+

ROFI_INFO

+

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

+

ROFI_DATA

+

Environment get set when script sets data option in header.

+

Passing mode options

+

Extra options, like setting the prompt, can be set by the script. +Extra 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:

+
    +
  • prompt: Update the prompt text.
  • +
  • message: Update the message text.
  • +
  • markup-rows: If 'true' renders markup in the row.
  • +
  • urgent: Mark rows as urgent. (for syntax see the urgent option in dmenu mode)
  • +
  • active: Mark rows as active. (for syntax see the active option in dmenu mode)
  • +
  • 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.
  • +
  • no-custom: If set to 'true'; only accept listed entries, ignore custom input.
  • +
  • use-hot-keys: If set to true, it enabled the Custom keybindings for script. Warning this breaks the normal rofi flow.
  • +
  • keep-selection: If set, the selection is not moved to the first entry, but the current position is maintained. The filter is cleared.
  • +
  • new-selection: If keep-selection is set, this allows you to override the selected entry (absolute position).
  • +
  • data: Passed data to the next execution of the script via ROFI_DATA.
  • +
  • theme: Small theme snippet to f.e. change the background color of a widget.
  • +
+

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 entry.

+

For example:

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

The following options are supported:

+
    +
  • icon: Set the icon for that row.
  • +
  • meta: Specify invisible search terms.
  • +
  • nonselectable: If true the row cannot activated.
  • +
  • info: Info that, on selection, gets placed in the ROFI_INFO environment variable. This entry does not get searched.
  • +
+

multiple entries can be passed using the \x1f separator.

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

Executing external program

+

If you want to launch an external program from the script, you need to make sure it is launched in the background. +If not rofi will wait for its output (to display).

+

In bash the best way to do this is using coproc.

+
 coproc ( myApp  > /dev/null  2>&1 )
+
+

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 github.

+

SEE ALSO

+

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

+

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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.5/rofi-theme.5/index.html b/1.7.5/rofi-theme.5/index.html new file mode 100644 index 00000000..c61a2afd --- /dev/null +++ b/1.7.5/rofi-theme.5/index.html @@ -0,0 +1,3291 @@ + + + + + + + + + + + + + + + + + + + + + + Themes - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ROFI-THEME 5 rofi-theme

+

NAME

+

rofi-theme - Rofi theme format files

+

GETTING STARTED WITH THEMING

+

The easiest way to get started theming rofi is by modifying your existing theme.

+

Themes can be modified/tweaked by adding theming elements to the end of the
+config file. The default location of this file is ~/.config/rofi/config.rasi, +if the file does not exists, you can create it.

+

A basic config:

+
configuration {
+  modes: [ combi ];
+  combi-modes: [ window, drun, run ];
+}
+
+@theme "gruvbox-light"
+
+/* Insert theme modifications after this */
+
+

For example if we want to change the Type to filter text in the entry box we +append the following:

+
entry {
+    placeholder: "Type here";
+}
+
+

In the above section, entry indicates the widget, placeholder is the +property we want to modify and we set it to the string "Type here". +To find the commonly available widgets in rofi, see the 'Basic structure' section.

+

To change the mouse over cursor to a pointer, add:

+
entry {
+    placeholder: "Type here";
+    cursor: pointer;
+}
+
+

For the next modification, we want to add the icon after each text element and +increase the size. First we start by modifying the element widget:

+

+element {
+  orientation: horizontal;
+  children: [ element-text, element-icon ];
+  spacing: 5px;
+}
+
+
+

Resulting in the following packing:

+
┌─────────────────────────────────────────────────────────────────────┐ 
+│ element                                                             │ 
+│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │ 
+│ │element─text                                 │ │ element─icon    │ │ 
+│ └─────────────────────────────────────────────┘ └─────────────────┘ │ 
+└─────────────────────────────────────────────────────────────────────┘ 
+
+

The element (container) widget hold each entry in the listview, we add the +two pre-defined children in the order we want to show. We also specify the +packing direction (orientation) and the spacing between the children +(spacing). We specify the space between the two children in absolute pixels +(px).

+

To increase the icon-size, we need to modify the element-icon widget.

+
element-icon {
+    size: 2.5em;
+}
+
+
┌─────────────────────────────────────────────────────────────────────┐ 
+│ element                                                             │ 
+│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │ 
+│ │element─text                                 │ │    element      │ │ 
+│ │                                             │ │       ─         │ │ 
+│ │                                             │ │     icon        │ │ 
+│ └─────────────────────────────────────────────┘ └─────────────────┘ │ 
+└─────────────────────────────────────────────────────────────────────┘ 
+
+

In this example we specify the size in the em unit.

+

Now lets change the text color of both the entry and the element-text widget to red and background to blue.

+
entry, element-text {
+  text-color: red;
+  background-color: rgb(0,0,255);
+}
+
+

Here we use two different methods of writing down the color, for text-color +we used a named color, for background-color we specify it in rgb. +We also specify the property for multiple widgets by passing a comma separated +list of widget names.

+

If you want to center the text relative to the icon, we can set this:

+
element-text {
+    vertical-align: 0.5;
+}
+
+
┌─────────────────────────────────────────────────────────────────────┐ 
+│ element                                                             │ 
+│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │ 
+│ │                                             │ │    element      │ │ 
+│ │element-text                                 │ │       ─         │ │ 
+│ │                                             │ │     icon        │ │ 
+│ └─────────────────────────────────────────────┘ └─────────────────┘ │ 
+└─────────────────────────────────────────────────────────────────────┘ 
+
+

If you want to see the complete theme, including the modification you can run:

+
rofi -dump-theme
+
+

DEFAULT THEME LOADING

+

By default, rofi loads the default theme. This theme is always loaded. +The default configuration contains:

+
@theme "default"
+
+

To unload the default theme, and load another theme, add the @theme statement +to your config.rasi file.

+

If you have a theme loaded via @theme or use the default theme, you can tweak +it by adding overriding elements at the end of your config.rasi file.

+

For the difference between @import and @theme see the Multiple file +handling section in this manpage.

+

To see the default theme, run the following command:

+
rofi -no-config -dump-theme
+
+

DESCRIPTION

+

The need for a new theme format was motivated by the fact that the way rofi handled widgets has changed. From a very +static drawing of lines and text to a nice structured form of packing widgets. This change made it possible to provide a +more flexible theme framework. The old theme format and config file are not flexible enough to expose these options in a +user-friendly way. Therefore, a new file format has been created, replacing the old one.

+

FORMAT SPECIFICATION

+

Encoding

+

The encoding of the file is UTF-8. Both unix (\n) and windows (\r\n) newlines format are supported. But unix is +preferred.

+

Comments

+

C and C++ file comments are supported.

+
    +
  • Anything after // and before a newline is considered a comment.
  • +
  • Everything between /* and */ is a comment, this comment can span multiple lines.
  • +
+

Comments can be nested and the C comments can be inline.

+

The following is valid:

+
// Magic comment.
+property: /* comment */ value;
+
+

However, this is not:

+
prop/*comment*/erty: value;
+
+

White space

+

White space and newlines, like comments, are ignored by the parser.

+

This:

+
property: name;
+
+

Is identical to:

+
     property             :
+name
+
+;
+
+

File extension

+

The preferred file extension for the new theme format is rasi. This is an +abbreviation for rofi advanced style information.

+

Basic Structure

+

Each element has a section with defined properties. Global properties can be defined in section * { }. +Sub-section names begin with an optional hash symbol #.

+

It is advised to define the global properties section on top of the file to +make inheritance of properties clearer.

+
/* Global properties section */
+* {
+    // list of properties
+}
+
+/* Element theme section. */
+{element path} {
+    // list of properties
+}
+{elements... } {
+    // list of properties
+}
+
+

If there are multiple sections with the same name, they are merged. Duplicate properties are overwritten and the last +parsed entry kept.

+

Global properties section

+

A theme can have one or more global properties sections. If there is more than one, +they will be merged.

+

The global properties section denotes the defaults for each element. +Each property of this section can be referenced with @{identifier} +(See Properties section)

+

A global properties section is indicated with a * as element path.

+

Element theme section

+

A theme can have multiple element theme sections.

+

The element path can consist of multiple names separated by whitespace or dots. +Each element may contain any number of letters, numbers and -'s. +The first element in the element path can optionally start with a # (for +historic reasons). Multiple elements can be specified by a ,.

+

This is a valid element name:

+
element normal.normal {
+    background-color: blue;
+}
+button {
+    background-color: blue;
+}
+
+

And is identical to:

+
element normal normal, button {
+    background-color: blue;
+}
+
+

Each section inherits the global properties. Properties can be explicitly +inherited from their parent with the inherit keyword. +In the following example:

+
window {
+ a: 1;
+ b: 2;
+ children: [ mainbox ];
+}
+mainbox {
+    a: inherit;
+    b: 4;
+    c: 8;
+}
+
+

The element mainbox will have the following set of properties (if mainbox +is a child of window):

+
a: 1;
+b: 4;
+c: 8;
+
+

If multiple sections are defined with the same name, they are merged by the +parser. If multiple properties with the same name are defined in one section, +the last encountered property is used.

+

Properties Format

+

The properties in a section consist of:

+
{identifier}: {value};
+
+

Both fields are mandatory for a property.

+

The identifier names the specified property. Identifiers can consist of any +combination of numbers, letters and '-'. It must not contain any whitespace. +The structure of the value defines the type of the property. The current +parser does not define or enforce a certain type of a particular identifier. +When used, values with the wrong type that cannot be converted are ignored.

+

The current theme format supports different types:

+
    +
  • a string
  • +
  • an integer number
  • +
  • a fractional number
  • +
  • a boolean value
  • +
  • a color
  • +
  • image
  • +
  • text style
  • +
  • line style
  • +
  • a distance
  • +
  • a padding
  • +
  • a border
  • +
  • a position
  • +
  • a reference
  • +
  • an orientation
  • +
  • a cursor
  • +
  • a list of keywords
  • +
  • an array of values
  • +
  • an environment variable
  • +
  • Inherit
  • +
+

Some of these types are a combination of other types.

+

String

+
    +
  • Format: "[:print:]+"
  • +
+

A string is always surrounded by double quotes ("). Between the quotes there can be any printable character.

+

For example:

+
font: "Awasome 12";
+
+

The string must be valid UTF-8, special characters can be escaped:

+
text {
+    content: "Line one\n\tIndented line two";
+}
+
+

The following special characters can be escaped: \b, \f, \n, \r, \t, \v, \ and ".

+

Integer

+
    +
  • Format: [-+]?[:digit:]+
  • +
+

An integer may contain any number.

+

For examples:

+
lines: 12;
+
+

Real

+
    +
  • Format: [-+]?[:digit:]+(\.[:digit:]+)?
  • +
+

A real is an integer with an optional fraction.

+

For example:

+
real: 3.4;
+
+

The following is not valid: .3, 3. or scientific notation: 3.4e-3.

+

Boolean

+
    +
  • Format: (true|false)
  • +
+

Boolean value is either true or false. This is case-sensitive.

+

For example:

+
dynamic: false;
+
+

Image

+

rofi support a limited set of background-image formats.

+
    +
  • Format: url("path to image");
  • +
  • Format: url("path to image", scale); + where scale is: none, both, width, height
  • +
  • Format: linear-gradient(stop color,stop1, color, stop2 color, ...);
  • +
  • Format: linear-gradient(to direction, stop color,stop1, color, stop2 color, ...); + where direction is: top,left,right,bottom.
  • +
  • Format: linear-gradient(angle, stop color,stop1, color, stop2 color, ...); + Angle in deg,rad,grad (as used in color).
  • +
+

Where the path is a string, and stop color is of type color.

+

Color

+

rofi supports the color formats as specified in the CSS standard (1,2,3 and some of CSS 4)

+
    +
  • Format: #{HEX}{3} (rgb)
  • +
  • Format: #{HEX}{4} (rgba)
  • +
  • Format: #{HEX}{6} (rrggbb)
  • +
  • Format: #{HEX}{8} (rrggbbaa)
  • +
  • Format: rgb[a]({INTEGER},{INTEGER},{INTEGER}[, {PERCENTAGE}])
  • +
  • Format: rgb[a]({INTEGER}%,{INTEGER}%,{INTEGER}%[, {PERCENTAGE}])
  • +
  • Format: hsl[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])
  • +
  • Format: hwb[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])
  • +
  • Format: cmyk( {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE} ])
  • +
  • Format: {named-color} [ / {PERCENTAGE} ]
  • +
+

The white-space format proposed in CSS4 is also supported.

+

The different values are:

+
    +
  • {HEX} is a hexadecimal number ('0-9a-f' case insensitive).
  • +
  • {INTEGER} value can be between 0 and 255 or 0-100 when representing percentage.
  • +
  • {ANGLE} is the angle on the color wheel, can be in deg, rad, grad or turn. When no unit is specified, degrees is assumed.
  • +
  • {PERCENTAGE} can be between 0-1.0, or 0%-100%
  • +
  • +

    {named-color} is one of the following colors:

    +

    AliceBlue, AntiqueWhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet, Brown, +BurlyWood, CadetBlue, Chartreuse, Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, DarkCyan, +DarkGoldenRod, DarkGray, DarkGrey, DarkGreen, DarkKhaki, DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, +DarkSalmon, DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkSlateGrey, DarkTurquoise, DarkViolet, DeepPink, DeepSkyBlue, +DimGray, DimGrey, DodgerBlue, FireBrick, FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, GoldenRod, +Gray, Grey, Green, GreenYellow, HoneyDew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, +LemonChiffon, LightBlue, LightCoral, LightCyan, LightGoldenRodYellow, LightGray, LightGrey, LightGreen, LightPink, +LightSalmon, LightSeaGreen, LightSkyBlue, LightSlateGray, LightSlateGrey, LightSteelBlue, LightYellow, Lime, LimeGreen, +Linen, Magenta, Maroon, MediumAquaMarine, MediumBlue, MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, +MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, MintCream, MistyRose, Moccasin, NavajoWhite, Navy, +OldLace, Olive, OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenRod, PaleGreen, PaleTurquoise, PaleVioletRed, +PapayaWhip, PeachPuff, Peru, Pink, Plum, PowderBlue, Purple, RebeccaPurple, Red, RosyBrown, RoyalBlue, SaddleBrown, +Salmon, SandyBrown, SeaGreen, SeaShell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray, SlateGrey, Snow, SpringGreen, +SteelBlue, Tan, Teal, Thistle, Tomato, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, YellowGreen,transparent

    +
  • +
+

For example:

+
background-color: #FF0000;
+border-color: rgba(0,0,1, 0.5);
+text-color: SeaGreen;
+
+

or

+
background-color: transparent;
+text-color: Black;
+
+

Text style

+
    +
  • Format: (bold|italic|underline|strikethrough|none)
  • +
+

Text style indicates how the highlighted text is emphasized. None indicates that no emphasis +should be applied.

+
    +
  • bold: make the text thicker then the surrounding text.
  • +
  • italic: put the highlighted text in script type (slanted).
  • +
  • underline: put a line under the text.
  • +
  • strikethrough: put a line through the text.
  • +
+

The following options are available on pango 1.50.0 and up:

+
    +
  • uppercase: Uppercase the text.
  • +
  • lowercase: Lowercase the text.
  • +
+

The following option is disabled as pango crashes on this if there is eel + upsizing or wrapping. This will be re-enabled once fixed:

+
    +
  • capitalize: Capitalize the text.
  • +
+

Line style

+
    +
  • Format: (dash|solid)
  • +
+

Indicates how a line should be drawn. +It currently supports: + * dash: a dashed line, where the gap is the same width as the dash + * solid: a solid line

+

Distance

+
    +
  • Format: {Integer}px
  • +
  • Format: {Real}em
  • +
  • Format: {Real}ch
  • +
  • Format: {Real}%
  • +
  • Format: {Integer}mm
  • +
+

A distance can be specified in 3 different units:

+
    +
  • px: Screen pixels.
  • +
  • em: Relative to text height.
  • +
  • ch: Relative to width of a single number.
  • +
  • mm: Actual size in millimeters (based on dpi).
  • +
  • %: Percentage of the monitor size.
  • +
+

Distances used in the horizontal direction use the monitor width. Distances in +the vertical direction use the monitor height. +For example:

+
   padding: 10%;
+
+

On a full-HD (1920x1080) monitor, it defines a padding of 192 pixels on the left +and right side and 108 pixels on the top and bottom.

+

Calculating sizes

+

Rofi supports some maths in calculating sizes. For this it uses the CSS syntax:

+
width: calc( 100% - 37px );
+
+
width: calc( 20% min 512 );
+
+

It supports the following operations:

+
    +
  • + : Add
  • +
  • - : Subtract
  • +
  • / : Divide
  • +
  • * : Multiply
  • +
  • % : Modulo
  • +
  • min : Minimum of lvalue or rvalue;
  • +
  • max : Maximum of lvalue or rvalue;
  • +
  • floor : Round down lvalue to the next multiple of rvalue
  • +
  • ceil : Round up lvalue to the next multiple of rvalue
  • +
  • round : Round lvalue to the next multiple of rvalue
  • +
+

It uses the C precedence ordering.

+

Padding

+
    +
  • Format: {Integer}
  • +
  • Format: {Distance}
  • +
  • Format: {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance} {Distance}
  • +
+

If no unit is specified, pixels are assumed.

+

The different number of fields in the formats are parsed like:

+
    +
  • 1 field: all
  • +
  • 2 fields: top&bottom left&right
  • +
  • 3 fields: top, left&right, bottom
  • +
  • 4 fields: top, right, bottom, left
  • +
+

Border

+
    +
  • Format: {Integer}
  • +
  • Format: {Distance}
  • +
  • Format: {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style}
  • +
  • Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style} {Distance} {Line style}
  • +
+

Borders are identical to padding, except that each distance field has a line +style property.

+
+

When no unit is specified, pixels are assumed.

+
+

Position

+

Indicate a place on the window/monitor.

+
┌─────────────┬─────────────┬─────────────┐
+│ north west  │    north    │  north east │
+├─────────────┼─────────────┼─────────────┤
+│   west      │   center    │     east    │
+├─────────────┼─────────────┼─────────────┤
+│ south west  │    south    │  south east │
+└─────────────┴─────────────┴─────────────┘
+
+
    +
  • Format: (center|east|north|west|south|north east|north west|south west|south east)
  • +
+

Visibility

+

It is possible to hide widgets:

+
inputbar {
+    enabled: false;
+}
+
+

Reference

+
    +
  • Format: @{PROPERTY NAME}
  • +
+

A reference can point to another reference. Currently, the maximum number of redirects is 20. +A property always refers to another property. It cannot be used for a subpart of the property. +For example, this is not valid:

+
highlight: bold @pink;
+
+

But this is:

+
* {
+    myhigh: bold #FAA;
+}
+
+window {
+    highlight: @myhigh;
+}
+
+
    +
  • Format: var(PROPERTY NAME, DEFAULT)
  • +
+

A reference can point to another reference. Currently, the maximum number of redirects is 20. +A property always refers to another property. It cannot be used for a subpart of the property.

+

Example:

+
window {
+    width: var( width, 30%);
+}
+
+

If the property width is set globally (*{}) that value is used, if the property +width is not set, the default value is used.

+

Orientation

+
    +
  • Format: (horizontal|vertical)
  • +
+

Specify the orientation of the widget.

+

Cursor

+
    +
  • Format: (default|pointer|text)
  • +
+

Specify the type of mouse cursor that is set when the mouse pointer is over the widget.

+

List of keywords

+
    +
  • Format: [ keyword, keyword ]
  • +
+

A list starts with a '[' and ends with a ']'. The entries in the list are comma-separated. +The keyword in the list refers to an widget name.

+

List of values

+
    +
  • Format: [ value, value, ... ]
  • +
+

An list starts with a '[' and ends with a ']'. The entries in the list are comma-separated.

+

Environment variable

+
    +
  • Format: ${:alnum:}
  • +
+

This will parse the environment variable as the property value. (that then can be any of the above types). +The environment variable should be an alphanumeric string without white-space.

+
* {
+    background-color: ${BG};
+}
+
+
    +
  • Format: env(ENVIRONMENT, default)
  • +
+

This will parse the environment variable as the property value. (that then can be any of the above types). +The environment variable should be an alphanumeric string without white-space. +If the environment value is not found, the default value is used.

+
window {
+    width: env(WIDTH, 40%);
+}
+
+

If environment WIDTH is set, then that value is parsed, otherwise the default value (40%).

+

Inherit

+
    +
  • Format: inherit
  • +
+

Inherits the property from its parent widget.

+
mainbox {
+    border-color: inherit;
+}
+
+

ELEMENTS PATHS

+

Element paths exists of two parts, the first part refers to the actual widget by name. +Some widgets have an extra state.

+

For example:

+
element selected {
+}
+
+

Here element selected is the name of the widget, selected is the state of the widget.

+

The difference between dots and spaces is purely cosmetic. These are all the same:

+
element .selected {
+
+element.selected {
+}
+element selected {
+}
+
+

SUPPORTED ELEMENT PATH

+

Name

+

The current widgets available in rofi:

+
    +
  • window
  • +
  • overlay: the overlay widget.
  • +
  • mainbox: The mainbox box.
      +
    • inputbar: The input bar box.
    • +
    • box: the horizontal @box packing the widgets
    • +
    • case-indicator: the case/sort indicator @textbox
    • +
    • prompt: the prompt @textbox
    • +
    • entry: the main entry @textbox
    • +
    • num-rows: Shows the total number of rows.
    • +
    • num-filtered-rows: Shows the total number of rows after filtering.
    • +
    • textbox-current-entry: Shows the text of the currently selected entry.
    • +
    • icon-current-entry: Shows the icon of the currently selected entry.
    • +
    • listview: The listview.
    • +
    • scrollbar: the listview scrollbar
    • +
    • element: a box in the listview holding the entries
        +
      • element-icon: the widget in the listview's entry showing the (optional) icon
      • +
      • element-index: the widget in the listview's entry keybindable index (1,2,3..0)
      • +
      • element-text: the widget in the listview's entry showing the text.
      • +
      +
    • +
    • mode-switcher: the main horizontal @box packing the buttons.
    • +
    • button: the buttons @textbox for each mode
    • +
    • message: The container holding the textbox.
    • +
    • textbox: the message textbox
    • +
    +
  • +
+

Note that these path names match the default theme. Themes that provide a custom layout will have different +elements, and structure.

+

State

+

State: State of widget

+

Optional flag(s) indicating state of the widget, used for theming.

+

These are appended after the name or class of the widget.

+

Example:

+

button selected.normal { }

+

element selected.urgent { }

+

Currently only the entrybox and scrollbar have states:

+

Entrybox:

+

{visible modifier}.{state}

+

Where visible modifier can be: + * normal: no modification + * selected: the entry is selected/highlighted by user + * alternate: the entry is at an alternating row (uneven row)

+

Where state is: + * normal: no modification + * urgent: this entry is marked urgent + * active: this entry is marked active

+

These can be mixed.

+

Example:

+
nametotextbox selected.active {
+    background-color: #003642;
+    text-color: #008ed4;
+}
+
+

Sets all selected textboxes marked active to the given text and background color. +Note that a state modifies the original element, it therefore contains all the properties of that element.

+

Scrollbar

+

The scrollbar uses the handle state when drawing the small scrollbar handle. +This allows the colors used for drawing the handle to be set independently.

+

SUPPORTED PROPERTIES

+

The following properties are currently supported:

+

all widgets:

+
    +
  • enabled: enable/disable rendering of the widget
  • +
  • padding: padding + Padding on the inside of the widget
  • +
  • margin: padding + Margin on the outside of the widget
  • +
  • border: border + Border around the widget (between padding and margin)/
  • +
  • border-radius: padding + Sets a radius on the corners of the borders.
  • +
  • background-color: color + Background color
  • +
  • background-image: image + Background image
  • +
  • border-color: color + Color of the border
  • +
  • cursor: cursor + Type of mouse cursor that is set when the mouse pointer is hovered over the widget.
  • +
+

window:

+
    +
  • +

    font: string + The font used in the window

    +
  • +
  • +

    transparency: string + Indicating if transparency should be used and what type: + real - True transparency. Only works with a compositor. + background - Take a screenshot of the background image and use that. + screenshot - Take a screenshot of the screen and use that. + Path to png file - Use an image.

    +
  • +
  • +

    location: position + The place of the anchor on the monitor

    +
  • +
  • anchor: anchor + The anchor position on the window
  • +
  • fullscreen: boolean + Window is fullscreen.
  • +
  • width: distance + The width of the window
  • +
  • x-offset: distance
  • +
  • y-offset: distance + The offset of the window to the anchor point, allowing you to push the window left/right/up/down
  • +
+

scrollbar:

+
    +
  • background-color: color
  • +
  • handle-width: distance
  • +
  • handle-color: color
  • +
  • border-color: color
  • +
+

box:

+
    +
  • orientation: orientation + Set the direction the elements are packed.
  • +
  • spacing: distance + Distance between the packed elements.
  • +
+

textbox:

+
    +
  • background-color: color
  • +
  • border-color: the color used for the border around the widget.
  • +
  • font: the font used by this textbox (string).
  • +
  • str/content: the string to display by this textbox (string).
  • +
  • vertical-align: Vertical alignment of the text. A number between 0 (top) and 1 (bottom).
  • +
  • horizontal-align: Horizontal alignment of the text. A number between 0 (left) and 1 (right).
  • +
  • text-color: the text color to use.
  • +
  • text-transform: text style {color} for the whole text.
  • +
  • highlight: text style {color}. + color is optional, multiple highlight styles can be added like: bold underline italic #000000; + This option is only available on the element-text widget.
  • +
  • width: override the desired width for the textbox.
  • +
  • content: Set the displayed text (String).
  • +
  • placeholder: Set the displayed text (String) when nothing is entered.
  • +
  • placeholder-color: Color of the placeholder text.
  • +
  • blink: Enable/Disable blinking on an input textbox (Boolean).
  • +
  • markup: Force markup on, beware that only valid pango markup strings are shown.
  • +
  • tab-stops: array of distances + Set the location of tab stops by their distance from the beginning of the line. + Each distance should be greater than the previous one. + The text appears to the right of the tab stop position (other alignments are not supported yet).
  • +
+

listview:

+
    +
  • columns: integer + Number of columns to show (at least 1)
  • +
  • fixed-height: boolean + Always show lines rows, even if fewer elements are available.
  • +
  • dynamic: boolean + True if the size should change when filtering the list, False if it should keep the original height.
  • +
  • scrollbar: boolean + If the scrollbar should be enabled/disabled.
  • +
  • scrollbar-width: distance + Width of the scrollbar
  • +
  • cycle: boolean + When navigating, it should wrap around
  • +
  • spacing: distance + Spacing between the elements (both vertical and horizontal)
  • +
  • lines: integer + Number of rows to show in the list view.
  • +
  • layout: orientation + Indicate how elements are stacked. Horizontal implements the dmenu style.
  • +
  • reverse: boolean + Reverse the ordering (top down to bottom up).
  • +
  • flow: orientation + The order the elements are layed out. Vertical is the original 'column' view.
  • +
  • fixed-columns: boolean + Do not reduce the number of columns shown when number of visible elements is not enough to fill them all.
  • +
  • require-input: boolean + Listview requires user input to show up.
  • +
+

Each element is a box called element. Each element can contain an element-icon and element-text.

+

listview text highlight:

+

The element-text widget in the listview is the one used to show the text. +On this widget set the highlight property (only place this property is used) to change +the style of highlighting. +The highlight property consist of the text-style property and a color.

+

To disable highlighting:

+
  element-text {
+    highlight: None;
+  }
+
+

To set to red underlined:

+
  element-text {
+    highlight: underline red;
+  }
+
+

Layout

+

The new format allows the layout of the rofi window to be tweaked extensively. +For each widget, the themer can specify padding, margin, border, font, and more. +It even allows, as an advanced feature, to pack widgets in a custom structure.

+

Basic structure

+

The whole view is made out of boxes that pack other boxes or widgets. +The box can be vertical or horizontal. This is loosely inspired by GTK.

+

The current layout of rofi is structured as follows:

+
┌────────────────────────────────────────────────────────────────────────────────────┐
+│ window {BOX:vertical}                                                              │
+│ ┌───────────────────────────────────────────────────────────────────────────────┐  │
+│ │ mainbox  {BOX:vertical}                                                       │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │ inputbar {BOX:horizontal}                                                 │ │  │
+│ │ │ ┌─────────┐ ┌─┐ ┌───────────────────────────────┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ │ │  │
+│ │ │ │ prompt  │ │:│ │ entry                         │ │#fr│ │ / │ │#ns│ │ci │ │ │  │
+│ │ │ └─────────┘ └─┘ └───────────────────────────────┘ └───┘ └───┘ └───┘ └───┘ │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ │                                                                               │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │ message                                                                   │ │  │
+│ │ │ ┌───────────────────────────────────────────────────────────────────────┐ │ │  │
+│ │ │ │ textbox                                                               │ │ │  │
+│ │ │ └───────────────────────────────────────────────────────────────────────┘ │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ │                                                                               │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │ listview                                                                  │ │  │
+│ │ │ ┌─────────────────────────────────────────────────────────────────────┐   │ │  │
+│ │ │ │ element                                                             │   │ │  │
+│ │ │ │ ┌─────────────────┐ ┌─────────────────────────────────────────────┐ │   │ │  │
+│ │ │ │ │element─icon     │ │element─text                                 │ │   │ │  │
+│ │ │ │ └─────────────────┘ └─────────────────────────────────────────────┘ │   │ │  │
+│ │ │ └─────────────────────────────────────────────────────────────────────┘   │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ │                                                                               │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │  mode─switcher {BOX:horizontal}                                           │ │  │
+│ │ │ ┌───────────────┐   ┌───────────────┐  ┌──────────────┐ ┌───────────────┐ │ │  │
+│ │ │ │ Button        │   │ Button        │  │ Button       │ │ Button        │ │ │  │
+│ │ │ └───────────────┘   └───────────────┘  └──────────────┘ └───────────────┘ │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ └───────────────────────────────────────────────────────────────────────────────┘  │
+└────────────────────────────────────────────────────────────────────────────────────┘
+
+
+
+
+
    +
  • ci is the case-indicator
  • +
  • fr is the num-filtered-rows
  • +
  • ns is the num-rows
  • +
+
+

Error message structure

+
┌──────────────────────────────────────────────────────────────────────────────────┐
+│ window {BOX:vertical}                                                            │
+│ ┌─────────────────────────────────────────────────────────────────────────────┐  │
+│ │ error─message {BOX:vertical}                                                │  │
+│ │ ┌────────────────────────────────────────────────────────────────────────┐  │  │
+│ │ │ textbox                                                                │  │  │
+│ │ └────────────────────────────────────────────────────────────────────────┘  │  │
+│ └─────────────────────────────────────────────────────────────────────────────┘  │
+└──────────────────────────────────────────────────────────────────────────────────┘
+
+
+

Advanced layout

+

The layout of rofi can be tweaked by packing the 'fixed' widgets in a custom structure.

+

The following widgets are fixed, as they provide core rofi functionality:

+
    +
  • prompt
  • +
  • entry
  • +
  • overlay
  • +
  • case-indicator
  • +
  • message
  • +
  • listview
  • +
  • mode-switcher
  • +
  • num-rows
  • +
  • num-filtered-rows
  • +
+

The following keywords are defined and can be used to automatically pack a subset of the widgets. +These are used in the default theme as depicted in the figure above.

+
    +
  • mainbox + Packs: inputbar, message, listview, mode-switcher
  • +
  • inputbar + Packs: prompt,entry,case-indicator
  • +
+

Any widget name starting with textbox is a textbox widget, others are box widgets and can pack other widgets.

+

There are several special widgets that can be used by prefixing the name of the widget:

+

textbox

+

This is a read-only textbox widget. The displayed string can be set with content.

+

Example:

+
textbox-custom {
+  expand: false;
+  content: "My Message";
+}
+
+

Icon

+

This is an icon widget. The displayed icon can be set with filename and size with size. +If the property action is set, it acts as a button. +action can be set to a keybinding name and completes that action. (see rofi -show keys for a list).

+

If the squared property is set to false the widget height and width are not forced to be equal.

+

Example:

+
icon-paste {
+    expand: false;
+    filename: "gtk-paste";
+    size: 24;
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

button

+

This is a textbox widget that can have a 'clickable' action. +The action can be set to: +keybinding: accepts a keybinding name and completes that action. (see rofi -show keys for a list).

+
button-paste {
+    expand: false;
+    content: "My Clickable Message";
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

Children

+

To specify children, set the children +property (this always happens on the box child, see example below):

+
inputbar {
+  children: [prompt,entry,overlay,case-indicator];
+}
+
+

The theme needs to be updated to match the hierarchy specified.

+

Below is an example of a theme emulating dmenu:

+
* {
+    background-color:      Black;
+    text-color:            White;
+    border-color:          White;
+    font:            "Times New Roman 12";
+}
+
+window {
+    anchor:     north;
+    location:   north;
+    width:      100%;
+    padding:    4px;
+    children:   [ horibox ];
+}
+
+horibox {
+    orientation: horizontal;
+    children:   [ prompt, entry, listview ];
+}
+
+listview {
+    layout:     horizontal;
+    spacing:    5px;
+    lines:      10;
+}
+
+entry {
+    expand:     false;
+    width:      10em;
+}
+
+element {
+    padding: 0px 2px;
+}
+element selected {
+    background-color: SteelBlue;
+}
+
+

Padding and margin

+

Just like CSS, rofi uses the box model for each widget.

+
┌──────────────────────────────────────────────────────────────────┐
+│ margin                                                           │
+│  ┌────────────────────────────────────────────────────────────┐  │
+│  │ border                                                     │  │
+│  │ ┌────────────────────────────────────────────────────────┐ │  │
+│  │ │ padding                                                │ │  │
+│  │ │ ┌────────────────────────────────────────────────────┐ │ │  │
+│  │ │ │ content                                            │ │ │  │
+│  │ │ └────────────────────────────────────────────────────┘ │ │  │
+│  │ └────────────────────────────────────────────────────────┘ │  │
+│  └────────────────────────────────────────────────────────────┘  │
+└──────────────────────────────────────────────────────────────────┘
+
+

Explanation of the different parts:

+
    +
  • Content - The content of the widget.
  • +
  • Padding - Clears an area around the widget. + The padding shows the background color of the widget.
  • +
  • Border - A border that goes around the padding and content. + The border use the border-color of the widget.
  • +
  • Margin - Clears an area outside the border. + The margin is transparent.
  • +
+

The box model allows us to add a border around elements, and to define space between elements.

+

The size of each margin, border, and padding can be set. +For the border, a linestyle and radius can be set.

+

Spacing

+

Widgets that can pack more then one child widget (currently box and listview) have the spacing property. +This property sets the distance between the packed widgets (both horizontally and vertically).

+
┌───────────────────────────────────────┐
+│ ┌────────┐ s ┌────────┐ s ┌────────┐  │
+│ │ child  │ p │ child  │ p │ child  │  │
+│ │        │ a │        │ a │        │  │
+│ │        │ c │        │ c │        │  │
+│ │        │ i │        │ i │        │  │
+│ │        │ n │        │ n │        │  │
+│ └────────┘ g └────────┘ g └────────┘  │
+└───────────────────────────────────────┘
+
+

Advanced box packing

+

More dynamic spacing can be achieved by adding dummy widgets, for example to make one widget centered:

+
┌────────────────────────────────────────────────────┐
+│  ┌───────────────┐  ┌────────┐  ┌───────────────┐  │
+│  │ dummy         │  │ child  │  │ dummy         │  │
+│  │ expand: true; │  │        │  │ expand: true; │  │
+│  │               │  │        │  │               │  │
+│  │               │  │        │  │               │  │
+│  │               │  │        │  │               │  │
+│  └───────────────┘  └────────┘  └───────────────┘  │
+└────────────────────────────────────────────────────┘
+
+

If both dummy widgets are set to expand, child will be centered. Depending on the expand flag of child the +remaining space will be equally divided between both dummy and child widget (expand enabled), or both dummy widgets +(expand disabled).

+

DEBUGGING

+

To get debug information from the parser, run rofi like:

+
G_MESSAGES_DEBUG=Parser rofi -show run
+
+

Syntax errors are shown in a popup and printed out to command line with the above command.

+

To see the elements queried during running, run:

+
G_MESSAGES_DEBUG=Theme rofi -show run
+
+

To test minor changes, part of the theme can be passed on the command line, for example to set it to full-screen:

+
rofi -theme-str 'window { fullscreen:true;}' -show run
+
+

Another syntax to modify theme properties is:

+
rofi -theme+window+fullscreen true -show run
+
+

To print the current theme, run:

+
rofi -dump-theme
+
+

Media support

+

Parts of the theme can be conditionally loaded, like the CSS @media option.

+
@media ( min-width: 120 ) {
+
+}
+
+

It supports the following keys as constraint:

+
    +
  • min-width: load when width is bigger or equal then value.
  • +
  • max-width: load when width is smaller then value.
  • +
  • min-height: load when height is bigger or equal then value.
  • +
  • max-height: load when height is smaller then value.
  • +
  • min-aspect-ratio load when aspect ratio is over value.
  • +
  • max-aspect-ratio: load when aspect ratio is under value.
  • +
  • monitor-id: The monitor id, see rofi -help for id's.
  • +
  • enabled: Boolean option to enable. Supports environment variable.
  • +
+

@media takes an integer number or a fraction, for integer number px can be added.

+
@media ( min-width: 120 px ) {
+
+}
+
+
@media ( enabled: env(DO_LIGHT, false ) {
+
+}
+
+

Font Parsing

+

Rofi uses pango for font rendering. The font should be specified in a format that pango +understands. +This normally is the font name followed by the font size. For example:

+
mono 18
+
+

Or

+
FontAwesome 22
+
+

Icon Handling

+

Rofi supports 3 ways of specifying an icon:

+
    +
  • Filename
  • +
  • icon-name, this is looked up via the icon-theme.
  • +
  • Markup String. It renders a string as an icon.
  • +
+

For the first two options, GdkPixbuf is used to open and render the icons. +This in general gives support for most required image formats. +For the string option it uses Pango to render the string. The string needs to +start with a <span tag, that allows you to set color and font.

+

Markup string:

+
echo -en "testing\0icon\x1f<span color='red'>⏻</span>" | ./rofi -dmenu
+
+

Getting supported icon formats:

+
G_MESSAGES_DEBUG=Helpers.IconFetcher rofi
+
+

This uses the debug framework and prints out a list of supported image file +extensions.

+

Multiple file handling

+

The rasi file format offers two methods of including other files. +This can be used to modify existing themes, or have multiple variations on a theme.

+
    +
  • import: Import and parse a second file.
  • +
  • theme: Discard theme, and load file as a fresh theme.
  • +
+

Syntax:

+
@import "myfile"
+@theme "mytheme"
+
+

The specified file can either by name, filename,full path.

+

If a filename is provided, it will try to resolve it in the following order:

+
    +
  • ${XDG_CONFIG_HOME}/rofi/themes/
  • +
  • ${XDG_CONFIG_HOME}/rofi/
  • +
  • ${XDG_DATA_HOME}/rofi/themes/
  • +
  • ${INSTALL PREFIX}/share/rofi/themes/
  • +
+

A name is resolved as a filename by appending the .rasi extension.

+

EXAMPLES

+

Several examples are installed together with rofi. These can be found in {datadir}/rofi/themes/, where +{datadir} is the install path of rofi data. When installed using a package manager, this is usually: /usr/share/.

+

SEE ALSO

+

rofi(1), rofi-script(5), rofi-theme-selector(1)

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/1.7.5/rofi.1/index.html b/1.7.5/rofi.1/index.html new file mode 100644 index 00000000..6013fc9f --- /dev/null +++ b/1.7.5/rofi.1/index.html @@ -0,0 +1,2608 @@ + + + + + + + + + + + + + + + + + + + + + + Rofi - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

ROFI 1 rofi

+

NAME

+

rofi - A window switcher, application launcher, ssh dialog, dmenu replacement and more

+

SYNOPSIS

+

rofi [ -show mode ]|[ -dmenu ]|[ -e msg ] [ CONFIGURATION ]

+

DESCRIPTION

+

rofi is an X11 pop-up window switcher, run dialog, dmenu replacement, and +more. It focuses on being fast to use and have minimal distraction. It supports +keyboard and mouse navigation, type to filter, tokenized search and more.

+

USAGE

+

rofi's main functionality is to assist in your workflow, allowing you to +quickly switch between windows, start applications or log into a remote machine +via ssh. There are different modes for different types of actions. rofi +is a standalone application and should not be integrated into scripts. For +integration into scripts it has a special mode that functions as a (drop-in) +replacement for dmenu(1). See emulating dmenu below.

+

Running rofi

+

To launch rofi directly in a certain mode, specify a mode with rofi -show <mode>. +To show the drun dialog:

+
    rofi -show drun
+
+

A very useful setup in minimalistic window managers is to combine drun, run +with window mode:

+
  rofi -show combi -modes combi -combi-modes "window,drun,run"
+
+

In this setup it first list all open applications, then all installed +applications. So if you type firefox and hit return, it will switch to the +running firefox, or launch it when it is not running.

+

Emulating dmenu

+

rofi can emulate dmenu(1) (a dynamic menu for X11) when launched with +the -dmenu flag.

+

For more information see rofi-dmenu(5).

+

Display Error message

+

rofi error dialog can also be called from the command line.

+
rofi -e "my message"
+
+

Markup support can be enabled, see CONFIGURATION options.

+

CONFIGURATION

+

There are currently three methods of setting configuration options (evaluated in order below):

+
    +
  • System configuration file (for example /etc/rofi.rasi). + It first checks XDG_CONFIG_DIRS, and then SYSCONFDIR (that is passed at compile time). + It loads the first config file it finds, it does not merge multiple system configuration files.
  • +
  • Rasi theme file: The new theme format can be used to set configuration values.
  • +
  • Command-line options: Arguments passed to rofi.
  • +
+

To get a template config file, run: rofi -dump-config > config.rasi

+

This will contain (commented) all current configuration options, modified options are uncommented.

+

To get a template config file that sets the icon-theme run: rofi -icon-theme hicolor -dump-config.

+

It is strongly recommended to use this as a starting point for your configuration.

+

An empty configuration section in the config file looks like:

+
configuration {
+ // set config options here
+}
+
+

Most of the configuration options mentioned below (beside options like -show, +-dump-config that apply to a single run) can be set here.

+

For example to set the dpi value to 72:

+
configuration {
+    dpi: 72;
+}
+
+

The configuration system supports the following types:

+
    +
  • string
  • +
  • integer (signed and unsigned)
  • +
  • char
  • +
  • boolean
  • +
  • lists
  • +
+

For the syntax of these options, see the rofi-theme(5) manpage.

+

For use on the command line, Boolean options have a non-default command-line +syntax. Example to enable option X:

+
-X
+
+

To disable option X:

+
-no-X
+
+

Below is a list of the most important options:

+

General

+

-help

+

The help option shows the full list of command-line options and the current set +values. These include dynamic (run-time generated) options.

+

-version

+

Show the rofi version and exit.

+

-dump-config

+

Dump the current active configuration, in rasi format, to stdout and exit. +Information about the rasi format can be found in the rofi-theme(5) manpage.

+

-dump-theme

+

Dump the current active theme, in rasi format, to stdout and exit.

+

-rasi-validate filename

+

Try to parse the file and return 0 when successful, non-zero when failed.

+

-threads num

+

Specify the number of threads rofi should use:

+
    +
  • 0: Autodetect the number of supported hardware threads.
  • +
  • 1: Disable threading
  • +
  • +

    2..n: Specify the maximum number of threads to use in the thread pool.

    +

    Default: Autodetect

    +
  • +
+

-display display

+

The X server to contact. Default is $DISPLAY.

+

-dmenu

+

Run rofi in dmenu mode. This allows for interactive scripts. +In dmenu mode, rofi reads from STDIN, and output to STDOUT. +A simple example, displaying three pre-defined options:

+
echo -e "Option #1\nOption #2\nOption #3" | rofi -dmenu
+
+

Or get the options from a script:

+
~/my_script.sh | rofi -dmenu
+
+

See the rofi-dmenu(5) manpage for more information.

+

-show mode

+

Open rofi in a certain mode. Available modes are window, run, drun, +ssh, combi. The special argument keys can be used to open a searchable +list of supported key bindings +(see the rofi-keys(5) manpage)

+

To show the run-dialog:

+
rofi -show run
+
+

If -show is the last option passed to rofi, the first enabled modes is shown.

+

-modes mode1,mode2

+

Specify an ordered, comma-separated list of modes to enable. +Enabled modes can be changed at runtime. Default key is Ctrl+Tab. +If no modes are specified, all configured modes will be enabled. +To only show the run and ssh launcher:

+
rofi -modes "run,ssh" -show run
+
+

Custom modes can be added using the internal script mode. Each such mode has +two parameters:

+
<name>:<script>
+
+

Example: Have a mode called 'Workspaces' using the i3_switch_workspaces.sh script:

+
rofi -modes "window,run,ssh,Workspaces:i3_switch_workspaces.sh" -show Workspaces
+
+

Notes: The i3 window manager dislikes commas in the command when specifying an +exec command. For that case, # can be used as a separator.

+

TIP: The name is allowed to contain spaces:

+
rofi -modes "My File Browser:fb.sh" -show "My File Browser"
+
+

-case-sensitive

+

Start in case-sensitive mode. +This option can be changed at run-time using the -kb-toggle-case-sensitivity key binding.

+

-cycle

+

Cycle through the result list. Default is 'true'.

+

-filter filter

+

Filter the list by setting text in input bar to filter

+

-config filename

+

Load an alternative configuration file.

+

-cache-dir filename

+

Directory that is used to place temporary files, like history.

+

-scroll-method method

+

Select the scrolling method. 0: Per page, 1: continuous.

+

-normalize-match

+

Normalize the string before matching, so o will match ö, and é matches e.
+This is not a perfect implementation, but works. For now, it disables highlighting of the matched part.

+

-no-lazy-grab

+

Disables lazy grab, this forces the keyboard being grabbed before gui is shown.

+

-no-plugins

+

Disable plugin loading.

+

-plugin-path directory

+

Specify the directory where rofi should look for plugins.

+

-show-icons

+

Show application icons in drun and window modes.

+

-icon-theme

+

Specify icon theme to be used. +If not specified default theme from DE is used, Adwaita and gnome themes act as +fallback themes.

+

-markup

+

Use Pango markup to format output wherever possible.

+

-normal-window

+

Make rofi react like a normal application window. Useful for scripts like Clerk that are basically an application.

+

-[no-]steal-focus

+

Make rofi steal focus on launch and restore close to window that held it when launched.

+

-refilter-timeout-limit

+

The limit of elements that is used to switch from instant to delayed filter mode.

+

Default: 8192

+

A fallback icon can be specified for each mode:

+
configuration {
+    <mode>{
+      fallback-icon: "<icon name>";
+    }
+}
+
+

Example

+
configuration {
+    run,drun {
+      fallback-icon: "application-x-addon";
+    }
+}
+
+

Matching

+

-matching method

+

Specify the matching algorithm used. +Currently, the following methods are supported:

+
    +
  • normal: match the int string
  • +
  • regex: match a regex input
  • +
  • glob: match a glob pattern
  • +
  • fuzzy: do a fuzzy match
  • +
  • prefix: match prefix
  • +
+

Default: normal

+

Note: glob matching might be slow for larger lists

+

-tokenize

+

Tokenize the input.

+

-drun-categories category1,category2

+

Only show desktop files that are present in the listed categories.

+

-drun-match-fields field1,field2,...

+

When using drun, match only with the specified Desktop entry fields. +The different fields are:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
  • +

    all: all the above

    +

    Default: name,generic,exec,categories,keywords

    +
  • +
+

-drun-display-format

+

The format string for the drun dialog:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
+

Pango markup can be used to formatting the output.

+
Default: {name} [<span weight='light' size='small'><i>({generic})</i></span>]
+
+

Note: Only fields enabled in -drun-match-fields can be used in the format string.

+

-[no-]drun-show-actions

+

Show actions present in the Desktop files.

+
Default: false
+
+

-window-match-fields field1,field2,...

+

When using window mode, match only with the specified fields. +The different fields are:

+
    +
  • title: window's title
  • +
  • class: window's class
  • +
  • role: window's role
  • +
  • name: window's name
  • +
  • desktop: window's current desktop
  • +
  • +

    all: all the above

    +

    Default: all

    +
  • +
+

-matching-negate-char char

+

Set the character used to negate the query (i.e. if it does not match the next keyword). +Set to '\x0' to disable.

+
Default: '-'
+
+

Layout and Theming

+

IMPORTANT: + In newer rofi releases, all the theming options have been moved into the new theme format. They are no longer normal + rofi options that can be passed directly on the command line (there are too many). + Small snippets can be passed on the command line: rofi -theme-str 'window {width: 50%;}' to override a single + setting. They are merged into the current theme. + They can also be appended at the end of the rofi config file to override parts of the theme.

+

Most of the following options are deprecated and should not be used. Please use the new theme format to customize +rofi. More information about the new format can be found in the rofi-theme(5) manpage.

+

-location

+

Specify where the window should be located. The numbers map to the following locations on screen:

+
  1 2 3
+  8 0 4
+  7 6 5
+
+

Default: 0

+

-fixed-num-lines

+

Keep a fixed number of visible lines.

+

-sidebar-mode

+

Open in sidebar-mode. In this mode, a list of all enabled modes is shown at the bottom. +(See -modes option) +To show sidebar, use:

+
rofi -show run -sidebar-mode
+
+

-hover-select

+

Automatically select the entry the mouse is hovering over. This option is best combined with custom mouse bindings. +To utilize hover-select and accept an entry in a single click, use:

+
rofi -show run -hover-select -me-select-entry '' -me-accept-entry MousePrimary
+
+

-eh number

+

Set row height (in chars) +Default: 1

+

-auto-select

+

When one entry is left, automatically select it.

+

-m num

+

-m name

+

-monitor num

+

-monitor name

+

Select monitor to display rofi on. +It accepts as input: primary (if primary output is set), the xrandr output name, or integer number (in order of +detection). Negative numbers are handled differently:

+
    +
  • -1: the currently focused monitor.
  • +
  • -2: the currently focused window (that is, rofi will be displayed on top of the focused window).
  • +
  • -3: Position of mouse (overrides the location setting to get normal context menu + behavior.)
  • +
  • -4: the monitor with the focused window.
  • +
  • +

    -5: the monitor that shows the mouse pointer.

    +

    Default: -5

    +
  • +
+

See rofi -h output for the detected monitors, their position, and size.

+

-theme filename

+

Path to the new theme file format. This overrides the old theme settings.

+

-theme-str string

+

Allow theme parts to be specified on the command line as an override.

+

For example:

+
rofi -theme-str '#window { fullscreen: true; }'
+
+

This option can be specified multiple times. +This is now the method to tweak the theme via the command line.

+

-dpi number

+

Override the default DPI setting.

+
    +
  • If set to 0, it tries to auto-detect based on X11 screen size (similar to i3 and GTK).
  • +
  • If set to 1, it tries to auto-detect based on the size of the monitor that rofi is displayed on (similar to latest Qt 5).
  • +
+

-selected-row selected row

+

Select a certain row.

+

Default: 0

+

PATTERN setting

+

-terminal

+

Specify which terminal to start.

+
rofi -terminal xterm
+
+

Pattern: {terminal}

+

Default: x-terminal-emulator

+

-ssh-client client

+

Override the used ssh client.

+

Pattern: {ssh-client}

+

Default: ssh

+

SSH settings

+

-ssh-command cmd

+

Set the command to execute when starting an ssh session. +The pattern {host} is replaced by the selected ssh entry.

+

Pattern: {ssh-client}

+

Default: {terminal} -e {ssh-client} {host}

+

-parse-hosts

+

Parse the /etc/hosts file for entries.

+

Default: disabled

+

-parse-known-hosts +-no-parse-known-hosts

+

Parse the ~/.ssh/known_hosts file for entries.

+

Default: enabled

+

Run settings

+

-run-command cmd

+

Set command ({cmd}) to execute when running an application. +See PATTERN.

+

Default: {cmd}

+

-run-shell-command cmd

+

Set command to execute when running an application in a shell. +See PATTERN.

+

Default: {terminal} -e {cmd}

+

-run-list-command cmd

+

If set, use an external tool to generate a list of executable commands. Uses run-command.

+

Default: {cmd}

+

Window switcher settings

+

-window-format format

+

Format what is being displayed for windows.

+

format: {field[:len]}

+

field:

+
    +
  • w: desktop name
  • +
  • t: title of window
  • +
  • n: name
  • +
  • r: role
  • +
  • c: class
  • +
+

len: maximum field length (0 for auto-size). If length and window width are negative, field length is width - len.
+If length is positive, the entry will be truncated or padded to fill that length.

+

default: {w} {c} {t}

+

-window-command cmd

+

Set command to execute on selected window for an alt action (-kb-accept-alt). +See PATTERN.

+

Default: "wmctrl -i -R {window}"

+

-window-thumbnail

+

Show window thumbnail (if available) as icon in the window switcher.

+

You can stop rofi from exiting when closing a window (allowing multiple to be closed in a row).

+
configuration {
+  window {
+      close-on-delete: false;
+  }
+}
+
+

You can hide the currently active window with the 'hide-active-window' setting:

+
configuration {
+  window {
+      hide-active-window: true;
+  }
+}
+
+

or pass -window-hide-active-window true on command line.

+

Combi settings

+

-combi-modes mode1,mode2

+

The modes to combine in combi mode. +For syntax to -combi-modes, see -modes. +To get one merge view, of window,run, and ssh:

+
rofi -show combi -combi-modes "window,run,ssh" -modes combi
+
+

NOTE: The i3 window manager dislikes commas in the command when specifying an exec command. +For that case, # can be used as a separator.

+

-combi-display-format

+

The format string for entries in the combi dialog:

+
    +
  • mode: the mode display name
  • +
  • text: the entry text
  • +
+

Pango markup can be used to formatting the output.

+
Default: {mode} {text}
+
+

Note: This setting is ignored if combi-hide-mode-prefix is enabled.

+

History and Sorting

+

-disable-history +-no-disable-history (re-enable history)

+

Disable history

+

-sort to enable +-no-sort to disable

+

Enable, disable sorting. +This setting can be changed at runtime (see -kb-toggle-sort).

+

-sorting-method 'method' to specify the sorting method.

+

There are 2 sorting methods:

+
    +
  • levenshtein (Default)
  • +
  • fzf sorting.
  • +
+

-max-history-size number

+

Maximum number of entries to store in history. Defaults to 25. (WARNING: can cause slowdowns when set too high)

+

Message dialog

+

-e message

+

Pops up a message dialog (used internally for showing errors) with message. +Message can be multi-line.

+

File browser settings

+

File browser behavior can be controlled via the following options:

+
configuration {
+   filebrowser {
+      /** Directory the file browser starts in. */
+      directory: "/some/directory";
+      /**
+        * Sorting method. Can be set to:
+        *   - "name"
+        *   - "mtime" (modification time)
+        *   - "atime" (access time)
+        *   - "ctime" (change time)
+        */
+      sorting-method: "name";
+      /** Group directories before files. */
+      directories-first: true;
+   }
+}
+
+

Other

+

-drun-use-desktop-cache

+

Build and use a cache with the content of desktop files. Usable for systems with slow hard drives.

+

-drun-reload-desktop-cache

+

If drun-use-desktop-cache is enabled, rebuild a cache with the content of desktop files.

+

-drun-url-launcher command

+

Command to open a Desktop Entry that is a Link.

+

-pid path

+

Make rofi create a pid file and check this on startup. The pid file prevents multiple rofi instances from running simultaneously. This is useful when running rofi from a key-binding daemon.

+

-replace

+

If rofi is already running, based on pid file, try to kill that instance.

+

-display-{mode} string

+

Set the name to use for mode. This is used as prompt and in combi-browser.

+

It is now preferred to use the configuration file:

+
configuration {
+  {mode} {
+    display-name: *string*;
+  }
+}
+
+

-click-to-exit +-no-click-to-exit

+

Click the mouse outside the rofi window to exit.

+

Default: enabled

+

-xserver-i300-workaround

+

Workaround for bug in Xserver. See issue #611 and #1642 on the rofi issue tracker.

+

Default: disabled

+

PATTERN

+

To launch commands (for example, when using the ssh launcher), the user can enter the used command-line. The following keys can be used that will be replaced at runtime:

+
    +
  • {host}: the host to connect to
  • +
  • {terminal}: the configured terminal (see -terminal)
  • +
  • {ssh-client}: the configured ssh client (see -ssh-client)
  • +
  • {cmd}: the command to execute
  • +
  • {window}: the window ID of the selected window (in window-command)
  • +
+

THEMING

+

Please see rofi-theme(5) manpage for more information on theming.

+

KEY BINDINGS

+

Please see the rofi-keys(5) manpage for the keybindings and how to set them up.

+

The keybinding can also be used for actions, when the action is executed the +mentioned keystroke is inserted:

+

Timeout

+

You can configure an action to be taken when rofi has not been interacted +with for a certain amount of seconds. You can specify a keybinding to trigger +after X seconds.

+
configuration {
+  timeout {
+      delay:  15;
+      action: "kb-cancel";
+  }
+}
+
+

Input change

+

When the input of the textbox changes:

+
configuration {
+  inputchange {
+      action: "kb-row-first";
+  }
+}
+
+

Available Modes

+

window

+

Show a list of all the windows and allow switching between them. +Pressing the delete-entry binding (shift-delete) will close the window. +Pressing the accept-custom binding (control-enter or shift-enter) will run a command on the window. +(See option window-command );

+

If there is no match, it will try to launch the input.

+

windowcd

+

Shows a list of the windows on the current desktop and allows switching between them. +Pressing the delete-entry binding (shift-delete) will kill the window. +Pressing the accept-custom binding (control-enter or shift-enter) will run a command on the window. +(See option window-command );

+

If there is no match, it will try to launch the input.

+

run

+

Shows a list of executables in $PATH and can launch them (optional in a terminal). +Pressing the delete-entry binding (shift-delete) will remove this entry from the run history. +Pressing the accept-custom binding (control-enter) will run the command as entered in the entry box. +Pressing the accept-alt binding (shift-enter) will run the command in a terminal.

+

When pressing the mode-complete binding (Control-l), you can use the File Browser mode to launch the application +with a file as the first argument.

+

drun

+

Same as the run launches, but the list is created from the installed desktop files. It automatically launches them +in a terminal if specified in the Desktop File. +Pressing the delete-entry binding (shift-delete) will remove this entry from the run history. +Pressing the accept-custom binding (control-enter) will run the command as entered in the entry box. +Pressing the accept-alt binding (shift-enter) will run the command in a terminal.

+

When pressing the mode-complete binding (Control-l), you can use the File Browser mode to launch the application +passing a file as argument if specified in the desktop file.

+

The DRUN mode tries to follow the XDG Desktop Entry +Specification and should be compatible with +applications using this standard. Some applications create invalid desktop files, rofi will discard these entries. +See the debugging section for more info on DRUN mode, this will print why desktop files are +discarded.

+

There are two advanced options to tweak the behaviour:

+
configuration {
+   drun {
+      /** Parse user desktop files. */
+      parse-user:   true;
+      /** Parse system desktop files. */
+      parse-system: false;
+   }
+}
+
+

ssh

+

Shows a list of SSH targets based on your ssh config file, and allows to quickly ssh into them.

+

keys

+

Shows a searchable list of key bindings.

+

script

+

Allows custom scripted Modes to be added, see the rofi-script(5) manpage for more information.

+

combi

+

Combines multiple modes in one list. Specify which modes are included with the -combi-modes option.

+

When using the combi mode, a !bang can be used to filter the results by modes. +All modes that match the bang as a prefix are included. +For example, say you have specified -combi-modes run,window,windowcd. If your +query begins with the bang !w, only results from the window and windowcd +modes are shown, even if the rest of the input text would match results from run.

+

If no match, the input is handled by the first combined modes.

+

FAQ

+

The text in the window switcher is not nicely aligned.

+

Try using a mono-space font or tabs + the tab-stops setting..

+

The window is completely black.

+

Check quotes used on the command-line: you might have used ("smart quotes") instead of " ("machine quotes").

+

What does the icon in the top right show?

+

The indicator shows:

+
` ` Case insensitive and no sorting.
+`-` Case sensitivity enabled, no sorting.
+`+` Case insensitive and Sorting enabled
+`±` Sorting and Case sensitivity enabled"
+
+

Why do I see different icons for run,drun and window mode

+

Each of these modes uses different methods of resolving the icon:

+
    +
  • Window: It first uses the icon that the application exposes via the X11 + Server, if none is set it does a lookup of the window Class name in the icon theme.
  • +
  • drun: It uses the icon set in the desktop file.
  • +
  • run: It does a lookup using the executable name.
  • +
+

EXAMPLES

+

Some basic usage examples of rofi:

+

Show the run dialog:

+
rofi -modes run -show run
+
+

Show the run dialog, and allow switching to Desktop File run dialog (drun):

+
rofi -modes run,drun -show run
+
+

Combine the run and Desktop File run dialog (drun):

+
rofi -modes combi -show combi -combi-modes run,drun
+
+

Combine the run and Desktop File run dialog (drun), and allow switching to window switcher:

+
rofi -modes combi,window -show combi -combi-modes run,drun
+
+

Pop up a text message claiming that this is the end:

+
rofi -e "This is the end"
+
+

Pop up a text message in red, bold font claiming that this is still the end:

+
rofi -e "<span color='red'><b>This is still the end</b></span>" -markup
+
+

Show all key bindings:

+
rofi -show keys
+
+

i3

+

In i3 you want to bind rofi to be launched on key release. Otherwise, it cannot grab the keyboard. +See also the i3 manual:

+

Some tools (such as import or xdotool) might be unable to run upon a KeyPress event, because the keyboard/pointer is +still grabbed. For these situations, the --release flag can be used, as it will execute the command after the keys have +been released.

+

LICENSE

+
MIT/X11
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+

WEBSITE

+

rofi website can be found here

+

SUPPORT

+

rofi support can be obtained: + * GitHub Discussions + * Forum (Reddit) + * IRC (#rofi on irc.libera.chat),

+

DEBUGGING

+

For more information see rofi-debugging(5) manpage.

+

ISSUE TRACKER

+

The rofi issue tracker can be found here +Before creating an issue, consider posting a question on the discussion forum first. +When creating an issue, please read this +first.

+

SEE ALSO

+

rofi-sensible-terminal(1), dmenu(1), rofi-debugging(5), rofi-theme(5), rofi-script(5), rofi-keys(5),rofi-theme-selector(1),rofi-dmenu(5)

+

AUTHOR

+ +

Original code based on work by: Sean Pringle sean.pringle@gmail.com

+

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

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/404.html b/404.html new file mode 100644 index 00000000..2563e562 --- /dev/null +++ b/404.html @@ -0,0 +1,1136 @@ + + + + + + + + + + + + + + + + + + Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ +

404 - Not found

+ +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/CONFIG/index.html b/CONFIG/index.html new file mode 100644 index 00000000..6dbd65ac --- /dev/null +++ b/CONFIG/index.html @@ -0,0 +1,1560 @@ + + + + + + + + + + + + + + + + + + + + + + Configuration - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Configuration

+ +
+

This page does not describe all of ROFI's configuration options, just the +most common usecase. For the full configuration options, check the manpages.

+
+


+

Where does the configuration live

+

Rofi's configurations, custom themes live in ${XDG_CONFIG_HOME}/rofi/, on +most systems this is ~/.config/rofi/.

+

The name of the main configuration file is config.rasi. (~/.config/rofi/config.rasi).

+

Create an empty configuration file

+

Open ~/.config/rofi/config.rasi in your favorite text editor and add the +following block:

+
configuration {
+
+}
+
+

You can now set the options in the configuration block.

+

Create a configuration file from current setup

+

If you do not want to start from scratch, or want to migrate from older +configuration format, you can get tell rofi to dumps it configuration:

+
rofi -dump-config > ~/.config/rofi/config.rasi
+
+

This will have all the possible settings and their current value. +If a value is the default value, the entry will be commented.

+

For example:

+
configuration {               
+/*  modes: "window,run,ssh,drun";*/
+/*  font: "mono 12";*/
+/*  location: 0;*/
+/*  yoffset: 0;*/
+/*  xoffset: 0;*/
+/*  fixed-num-lines: true;*/
+... cut ...
+/*  ml-row-down: "ScrollDown";*/                                                                                        
+/*  me-select-entry: "MousePrimary";*/                                                                                  
+/*  me-accept-entry: "MouseDPrimary";*/                                                                                 
+/*  me-accept-custom: "Control+MouseDPrimary";*/ 
+}
+
+

To create a copy of the current theme, you can run:

+
rofi -dump-theme > ~/.config/rofi/current.rasi
+
+

Configuration file format

+

Encoding

+

The encoding of the file is utf-8. Both Unix (\n) and windows (\r\n) +newlines format are supported. But Unix is preferred.

+

Comments

+

C and C++ file comments are supported.

+
    +
  • Anything after // and before a newline is considered a comment.
  • +
  • Everything between /* and */ is a comment.
  • +
+

Comments can be nested and the C comments can be inline.

+

The following is valid:

+
// Magic comment.
+property: /* comment */ value;
+
+

However, this is not:

+
prop/*comment*/erty: value;
+
+

White space

+

White space and newlines, like comments, are ignored by the parser.

+

This:

+
property: name;
+
+

Is identical to:

+
     property             :
+name
+
+;
+
+

Data types

+

ROFI's configuration supports several data formats:

+

String

+

A string is always surrounded by double quotes ("). Between the quotes there +can be any printable character.

+

For example:

+

+ ml-row-down: "ScrollDown";
+
+

Number

+

An integer may contain any full number.

+

For example:

+
eh: 2;                        
+
+

Boolean

+

Boolean value is either true or false. This is case-sensitive.

+

For example:

+
show-icons: true;
+
+

This is equal to the -show-icons option on the commandline, and show-icons: +false; is equal to -no-show-icons.

+

Character

+

Character value is always surrounded by single quotes (') and should contain a +single character. It supports escaping.

+
matching-negate-char: '-';
+
+

List

+

This is not supported by the old configuration system, but can be used in the +rasi format.

+

A list starts with a '[' and ends with a ']'. The entries in the list are +comma-separated. The entry in the list single ASCII words.

+
 combi-modes: [window,drun];
+
+

For older versions you have :

+
 combi-modes: "window,drun";
+
+

Get a list of all possible options

+

There are 2 ways to get a list of all options:

+
    +
  1. Dump the configuration file explained above. (rofi -dump-config)
  2. +
  3. Look at output of rofi -h.
  4. +
+

To see what values an option support check the manpage, it describes most of +them.

+

NOTE: not all options might be in the manpage, as options can be added at +run-time. (f.e. by plugins).

+

Splitting configuration over multiple files

+

It is possible to split configuration over multiple files using imports. For +example in ~/.config/rofi/config.rasi

+
configuration {
+}
+@import "myConfig"
+@theme "MyTheme"
+
+
+

Rofi will first parse the config block in ~/.config/rofi/config.rasi, then +parse ~/.config/rofi/myConfig.rasi and then load the theme myTheme. More +information can be obtained from the rofi-theme(5) manpage. Imports can be +nested.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/COPYING/index.html b/COPYING/index.html new file mode 100644 index 00000000..f52e7e07 --- /dev/null +++ b/COPYING/index.html @@ -0,0 +1,1176 @@ + + + + + + + + + + + + + + + + + + + + License - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

MIT/X11 License +Modified 2013-2023 Qball Cow qball@gmpclient.org +Copyright (c) 2012 Sean Pringle sean.pringle@gmail.com

+

Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions:

+

The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software.

+

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/INSTALL/index.html b/INSTALL/index.html new file mode 100644 index 00000000..357e2672 --- /dev/null +++ b/INSTALL/index.html @@ -0,0 +1,1794 @@ + + + + + + + + + + + + + + + + + + + + + + Installation - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Installation guide

+

This guide explains how to install rofi using its build system and how you can +make debug builds.

+

Rofi uses autotools (GNU Build system), for more information see +here. +You can also use Meson as an alternative.

+

DEPENDENCY

+

For building

+
    +
  • +

    C compiler that supports the c99 standard. (gcc or clang)

    +
  • +
  • +

    make

    +
  • +
  • +

    autoconf

    +
  • +
  • +

    automake (1.11.3 or up)

    +
  • +
  • +

    pkg-config

    +
  • +
  • +

    flex 2.5.39 or higher

    +
  • +
  • +

    bison

    +
  • +
  • +

    check (Can be disabled using the --disable-check configure flag) + check is used for build-time tests and does not affect functionality.

    +
  • +
  • +

    Developer packages of the external libraries

    +
  • +
  • +

    glib-compile-resources

    +
  • +
+

External libraries

+
    +
  • +

    libpango >= 1.50

    +
  • +
  • +

    libpangocairo

    +
  • +
  • +

    libcairo

    +
  • +
  • +

    libcairo-xcb

    +
  • +
  • +

    libglib2.0 >= 2.72

    +
      +
    • gmodule-2.0
    • +
    • gio-unix-2.0
    • +
    +
  • +
  • +

    libgdk-pixbuf-2.0

    +
  • +
  • +

    libstartup-notification-1.0

    +
  • +
  • +

    libxkbcommon >= 0.4.1

    +
  • +
  • +

    libxkbcommon-x11

    +
  • +
  • +

    libxcb (sometimes split, you need libxcb, libxcb-xkb and libxcb-randr + libxcb-xinerama)

    +
  • +
  • +

    xcb-util

    +
  • +
  • +

    xcb-util-wm (sometimes split as libxcb-ewmh and libxcb-icccm)

    +
  • +
  • +

    xcb-util-cursor

    +
  • +
  • +

    xcb-imdkit (optional, 1.0.3 or up preferred)

    +
  • +
+

On debian based systems, the developer packages are in the form of: +<package>-dev on rpm based <package>-devel.

+

Install from a release

+

When downloading from the github release page, make sure to grab the archive +rofi-{version}.tar.[g|x]z. The auto-attached files source code (zip|tar.gz) +by github do not contain a valid release. It misses a setup build system and +includes irrelevant files.

+

Autotools

+

Create a build directory and enter it:

+
    mkdir build && cd build
+
+

Check dependencies and configure build system:

+
    ../configure
+
+

Build Rofi:

+
    make
+
+

The actual install, execute as root (if needed):

+
    make install
+
+

The default installation prefix is: /usr/local/ use ./configure +--prefix={prefix} to install into another location.

+

Meson

+

Check dependencies and configure build system:

+
    meson setup build
+
+

Build Rofi:

+
    ninja -C build
+
+

The actual install, execute as root (if needed):

+
    ninja -C build install
+
+

The default installation prefix is: /usr/local/ use meson setup build +--prefix={prefix} to install into another location.

+

Install a checkout from git

+

The GitHub Pages version of these directions may be out of date. Please use +INSTALL.md from the online repo or your local repository.

+

If you don't have a checkout:

+
    git clone --recursive https://github.com/DaveDavenport/rofi
+    cd rofi/
+
+

If you already have a checkout:

+
    cd rofi/
+    git pull
+    git submodule update --init
+
+

For Autotools you have an extra step, to generate build system:

+
    autoreconf -i
+
+

From this point, use the same steps you use for a release.

+

Options for configure

+

When you run the configure step there are several options you can configure.

+

For Autotools, you can see the full list with ./configure --help.

+

For Meson, before the initial setup, you can see rofi options in +meson_options.txt and Meson options with meson setup --help. Meson's +built-in options can be set using regular command line arguments, like so: +meson setup build --option=value. Rofi-specific options can be set using the +-D argument, like so: meson setup build -Doption=value. After the build dir +is set up by meson setup build, the meson configure build command can be +used to configure options, by the same means.

+

The most useful one to set is the installation prefix:

+
    # Autotools
+    ../configure --prefix=<installation path>
+
+    # Meson
+    meson setup build --prefix <installation path>
+
+

f.e.

+
    # Autotools
+    ../configure --prefix=/usr/
+
+    # Meson
+    meson setup build --prefix /usr
+
+

Install locally

+

or to install locally:

+
    # Autotools
+    ../configure --prefix=${HOME}/.local/
+
+    # Meson
+    meson setup build --prefix ${HOME}/.local
+
+

Options for make

+

When you run make you can tweak the build process a little.

+

Verbose output

+

Show the commands called:

+
    # Autotools
+    make V=1
+
+    # Meson
+    ninja -C build -v
+
+

Debug build

+

Compile with debug symbols and no optimization, this is useful for making +backtraces:

+
    # Autotools
+    make CFLAGS="-O0 -g3" clean rofi
+
+    # Meson
+    meson configure build --debug
+    ninja -C build
+
+

Get a backtrace

+

Getting a backtrace using GDB is not very handy. Because if rofi get stuck, it +grabs keyboard and mouse. So if it crashes in GDB you are stuck. The best way +to go is to enable core file. (ulimit -c unlimited in bash) then make rofi +crash. You can then load the core in GDB.

+
    # Autotools
+    gdb rofi core
+
+    # Meson (because it uses a separate build directory)
+    gdb build/rofi core
+
+
+

Where the core file is located and what its exact name is different on each +distributions. Please consult the relevant documentation.

+
+

For more information see the rofi-debugging(5) manpage.

+

Install distribution

+

Debian or Ubuntu

+
    apt install rofi
+
+

Fedora

+
    dnf install rofi
+
+

ArchLinux

+
    pacman -S rofi
+
+

Gentoo

+

An ebuild is available, x11-misc/rofi. It's up to date, but you may need to +enable ~arch to get the latest release:

+
    echo 'x11-misc/rofi ~amd64' >> /etc/portage/package.accept_keywords
+
+

for amd64 or:

+
    echo 'x11-misc/rofi ~x86' >> /etc/portage/package.accept_keywords
+
+

for i386.

+

To install it, simply issue emerge rofi.

+

openSUSE

+

On both openSUSE Leap and openSUSE Tumbleweed rofi can be installed using:

+
    sudo zypper install rofi
+
+

FreeBSD

+
    sudo pkg install rofi
+
+

macOS

+

On macOS rofi can be installed via MacPorts:

+
    sudo port install rofi
+
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/assets/images/favicon.png b/assets/images/favicon.png new file mode 100644 index 00000000..1cf13b9f Binary files /dev/null and b/assets/images/favicon.png differ diff --git a/assets/javascripts/bundle.51d95adb.min.js b/assets/javascripts/bundle.51d95adb.min.js new file mode 100644 index 00000000..b20ec683 --- /dev/null +++ b/assets/javascripts/bundle.51d95adb.min.js @@ -0,0 +1,29 @@ +"use strict";(()=>{var Hi=Object.create;var xr=Object.defineProperty;var Pi=Object.getOwnPropertyDescriptor;var $i=Object.getOwnPropertyNames,kt=Object.getOwnPropertySymbols,Ii=Object.getPrototypeOf,Er=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable;var on=(e,t,r)=>t in e?xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P=(e,t)=>{for(var r in t||(t={}))Er.call(t,r)&&on(e,r,t[r]);if(kt)for(var r of kt(t))an.call(t,r)&&on(e,r,t[r]);return e};var sn=(e,t)=>{var r={};for(var n in e)Er.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&kt)for(var n of kt(e))t.indexOf(n)<0&&an.call(e,n)&&(r[n]=e[n]);return r};var Ht=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $i(t))!Er.call(e,o)&&o!==r&&xr(e,o,{get:()=>t[o],enumerable:!(n=Pi(t,o))||n.enumerable});return e};var yt=(e,t,r)=>(r=e!=null?Hi(Ii(e)):{},Fi(t||!e||!e.__esModule?xr(r,"default",{value:e,enumerable:!0}):r,e));var fn=Ht((wr,cn)=>{(function(e,t){typeof wr=="object"&&typeof cn!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(wr,function(){"use strict";function e(r){var n=!0,o=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(T){return!!(T&&T!==document&&T.nodeName!=="HTML"&&T.nodeName!=="BODY"&&"classList"in T&&"contains"in T.classList)}function f(T){var Ke=T.type,We=T.tagName;return!!(We==="INPUT"&&a[Ke]&&!T.readOnly||We==="TEXTAREA"&&!T.readOnly||T.isContentEditable)}function c(T){T.classList.contains("focus-visible")||(T.classList.add("focus-visible"),T.setAttribute("data-focus-visible-added",""))}function u(T){T.hasAttribute("data-focus-visible-added")&&(T.classList.remove("focus-visible"),T.removeAttribute("data-focus-visible-added"))}function p(T){T.metaKey||T.altKey||T.ctrlKey||(s(r.activeElement)&&c(r.activeElement),n=!0)}function m(T){n=!1}function d(T){s(T.target)&&(n||f(T.target))&&c(T.target)}function h(T){s(T.target)&&(T.target.classList.contains("focus-visible")||T.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(i),i=window.setTimeout(function(){o=!1},100),u(T.target))}function v(T){document.visibilityState==="hidden"&&(o&&(n=!0),B())}function B(){document.addEventListener("mousemove",z),document.addEventListener("mousedown",z),document.addEventListener("mouseup",z),document.addEventListener("pointermove",z),document.addEventListener("pointerdown",z),document.addEventListener("pointerup",z),document.addEventListener("touchmove",z),document.addEventListener("touchstart",z),document.addEventListener("touchend",z)}function re(){document.removeEventListener("mousemove",z),document.removeEventListener("mousedown",z),document.removeEventListener("mouseup",z),document.removeEventListener("pointermove",z),document.removeEventListener("pointerdown",z),document.removeEventListener("pointerup",z),document.removeEventListener("touchmove",z),document.removeEventListener("touchstart",z),document.removeEventListener("touchend",z)}function z(T){T.target.nodeName&&T.target.nodeName.toLowerCase()==="html"||(n=!1,re())}document.addEventListener("keydown",p,!0),document.addEventListener("mousedown",m,!0),document.addEventListener("pointerdown",m,!0),document.addEventListener("touchstart",m,!0),document.addEventListener("visibilitychange",v,!0),B(),r.addEventListener("focus",d,!0),r.addEventListener("blur",h,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var un=Ht(Sr=>{(function(e){var t=function(){try{return!!Symbol.iterator}catch(c){return!1}},r=t(),n=function(c){var u={next:function(){var p=c.shift();return{done:p===void 0,value:p}}};return r&&(u[Symbol.iterator]=function(){return u}),u},o=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},i=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},a=function(){var c=function(p){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var m=typeof p;if(m!=="undefined")if(m==="string")p!==""&&this._fromString(p);else if(p instanceof c){var d=this;p.forEach(function(re,z){d.append(z,re)})}else if(p!==null&&m==="object")if(Object.prototype.toString.call(p)==="[object Array]")for(var h=0;hd[0]?1:0}),c._entries&&(c._entries={});for(var p=0;p1?i(d[1]):"")}})})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Sr);(function(e){var t=function(){try{var o=new e.URL("b","http://a");return o.pathname="c d",o.href==="http://a/c%20d"&&o.searchParams}catch(i){return!1}},r=function(){var o=e.URL,i=function(f,c){typeof f!="string"&&(f=String(f)),c&&typeof c!="string"&&(c=String(c));var u=document,p;if(c&&(e.location===void 0||c!==e.location.href)){c=c.toLowerCase(),u=document.implementation.createHTMLDocument(""),p=u.createElement("base"),p.href=c,u.head.appendChild(p);try{if(p.href.indexOf(c)!==0)throw new Error(p.href)}catch(T){throw new Error("URL unable to set base "+c+" due to "+T)}}var m=u.createElement("a");m.href=f,p&&(u.body.appendChild(m),m.href=m.href);var d=u.createElement("input");if(d.type="url",d.value=f,m.protocol===":"||!/:/.test(m.href)||!d.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:m});var h=new e.URLSearchParams(this.search),v=!0,B=!0,re=this;["append","delete","set"].forEach(function(T){var Ke=h[T];h[T]=function(){Ke.apply(h,arguments),v&&(B=!1,re.search=h.toString(),B=!0)}}),Object.defineProperty(this,"searchParams",{value:h,enumerable:!0});var z=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==z&&(z=this.search,B&&(v=!1,this.searchParams._fromString(this.search),v=!0))}})},a=i.prototype,s=function(f){Object.defineProperty(a,f,{get:function(){return this._anchorElement[f]},set:function(c){this._anchorElement[f]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(f){s(f)}),Object.defineProperty(a,"search",{get:function(){return this._anchorElement.search},set:function(f){this._anchorElement.search=f,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(a,{toString:{get:function(){var f=this;return function(){return f.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(f){this._anchorElement.href=f,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(f){this._anchorElement.pathname=f},enumerable:!0},origin:{get:function(){var f={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=f&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(f){},enumerable:!0},username:{get:function(){return""},set:function(f){},enumerable:!0}}),i.createObjectURL=function(f){return o.createObjectURL.apply(o,arguments)},i.revokeObjectURL=function(f){return o.revokeObjectURL.apply(o,arguments)},e.URL=i};if(t()||r(),e.location!==void 0&&!("origin"in e.location)){var n=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:n,enumerable:!0})}catch(o){setInterval(function(){e.location.origin=n()},100)}}})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Sr)});var Qr=Ht((Lt,Kr)=>{/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */(function(t,r){typeof Lt=="object"&&typeof Kr=="object"?Kr.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Lt=="object"?Lt.ClipboardJS=r():t.ClipboardJS=r()})(Lt,function(){return function(){var e={686:function(n,o,i){"use strict";i.d(o,{default:function(){return ki}});var a=i(279),s=i.n(a),f=i(370),c=i.n(f),u=i(817),p=i.n(u);function m(j){try{return document.execCommand(j)}catch(O){return!1}}var d=function(O){var w=p()(O);return m("cut"),w},h=d;function v(j){var O=document.documentElement.getAttribute("dir")==="rtl",w=document.createElement("textarea");w.style.fontSize="12pt",w.style.border="0",w.style.padding="0",w.style.margin="0",w.style.position="absolute",w.style[O?"right":"left"]="-9999px";var k=window.pageYOffset||document.documentElement.scrollTop;return w.style.top="".concat(k,"px"),w.setAttribute("readonly",""),w.value=j,w}var B=function(O,w){var k=v(O);w.container.appendChild(k);var F=p()(k);return m("copy"),k.remove(),F},re=function(O){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},k="";return typeof O=="string"?k=B(O,w):O instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(O==null?void 0:O.type)?k=B(O.value,w):(k=p()(O),m("copy")),k},z=re;function T(j){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?T=function(w){return typeof w}:T=function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},T(j)}var Ke=function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},w=O.action,k=w===void 0?"copy":w,F=O.container,q=O.target,Le=O.text;if(k!=="copy"&&k!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(q!==void 0)if(q&&T(q)==="object"&&q.nodeType===1){if(k==="copy"&&q.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(k==="cut"&&(q.hasAttribute("readonly")||q.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(Le)return z(Le,{container:F});if(q)return k==="cut"?h(q):z(q,{container:F})},We=Ke;function Ie(j){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ie=function(w){return typeof w}:Ie=function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},Ie(j)}function Ti(j,O){if(!(j instanceof O))throw new TypeError("Cannot call a class as a function")}function nn(j,O){for(var w=0;w0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof F.action=="function"?F.action:this.defaultAction,this.target=typeof F.target=="function"?F.target:this.defaultTarget,this.text=typeof F.text=="function"?F.text:this.defaultText,this.container=Ie(F.container)==="object"?F.container:document.body}},{key:"listenClick",value:function(F){var q=this;this.listener=c()(F,"click",function(Le){return q.onClick(Le)})}},{key:"onClick",value:function(F){var q=F.delegateTarget||F.currentTarget,Le=this.action(q)||"copy",Rt=We({action:Le,container:this.container,target:this.target(q),text:this.text(q)});this.emit(Rt?"success":"error",{action:Le,text:Rt,trigger:q,clearSelection:function(){q&&q.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(F){return yr("action",F)}},{key:"defaultTarget",value:function(F){var q=yr("target",F);if(q)return document.querySelector(q)}},{key:"defaultText",value:function(F){return yr("text",F)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(F){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return z(F,q)}},{key:"cut",value:function(F){return h(F)}},{key:"isSupported",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],q=typeof F=="string"?[F]:F,Le=!!document.queryCommandSupported;return q.forEach(function(Rt){Le=Le&&!!document.queryCommandSupported(Rt)}),Le}}]),w}(s()),ki=Ri},828:function(n){var o=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,f){for(;s&&s.nodeType!==o;){if(typeof s.matches=="function"&&s.matches(f))return s;s=s.parentNode}}n.exports=a},438:function(n,o,i){var a=i(828);function s(u,p,m,d,h){var v=c.apply(this,arguments);return u.addEventListener(m,v,h),{destroy:function(){u.removeEventListener(m,v,h)}}}function f(u,p,m,d,h){return typeof u.addEventListener=="function"?s.apply(null,arguments):typeof m=="function"?s.bind(null,document).apply(null,arguments):(typeof u=="string"&&(u=document.querySelectorAll(u)),Array.prototype.map.call(u,function(v){return s(v,p,m,d,h)}))}function c(u,p,m,d){return function(h){h.delegateTarget=a(h.target,p),h.delegateTarget&&d.call(u,h)}}n.exports=f},879:function(n,o){o.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},o.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||o.node(i[0]))},o.string=function(i){return typeof i=="string"||i instanceof String},o.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}},370:function(n,o,i){var a=i(879),s=i(438);function f(m,d,h){if(!m&&!d&&!h)throw new Error("Missing required arguments");if(!a.string(d))throw new TypeError("Second argument must be a String");if(!a.fn(h))throw new TypeError("Third argument must be a Function");if(a.node(m))return c(m,d,h);if(a.nodeList(m))return u(m,d,h);if(a.string(m))return p(m,d,h);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function c(m,d,h){return m.addEventListener(d,h),{destroy:function(){m.removeEventListener(d,h)}}}function u(m,d,h){return Array.prototype.forEach.call(m,function(v){v.addEventListener(d,h)}),{destroy:function(){Array.prototype.forEach.call(m,function(v){v.removeEventListener(d,h)})}}}function p(m,d,h){return s(document.body,m,d,h)}n.exports=f},817:function(n){function o(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var f=window.getSelection(),c=document.createRange();c.selectNodeContents(i),f.removeAllRanges(),f.addRange(c),a=f.toString()}return a}n.exports=o},279:function(n){function o(){}o.prototype={on:function(i,a,s){var f=this.e||(this.e={});return(f[i]||(f[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var f=this;function c(){f.off(i,c),a.apply(s,arguments)}return c._=a,this.on(i,c,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),f=0,c=s.length;for(f;f{"use strict";/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var is=/["'&<>]/;Jo.exports=as;function as(e){var t=""+e,r=is.exec(t);if(!r)return t;var n,o="",i=0,a=0;for(i=r.index;i0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function W(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function D(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n1||s(m,d)})})}function s(m,d){try{f(n[m](d))}catch(h){p(i[0][3],h)}}function f(m){m.value instanceof Xe?Promise.resolve(m.value.v).then(c,u):p(i[0][2],m)}function c(m){s("next",m)}function u(m){s("throw",m)}function p(m,d){m(d),i.shift(),i.length&&s(i[0][0],i[0][1])}}function mn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof xe=="function"?xe(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,f){a=e[i](a),o(s,f,a.done,a.value)})}}function o(i,a,s,f){Promise.resolve(f).then(function(c){i({value:c,done:s})},a)}}function A(e){return typeof e=="function"}function at(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var $t=at(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: +`+r.map(function(n,o){return o+1+") "+n.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=r}});function De(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Fe=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=xe(a),f=s.next();!f.done;f=s.next()){var c=f.value;c.remove(this)}}catch(v){t={error:v}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var u=this.initialTeardown;if(A(u))try{u()}catch(v){i=v instanceof $t?v.errors:[v]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var m=xe(p),d=m.next();!d.done;d=m.next()){var h=d.value;try{dn(h)}catch(v){i=i!=null?i:[],v instanceof $t?i=D(D([],W(i)),W(v.errors)):i.push(v)}}}catch(v){n={error:v}}finally{try{d&&!d.done&&(o=m.return)&&o.call(m)}finally{if(n)throw n.error}}}if(i)throw new $t(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)dn(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&De(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&De(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Or=Fe.EMPTY;function It(e){return e instanceof Fe||e&&"closed"in e&&A(e.remove)&&A(e.add)&&A(e.unsubscribe)}function dn(e){A(e)?e():e.unsubscribe()}var Ae={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var st={setTimeout:function(e,t){for(var r=[],n=2;n0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,a=o.isStopped,s=o.observers;return i||a?Or:(this.currentObservers=null,s.push(r),new Fe(function(){n.currentObservers=null,De(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new U;return r.source=this,r},t.create=function(r,n){return new wn(r,n)},t}(U);var wn=function(e){ne(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:Or},t}(E);var Et={now:function(){return(Et.delegate||Date).now()},delegate:void 0};var wt=function(e){ne(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Et);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,f=n._windowTime;o||(i.push(r),!a&&i.push(s.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,i=o._infiniteTimeWindow,a=o._buffer,s=a.slice(),f=0;f0?e.prototype.requestAsyncId.call(this,r,n,o):(r.actions.push(this),r._scheduled||(r._scheduled=ut.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,n,o){var i;if(o===void 0&&(o=0),o!=null?o>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,n,o);var a=r.actions;n!=null&&((i=a[a.length-1])===null||i===void 0?void 0:i.id)!==n&&(ut.cancelAnimationFrame(n),r._scheduled=void 0)},t}(Ut);var On=function(e){ne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var o=this.actions,i;r=r||o.shift();do if(i=r.execute(r.state,r.delay))break;while((r=o[0])&&r.id===n&&o.shift());if(this._active=!1,i){for(;(r=o[0])&&r.id===n&&o.shift();)r.unsubscribe();throw i}},t}(Wt);var we=new On(Tn);var R=new U(function(e){return e.complete()});function Dt(e){return e&&A(e.schedule)}function kr(e){return e[e.length-1]}function Qe(e){return A(kr(e))?e.pop():void 0}function Se(e){return Dt(kr(e))?e.pop():void 0}function Vt(e,t){return typeof kr(e)=="number"?e.pop():t}var pt=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function zt(e){return A(e==null?void 0:e.then)}function Nt(e){return A(e[ft])}function qt(e){return Symbol.asyncIterator&&A(e==null?void 0:e[Symbol.asyncIterator])}function Kt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Ki(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Qt=Ki();function Yt(e){return A(e==null?void 0:e[Qt])}function Gt(e){return ln(this,arguments,function(){var r,n,o,i;return Pt(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Xe(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,Xe(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Xe(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Bt(e){return A(e==null?void 0:e.getReader)}function $(e){if(e instanceof U)return e;if(e!=null){if(Nt(e))return Qi(e);if(pt(e))return Yi(e);if(zt(e))return Gi(e);if(qt(e))return _n(e);if(Yt(e))return Bi(e);if(Bt(e))return Ji(e)}throw Kt(e)}function Qi(e){return new U(function(t){var r=e[ft]();if(A(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Yi(e){return new U(function(t){for(var r=0;r=2;return function(n){return n.pipe(e?_(function(o,i){return e(o,i,n)}):me,Oe(1),r?He(t):zn(function(){return new Xt}))}}function Nn(){for(var e=[],t=0;t=2,!0))}function fe(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new E}:t,n=e.resetOnError,o=n===void 0?!0:n,i=e.resetOnComplete,a=i===void 0?!0:i,s=e.resetOnRefCountZero,f=s===void 0?!0:s;return function(c){var u,p,m,d=0,h=!1,v=!1,B=function(){p==null||p.unsubscribe(),p=void 0},re=function(){B(),u=m=void 0,h=v=!1},z=function(){var T=u;re(),T==null||T.unsubscribe()};return g(function(T,Ke){d++,!v&&!h&&B();var We=m=m!=null?m:r();Ke.add(function(){d--,d===0&&!v&&!h&&(p=jr(z,f))}),We.subscribe(Ke),!u&&d>0&&(u=new et({next:function(Ie){return We.next(Ie)},error:function(Ie){v=!0,B(),p=jr(re,o,Ie),We.error(Ie)},complete:function(){h=!0,B(),p=jr(re,a),We.complete()}}),$(T).subscribe(u))})(c)}}function jr(e,t){for(var r=[],n=2;ne.next(document)),e}function K(e,t=document){return Array.from(t.querySelectorAll(e))}function V(e,t=document){let r=se(e,t);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function se(e,t=document){return t.querySelector(e)||void 0}function _e(){return document.activeElement instanceof HTMLElement&&document.activeElement||void 0}function tr(e){return L(b(document.body,"focusin"),b(document.body,"focusout")).pipe(ke(1),l(()=>{let t=_e();return typeof t!="undefined"?e.contains(t):!1}),N(e===_e()),Y())}function Be(e){return{x:e.offsetLeft,y:e.offsetTop}}function Yn(e){return L(b(window,"load"),b(window,"resize")).pipe(Ce(0,we),l(()=>Be(e)),N(Be(e)))}function rr(e){return{x:e.scrollLeft,y:e.scrollTop}}function dt(e){return L(b(e,"scroll"),b(window,"resize")).pipe(Ce(0,we),l(()=>rr(e)),N(rr(e)))}var Bn=function(){if(typeof Map!="undefined")return Map;function e(t,r){var n=-1;return t.some(function(o,i){return o[0]===r?(n=i,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(r,n){var o=e(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,o=e(n,r);~o&&n.splice(o,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var o=0,i=this.__entries__;o0},e.prototype.connect_=function(){!zr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),xa?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!zr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,o=ya.some(function(i){return!!~n.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Jn=function(e,t){for(var r=0,n=Object.keys(t);r0},e}(),Zn=typeof WeakMap!="undefined"?new WeakMap:new Bn,eo=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=Ea.getInstance(),n=new Ra(t,r,this);Zn.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){eo.prototype[e]=function(){var t;return(t=Zn.get(this))[e].apply(t,arguments)}});var ka=function(){return typeof nr.ResizeObserver!="undefined"?nr.ResizeObserver:eo}(),to=ka;var ro=new E,Ha=I(()=>H(new to(e=>{for(let t of e)ro.next(t)}))).pipe(x(e=>L(Te,H(e)).pipe(C(()=>e.disconnect()))),J(1));function de(e){return{width:e.offsetWidth,height:e.offsetHeight}}function ge(e){return Ha.pipe(S(t=>t.observe(e)),x(t=>ro.pipe(_(({target:r})=>r===e),C(()=>t.unobserve(e)),l(()=>de(e)))),N(de(e)))}function bt(e){return{width:e.scrollWidth,height:e.scrollHeight}}function ar(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}var no=new E,Pa=I(()=>H(new IntersectionObserver(e=>{for(let t of e)no.next(t)},{threshold:0}))).pipe(x(e=>L(Te,H(e)).pipe(C(()=>e.disconnect()))),J(1));function sr(e){return Pa.pipe(S(t=>t.observe(e)),x(t=>no.pipe(_(({target:r})=>r===e),C(()=>t.unobserve(e)),l(({isIntersecting:r})=>r))))}function oo(e,t=16){return dt(e).pipe(l(({y:r})=>{let n=de(e),o=bt(e);return r>=o.height-n.height-t}),Y())}var cr={drawer:V("[data-md-toggle=drawer]"),search:V("[data-md-toggle=search]")};function io(e){return cr[e].checked}function qe(e,t){cr[e].checked!==t&&cr[e].click()}function je(e){let t=cr[e];return b(t,"change").pipe(l(()=>t.checked),N(t.checked))}function $a(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function Ia(){return L(b(window,"compositionstart").pipe(l(()=>!0)),b(window,"compositionend").pipe(l(()=>!1))).pipe(N(!1))}function ao(){let e=b(window,"keydown").pipe(_(t=>!(t.metaKey||t.ctrlKey)),l(t=>({mode:io("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),_(({mode:t,type:r})=>{if(t==="global"){let n=_e();if(typeof n!="undefined")return!$a(n,r)}return!0}),fe());return Ia().pipe(x(t=>t?R:e))}function Me(){return new URL(location.href)}function ot(e){location.href=e.href}function so(){return new E}function co(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)co(e,r)}function M(e,t,...r){let n=document.createElement(e);if(t)for(let o of Object.keys(t))typeof t[o]!="undefined"&&(typeof t[o]!="boolean"?n.setAttribute(o,t[o]):n.setAttribute(o,""));for(let o of r)co(n,o);return n}function fr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function fo(){return location.hash.substring(1)}function uo(e){let t=M("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function Fa(){return b(window,"hashchange").pipe(l(fo),N(fo()),_(e=>e.length>0),J(1))}function po(){return Fa().pipe(l(e=>se(`[id="${e}"]`)),_(e=>typeof e!="undefined"))}function Nr(e){let t=matchMedia(e);return Zt(r=>t.addListener(()=>r(t.matches))).pipe(N(t.matches))}function lo(){let e=matchMedia("print");return L(b(window,"beforeprint").pipe(l(()=>!0)),b(window,"afterprint").pipe(l(()=>!1))).pipe(N(e.matches))}function qr(e,t){return e.pipe(x(r=>r?t():R))}function ur(e,t={credentials:"same-origin"}){return ve(fetch(`${e}`,t)).pipe(ce(()=>R),x(r=>r.status!==200?Tt(()=>new Error(r.statusText)):H(r)))}function Ue(e,t){return ur(e,t).pipe(x(r=>r.json()),J(1))}function mo(e,t){let r=new DOMParser;return ur(e,t).pipe(x(n=>n.text()),l(n=>r.parseFromString(n,"text/xml")),J(1))}function pr(e){let t=M("script",{src:e});return I(()=>(document.head.appendChild(t),L(b(t,"load"),b(t,"error").pipe(x(()=>Tt(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(l(()=>{}),C(()=>document.head.removeChild(t)),Oe(1))))}function ho(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function bo(){return L(b(window,"scroll",{passive:!0}),b(window,"resize",{passive:!0})).pipe(l(ho),N(ho()))}function vo(){return{width:innerWidth,height:innerHeight}}function go(){return b(window,"resize",{passive:!0}).pipe(l(vo),N(vo()))}function yo(){return Q([bo(),go()]).pipe(l(([e,t])=>({offset:e,size:t})),J(1))}function lr(e,{viewport$:t,header$:r}){let n=t.pipe(X("size")),o=Q([n,r]).pipe(l(()=>Be(e)));return Q([r,t,o]).pipe(l(([{height:i},{offset:a,size:s},{x:f,y:c}])=>({offset:{x:a.x-f,y:a.y-c+i},size:s})))}(()=>{function e(n,o){parent.postMessage(n,o||"*")}function t(...n){return n.reduce((o,i)=>o.then(()=>new Promise(a=>{let s=document.createElement("script");s.src=i,s.onload=a,document.body.appendChild(s)})),Promise.resolve())}var r=class{constructor(n){this.url=n,this.onerror=null,this.onmessage=null,this.onmessageerror=null,this.m=a=>{a.source===this.w&&(a.stopImmediatePropagation(),this.dispatchEvent(new MessageEvent("message",{data:a.data})),this.onmessage&&this.onmessage(a))},this.e=(a,s,f,c,u)=>{if(s===this.url.toString()){let p=new ErrorEvent("error",{message:a,filename:s,lineno:f,colno:c,error:u});this.dispatchEvent(p),this.onerror&&this.onerror(p)}};let o=new EventTarget;this.addEventListener=o.addEventListener.bind(o),this.removeEventListener=o.removeEventListener.bind(o),this.dispatchEvent=o.dispatchEvent.bind(o);let i=document.createElement("iframe");i.width=i.height=i.frameBorder="0",document.body.appendChild(this.iframe=i),this.w.document.open(),this.w.document.write(` + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

rofi-debugging(5)

+

NAME

+

Debugging rofi.

+

When reporting an issue with rofi crashing, or misbehaving. It helps to do some +small test to help pin-point the problem.

+

First try disabling your custom configuration: -no-config

+

This disables the parsing of the configuration files. This runs rofi in stock +mode.

+

If you run custom C plugins, you can disable the plugins using: -no-plugins

+

Get the relevant information for an issue

+

Please pastebin the output of the following commands:

+
rofi -help
+rofi -dump-config
+rofi -dump-theme
+
+

rofi -help provides us with the configuration files parsed, the exact +version, monitor layout and more useful information.

+

The rofi -dump-config and rofi -dump-theme output gives us rofi +interpretation of your configuration and theme.

+

Please check the output for identifiable information and remove this.

+

Timing traces

+

To get a timing trace, enable the Timings debug domain.

+
G_MESSAGES_DEBUG=Timings rofi -show drun
+
+

It will show a trace with (useful) timing information at relevant points during +the execution. This will help debugging when rofi is slow to start.

+

Example trace:

+
(process:14942): Timings-DEBUG: 13:47:39.335: 0.000000 (0.000000): Started
+(process:14942): Timings-DEBUG: 13:47:39.335: 0.000126 (0.000126): ../source/rofi.c:main:786 
+(process:14942): Timings-DEBUG: 13:47:39.335: 0.000163 (0.000037): ../source/rofi.c:main:819 
+(process:14942): Timings-DEBUG: 13:47:39.336: 0.000219 (0.000056): ../source/rofi.c:main:826 Setup Locale
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001235 (0.001016): ../source/rofi.c:main:828 Collect MODI
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001264 (0.000029): ../source/rofi.c:main:830 Setup MODI
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001283 (0.000019): ../source/rofi.c:main:834 Setup mainloop
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001369 (0.000086): ../source/rofi.c:main:837 NK Bindings
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001512 (0.000143): ../source/xcb.c:display_setup:1177 Open Display
+(process:14942): Timings-DEBUG: 13:47:39.337: 0.001829 (0.000317): ../source/xcb.c:display_setup:1192 Setup XCB
+(process:14942): Timings-DEBUG: 13:47:39.346: 0.010650 (0.008821): ../source/rofi.c:main:844 Setup Display
+(process:14942): Timings-DEBUG: 13:47:39.346: 0.010715 (0.000065): ../source/rofi.c:main:848 Setup abe
+(process:14942): Timings-DEBUG: 13:47:39.350: 0.015101 (0.004386): ../source/rofi.c:main:883 Load cmd config 
+(process:14942): Timings-DEBUG: 13:47:39.351: 0.015275 (0.000174): ../source/rofi.c:main:907 Setup Modi
+(process:14942): Timings-DEBUG: 13:47:39.351: 0.015291 (0.000016): ../source/view.c:rofi_view_workers_initialize:1922 Setup Threadpool, start
+(process:14942): Timings-DEBUG: 13:47:39.351: 0.015349 (0.000058): ../source/view.c:rofi_view_workers_initialize:1945 Setup Threadpool, done
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032018 (0.016669): ../source/rofi.c:main:1000 Setup late Display
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032080 (0.000062): ../source/rofi.c:main:1003 Theme setup
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032109 (0.000029): ../source/rofi.c:startup:668 Startup
+(process:14942): Timings-DEBUG: 13:47:39.367: 0.032121 (0.000012): ../source/rofi.c:startup:677 Grab keyboard
+(process:14942): Timings-DEBUG: 13:47:39.368: 0.032214 (0.000093): ../source/view.c:__create_window:701 xcb create window
+(process:14942): Timings-DEBUG: 13:47:39.368: 0.032235 (0.000021): ../source/view.c:__create_window:705 xcb create gc
+(process:14942): Timings-DEBUG: 13:47:39.368: 0.033136 (0.000901): ../source/view.c:__create_window:714 create cairo surface
+(process:14942): Timings-DEBUG: 13:47:39.369: 0.033286 (0.000150): ../source/view.c:__create_window:723 pango cairo font setup
+(process:14942): Timings-DEBUG: 13:47:39.369: 0.033351 (0.000065): ../source/view.c:__create_window:761 configure font
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045896 (0.012545): ../source/view.c:__create_window:769 textbox setup
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045944 (0.000048): ../source/view.c:__create_window:781 setup window attributes
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045955 (0.000011): ../source/view.c:__create_window:791 setup window fullscreen
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045966 (0.000011): ../source/view.c:__create_window:797 setup window name and class
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045974 (0.000008): ../source/view.c:__create_window:808 setup startup notification
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045981 (0.000007): ../source/view.c:__create_window:810 done
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045992 (0.000011): ../source/rofi.c:startup:679 Create Window
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.045999 (0.000007): ../source/rofi.c:startup:681 Parse ABE
+(process:14942): Timings-DEBUG: 13:47:39.381: 0.046113 (0.000114): ../source/rofi.c:startup:684 Config sanity check
+(process:14942): Timings-DEBUG: 13:47:39.384: 0.048229 (0.002116): ../source/dialogs/run.c:get_apps:216 start
+(process:14942): Timings-DEBUG: 13:47:39.390: 0.054626 (0.006397): ../source/dialogs/run.c:get_apps:336 stop
+(process:14942): Timings-DEBUG: 13:47:39.390: 0.054781 (0.000155): ../source/dialogs/drun.c:get_apps:634 Get Desktop apps (start)
+(process:14942): Timings-DEBUG: 13:47:39.391: 0.055264 (0.000483): ../source/dialogs/drun.c:get_apps:641 Get Desktop apps (user dir)
+(process:14942): Timings-DEBUG: 13:47:39.418: 0.082884 (0.027620): ../source/dialogs/drun.c:get_apps:659 Get Desktop apps (system dirs)
+(process:14942): Timings-DEBUG: 13:47:39.418: 0.082944 (0.000060): ../source/dialogs/drun.c:get_apps_history:597 Start drun history
+(process:14942): Timings-DEBUG: 13:47:39.418: 0.082977 (0.000033): ../source/dialogs/drun.c:get_apps_history:617 Stop drun history
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083638 (0.000661): ../source/dialogs/drun.c:get_apps:664 Sorting done.
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083685 (0.000047): ../source/view.c:rofi_view_create:1759 
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083700 (0.000015): ../source/view.c:rofi_view_create:1783 Startup notification
+(process:14942): Timings-DEBUG: 13:47:39.419: 0.083711 (0.000011): ../source/view.c:rofi_view_create:1786 Get active monitor
+(process:14942): Timings-DEBUG: 13:47:39.420: 0.084693 (0.000982): ../source/view.c:rofi_view_refilter:1028 Filter start
+(process:14942): Timings-DEBUG: 13:47:39.421: 0.085992 (0.001299): ../source/view.c:rofi_view_refilter:1132 Filter done
+(process:14942): Timings-DEBUG: 13:47:39.421: 0.086090 (0.000098): ../source/view.c:rofi_view_update:982 
+(process:14942): Timings-DEBUG: 13:47:39.421: 0.086123 (0.000033): ../source/view.c:rofi_view_update:1002 Background
+(process:14942): Timings-DEBUG: 13:47:39.428: 0.092864 (0.006741): ../source/view.c:rofi_view_update:1008 widgets
+
+

Debug domains

+

To further debug the plugin, you can get a trace with (lots of) debug +information. This debug output can be enabled for multiple parts in rofi using +the glib debug framework. Debug domains can be enabled by setting the +G_MESSAGES_DEBUG environment variable. At the time of creation of this page, +the following debug domains exist:

+
    +
  • all: Show debug information from all domains.
  • +
  • X11Helper: The X11 Helper functions.
  • +
  • View: The main window view functions.
  • +
  • Widgets.Box: The Box widget.
  • +
  • Modes.DMenu: The dmenu mode.
  • +
  • Modes.Run: The run mode.
  • +
  • Modes.DRun: The desktop file run mode.
  • +
  • Modes.Window: The window mode.
  • +
  • Modes.Script: The script mode.
  • +
  • Modes.Combi: The script mode.
  • +
  • Modes.Ssh: The ssh mode.
  • +
  • Rofi: The main application.
  • +
  • Timings: Get timing output.
  • +
  • Theme: Theme engine debug output. (warning lots of output).
  • +
  • Widgets.Icon: The Icon widget.
  • +
  • Widgets.Box: The box widget.
  • +
  • Widgets.Container: The container widget.
  • +
  • Widgets.Window: The window widget.
  • +
  • Helpers.IconFetcher: Information about icon lookup.
  • +
+

For full list see man rofi.

+

Example: G_MESSAGES_DEBUG=Dialogs.DRun rofi -show drun To get specific output +from the Desktop file run dialog.

+

To redirect the debug output to a file (~/rofi.log) add:

+
rofi -show drun -log ~/rofi.log
+
+

Specifying the logfile automatically enabled all log domains. +This can be useful when rofi is launched from a window manager.

+

Creating a backtrace

+

First make sure you compile rofi with debug symbols:

+
make CFLAGS="-O0 -g3" clean rofi
+
+

Getting a backtrace using GDB is not very handy. Because if rofi get stuck, it +grabs keyboard and mouse. So if it crashes in GDB you are stuck. The best way +to go is to enable core file. (ulimit -c unlimited in bash) then make rofi +crash. You can then load the core in GDB.

+
gdb rofi core
+
+

Then type inside gdb:

+
thread apply all bt
+
+

The output trace is useful when reporting crashes.

+

Some distribution have systemd-coredump, this way you can easily get a +backtrace via coredumpctl.

+

SEE ALSO

+

rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), +rofi-script(5), rofi-keys(5),rofi-theme-selector(1)

+

AUTHOR

+ + + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/current/rofi-dmenu.5/index.html b/current/rofi-dmenu.5/index.html new file mode 100644 index 00000000..158bb976 --- /dev/null +++ b/current/rofi-dmenu.5/index.html @@ -0,0 +1,1520 @@ + + + + + + + + + + + + + + + + + + + + + + Dmenu - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

rofi-dmenu(5)

+

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.

+

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).

+

BASIC CONCEPT

+

In dmenu mode, rofi reads data from standard in, splits them into +separate entries and displays them. If the user selects a row, this is printed +out to standard out, allowing the script to process it further.

+

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.

+

USAGE

+

By launching rofi with the -dmenu flag it will go into dmenu emulation +mode.

+
ls | rofi -dmenu
+
+

DMENU DROP-IN REPLACEMENT

+

If argv[0] (calling command) is dmenu, rofi will start in dmenu mode. +This way, it can be used as a drop-in replacement for dmenu. Just copy or +symlink rofi to dmenu in $PATH.

+
ln -s /usr/bin/rofi /usr/bin/dmenu
+
+

DMENU VS SCRIPT MODE

+

Script mode is used to extend rofi, dmenu mode is used to extend a script. +The two do share much of the same input format. Please see the +rofi-script(5) manpage for more information.

+

DMENU SPECIFIC COMMANDLINE FLAGS

+

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.

+

-sep separator

+

Separator for dmenu. Example: To show a list of 'a' to 'e' with '|' as a +separator:

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
+
+

-p prompt

+

Specify the prompt to show in dmenu mode. For example, select 'monkey', +a,b,c,d, or e.

+
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey"
+
+

Default: dmenu

+

-l number of lines to show

+

Maximum number of lines the menu may show before scrolling.

+
rofi -dmenu -l 25
+
+

Default: 15

+

-i

+

Makes dmenu searches case-insensitive

+

-a X

+

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:

+
    +
  • 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'
  • +
+

-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

+

Allows the output of dmenu to be customized (N is the total number of input +entries):

+
    +
  • '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)
  • +
+

Default: 's'

+

-select string

+

Select first line that matches the given string

+

-mesg string

+

Add a message line below the filter entry box. Supports Pango markup. For more +information on supported markup, see +here

+

-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. +See here +for details about Pango markup.

+

-multi-select

+

Allow multiple lines to be selected. Adds a small selection indicator to the +left of each entry.

+

-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-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.

+

-display-columns

+

A comma seperated list of columns to show.

+

-display-column-separator

+

The column separator. This is a regex.

+

default: '\t'

+

-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.

+

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.

+

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)

+

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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/current/rofi-keys.5/index.html b/current/rofi-keys.5/index.html new file mode 100644 index 00000000..b7b7c548 --- /dev/null +++ b/current/rofi-keys.5/index.html @@ -0,0 +1,1598 @@ + + + + + + + + + + + + + + + + + + + + + + Keys - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

rofi-keys(5)

+

NAME

+

rofi keys - Rofi Key and Mouse bindings

+

DESCRIPTION

+

rofi supports overriding of any of it key and mouse binding.

+

Setting binding

+

Bindings can be done on the commandline (-{bindingname}):

+
rofi -show run -kb-accept-entry 'Control+Shift+space'
+
+

or via the configuration file:

+
configuration {
+  kb-accept-entry: "Control+Shift+space";
+}
+
+

The key can be set by its name (see above) or its keycode:

+
configuration {
+  kb-accept-entry: "Control+Shift+[65]";
+}
+
+

An easy way to look up keycode is xev(1).

+

Multiple keys can be specified for an action as a comma separated list:

+
configuration {
+  kb-accept-entry: "Control+Shift+space,Return";
+}
+
+

By Default rofi reacts on pressing, to act on the release of all keys +prepend the binding with !:

+
configuration {
+  kb-accept-entry: "!Control+Shift+space,Return";
+}
+
+

Unsetting a binding

+

To unset a binding, pass an empty string.

+
configuration {
+  kb-clear-line: "";
+}
+
+

Keyboard Bindings

+

kb-primary-paste

+

Paste primary selection

+

Default: Control+V,Shift+Insert

+

kb-secondary-paste

+

Paste clipboard

+

Default: Control+v,Insert

+

kb-secondary-copy

+

Copy current selection to clipboard

+

Default: Control+c

+

kb-clear-line

+

Clear input line

+

Default: Control+w

+

kb-move-front

+

Beginning of line

+

Default: Control+a

+

kb-move-end

+

End of line

+

Default: Control+e

+

kb-move-word-back

+

Move back one word

+

Default: Alt+b,Control+Left

+

kb-move-word-forward

+

Move forward one word

+

Default: Alt+f,Control+Right

+

kb-move-char-back

+

Move back one char

+

Default: Left,Control+b

+

kb-move-char-forward

+

Move forward one char

+

Default: Right,Control+f

+

kb-remove-word-back

+

Delete previous word

+

Default: Control+Alt+h,Control+BackSpace

+

kb-remove-word-forward

+

Delete next word

+

Default: Control+Alt+d

+

kb-remove-char-forward

+

Delete next char

+

Default: Delete,Control+d

+

kb-remove-char-back

+

Delete previous char

+

Default: BackSpace,Shift+BackSpace,Control+h

+

kb-remove-to-eol

+

Delete till the end of line

+

Default: Control+k

+

kb-remove-to-sol

+

Delete till the start of line

+

Default: Control+u

+

kb-accept-entry

+

Accept entry

+

Default: Control+j,Control+m,Return,KP_Enter

+

kb-accept-custom

+

Use entered text as command (in ssh/run modes)

+

Default: Control+Return

+

kb-accept-custom-alt

+

Use entered text as command (in ssh/run modes)

+

Default: Control+Shift+Return

+

kb-accept-alt

+

Use alternate accept command.

+

Default: Shift+Return

+

kb-delete-entry

+

Delete entry from history

+

Default: Shift+Delete

+

kb-mode-next

+

Switch to the next mode.

+

Default: Shift+Right,Control+Tab

+

kb-mode-previous

+

Switch to the previous mode.

+

Default: Shift+Left,Control+ISO_Left_Tab

+

kb-mode-complete

+

Start completion for mode.

+

Default: Control+l

+

kb-row-left

+

Go to the previous column

+

Default: Control+Page_Up

+

kb-row-right

+

Go to the next column

+

Default: Control+Page_Down

+

kb-row-up

+

Select previous entry

+

Default: Up,Control+p

+

kb-row-down

+

Select next entry

+

Default: Down,Control+n

+

kb-row-tab

+

Go to next row, if one left, accept it, if no left next mode.

+

Default:

+

kb-element-next

+

Go to next row.

+

Default: Tab

+

kb-element-prev

+

Go to previous row.

+

Default: ISO_Left_Tab

+

kb-page-prev

+

Go to the previous page

+

Default: Page_Up

+

kb-page-next

+

Go to the next page

+

Default: Page_Down

+

kb-row-first

+

Go to the first entry

+

Default: Home,KP_Home

+

kb-row-last

+

Go to the last entry

+

Default: End,KP_End

+

kb-row-select

+

Set selected item as input text

+

Default: Control+space

+

kb-screenshot

+

Take a screenshot of the rofi window

+

Default: Alt+S

+

kb-ellipsize

+

Toggle between ellipsize modes for displayed data

+

Default: Alt+period

+

kb-toggle-case-sensitivity

+

Toggle case sensitivity

+

Default: grave,dead_grave

+

kb-toggle-sort

+

Toggle filtered menu sort

+

Default: Alt+grave

+

kb-cancel

+

Quit rofi

+

Default: Escape,Control+g,Control+bracketleft

+

kb-custom-1

+

Custom keybinding 1

+

Default: Alt+1

+

kb-custom-2

+

Custom keybinding 2

+

Default: Alt+2

+

kb-custom-3

+

Custom keybinding 3

+

Default: Alt+3

+

kb-custom-4

+

Custom keybinding 4

+

Default: Alt+4

+

kb-custom-5

+

Custom Keybinding 5

+

Default: Alt+5

+

kb-custom-6

+

Custom keybinding 6

+

Default: Alt+6

+

kb-custom-7

+

Custom Keybinding 7

+

Default: Alt+7

+

kb-custom-8

+

Custom keybinding 8

+

Default: Alt+8

+

kb-custom-9

+

Custom keybinding 9

+

Default: Alt+9

+

kb-custom-10

+

Custom keybinding 10

+

Default: Alt+0

+

kb-custom-11

+

Custom keybinding 11

+

Default: Alt+exclam

+

kb-custom-12

+

Custom keybinding 12

+

Default: Alt+at

+

kb-custom-13

+

Custom keybinding 13

+

Default: Alt+numbersign

+

kb-custom-14

+

Custom keybinding 14

+

Default: Alt+dollar

+

kb-custom-15

+

Custom keybinding 15

+

Default: Alt+percent

+

kb-custom-16

+

Custom keybinding 16

+

Default: Alt+dead_circumflex

+

kb-custom-17

+

Custom keybinding 17

+

Default: Alt+ampersand

+

kb-custom-18

+

Custom keybinding 18

+

Default: Alt+asterisk

+

kb-custom-19

+

Custom Keybinding 19

+

Default: Alt+parenleft

+

kb-select-1

+

Select row 1

+

Default: Super+1

+

kb-select-2

+

Select row 2

+

Default: Super+2

+

kb-select-3

+

Select row 3

+

Default: Super+3

+

kb-select-4

+

Select row 4

+

Default: Super+4

+

kb-select-5

+

Select row 5

+

Default: Super+5

+

kb-select-6

+

Select row 6

+

Default: Super+6

+

kb-select-7

+

Select row 7

+

Default: Super+7

+

kb-select-8

+

Select row 8

+

Default: Super+8

+

kb-select-9

+

Select row 9

+

Default: Super+9

+

kb-select-10

+

Select row 10

+

Default: Super+0

+

kb-entry-history-up

+

Go up in the entry history.

+

Default: Control+Up

+

kb-entry-history-down

+

Go down in the entry history.

+

Default: Control+Down

+

Mouse Bindings

+

ml-row-left

+

Go to the previous column

+

Default: ScrollLeft

+

ml-row-right

+

Go to the next column

+

Default: ScrollRight

+

ml-row-up

+

Select previous entry

+

Default: ScrollUp

+

ml-row-down

+

Select next entry

+

Default: ScrollDown

+

me-select-entry

+

Select hovered row

+

Default: MousePrimary

+

me-accept-entry

+

Accept hovered row

+

Default: MouseDPrimary

+

me-accept-custom

+

Accept hovered row with custom action

+

Default: Control+MouseDPrimary

+

SEE ALSO

+

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

+

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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/current/rofi-script.5/index.html b/current/rofi-script.5/index.html new file mode 100644 index 00000000..7823a0e5 --- /dev/null +++ b/current/rofi-script.5/index.html @@ -0,0 +1,1598 @@ + + + + + + + + + + + + + + + + + + + + + + Script - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

rofi-script(5)

+

NAME

+

rofi script mode - Rofi format for scriptable mode.

+

DESCRIPTION

+

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

+

USAGE

+

To specify a script mode, set a mode with the following syntax: +"{name}:{executable}"

+

For example:

+
rofi -show fb -modes "fb:file_browser.sh"
+
+

The name should be unique.

+

API

+

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" ]
+then
+    exit 0
+fi
+echo "reload"
+echo "quit"
+
+
+

This shows two entries, reload and quit. When the quit entry is selected, rofi +closes.

+

Environment

+

Rofi sets the following environment variable when executing the script:

+

ROFI_RETV

+

An integer number with the current state:

+
    +
  • 0: Initial call of script.
  • +
  • 1: Selected an entry.
  • +
  • 2: Selected a custom entry.
  • +
  • 10-28: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
  • +
+

ROFI_INFO

+

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

+

ROFI_DATA

+

Environment get set when script sets data option in header.

+

Passing mode options

+

Extra options, like setting the prompt, can be set by the script. Extra 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:

+
    +
  • +

    prompt: Update the prompt text.

    +
  • +
  • +

    message: Update the message text.

    +
  • +
  • +

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

    +
  • +
  • +

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

    +
  • +
  • +

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

    +
  • +
  • +

    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.

    +
  • +
  • +

    no-custom: If set to 'true'; only accept listed entries, ignore custom + input.

    +
  • +
  • +

    use-hot-keys: If set to true, it enabled the Custom keybindings for + script. Warning this breaks the normal rofi flow.

    +
  • +
  • +

    keep-selection: If set, the selection is not moved to the first entry, + but the current position is maintained. The filter is cleared.

    +
  • +
  • +

    new-selection: If keep-selection is set, this allows you to override + the selected entry (absolute position).

    +
  • +
  • +

    data: Passed data to the next execution of the script via + ROFI_DATA.

    +
  • +
  • +

    theme: Small theme snippet to f.e. change the background color of + a widget.

    +
  • +
+

The theme property cannot change the interface while running, it is only +usable for small changes in, for example background color, of widgets that get +updated during display like the row color of the listview.

+

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 entry.

+

For example:

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

The following options are supported:

+
    +
  • +

    icon: Set the icon for that row.

    +
  • +
  • +

    display: Replace the displayed string. (Original string will still be used for filtering)

    +
  • +
  • +

    meta: Specify invisible search terms used for filtering.

    +
  • +
  • +

    nonselectable: If true the row cannot activated.

    +
  • +
  • +

    permanent: If true the row always shows, independent of filter.

    +
  • +
  • +

    info: Info that, on selection, gets placed in the ROFI_INFO + environment variable. This entry does not get searched for filtering.

    +
  • +
  • +

    urgent: Set urgent flag on entry (true/false)

    +
  • +
  • +

    active: Set active flag on entry (true/false)

    +
  • +
+

multiple entries can be passed using the \x1f separator.

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

Executing external program

+

If you want to launch an external program from the script, you need to make +sure it is launched in the background. If not rofi will wait for its output (to +display).

+

In bash the best way to do this is using coproc.

+
 coproc ( myApp  > /dev/null  2>&1 )
+
+

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 github.

+

Script locations

+

To specify a script there are the following options:

+
    +
  • Specify an absolute path to the script.
  • +
  • The script is executable and located in your $PATH
  • +
+

Scripts located in the following location are loaded on startup:

+
    +
  • The script is in $XDG_CONFIG_PATH/rofi/scripts/, this is usually + ~/.config/rofi/scripts/.
  • +
+

SEE ALSO

+

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

+

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.

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/current/rofi-theme.5/index.html b/current/rofi-theme.5/index.html new file mode 100644 index 00000000..c435260d --- /dev/null +++ b/current/rofi-theme.5/index.html @@ -0,0 +1,3718 @@ + + + + + + + + + + + + + + + + + + + + + + Themes - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

rofi-theme(5)

+

NAME

+

rofi-theme - Rofi theme format files

+

Getting started with theming

+

The easiest way to get started theming rofi is by modifying your existing theme.

+

Themes can be modified/tweaked by adding theming elements to the end of the\ +config file. The default location of this file is ~/.config/rofi/config.rasi, +if the file does not exists, you can create it.

+

A basic config:

+
configuration {
+  modes: [ combi ];
+  combi-modes: [ window, drun, run ];
+}
+
+@theme "gruvbox-light"
+
+/* Insert theme modifications after this */
+
+

For example if we want to change the Type to filter text in the entry box we +append the following:

+
entry {
+    placeholder: "Type here";
+}
+
+

In the above section, entry indicates the widget, placeholder is the +property we want to modify and we set it to the string "Type here". To find +the commonly available widgets in rofi, see the 'Basic structure' section.

+

To change the mouse over cursor to a pointer, add:

+
entry {
+    placeholder: "Type here";
+    cursor: pointer;
+}
+
+

For the next modification, we want to add the icon after each text element and +increase the size. First we start by modifying the element widget:

+

+element {
+  orientation: horizontal;
+  children: [ element-text, element-icon ];
+  spacing: 5px;
+}
+
+
+

Resulting in the following packing:

+
┌─────────────────────────────────────────────────────────────────────┐ 
+│ element                                                             │ 
+│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │ 
+│ │element─text                                 │ │ element─icon    │ │ 
+│ └─────────────────────────────────────────────┘ └─────────────────┘ │ 
+└─────────────────────────────────────────────────────────────────────┘ 
+
+

The element (container) widget hold each entry in the listview, we add the +two pre-defined children in the order we want to show. We also specify the +packing direction (orientation) and the spacing between the children +(spacing). We specify the space between the two children in absolute pixels +(px).

+

To increase the icon-size, we need to modify the element-icon widget.

+
element-icon {
+    size: 2.5em;
+}
+
+
┌─────────────────────────────────────────────────────────────────────┐ 
+│ element                                                             │ 
+│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │ 
+│ │element─text                                 │ │    element      │ │ 
+│ │                                             │ │       ─         │ │ 
+│ │                                             │ │     icon        │ │ 
+│ └─────────────────────────────────────────────┘ └─────────────────┘ │ 
+└─────────────────────────────────────────────────────────────────────┘ 
+
+

In this example we specify the size in the em unit.

+

Now lets change the text color of both the entry and the element-text +widget to red and background to blue.

+
entry, element-text {
+  text-color: red;
+  background-color: rgb(0,0,255);
+}
+
+

Here we use two different methods of writing down the color, for text-color +we used a named color, for background-color we specify it in rgb. +We also specify the property for multiple widgets by passing a comma separated +list of widget names.

+

If you want to center the text relative to the icon, we can set this:

+
element-text {
+    vertical-align: 0.5;
+}
+
+
┌─────────────────────────────────────────────────────────────────────┐ 
+│ element                                                             │ 
+│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │ 
+│ │                                             │ │    element      │ │ 
+│ │element-text                                 │ │       ─         │ │ 
+│ │                                             │ │     icon        │ │ 
+│ └─────────────────────────────────────────────┘ └─────────────────┘ │ 
+└─────────────────────────────────────────────────────────────────────┘ 
+
+

We can also specify the color and width of the cursor. You could, for example, +create a crimson block cursor like this:

+
entry {
+  cursor-color: rgb(220,20,60);
+  cursor-width: 8px;
+}
+
+

By default, the cursor-color will be the same as the text-color. The +cursor-width will always default to 2 pixels.

+

If you want to see the complete theme, including the modification you can run:

+
rofi -dump-theme
+
+

Default theme loading

+

By default, rofi loads the default theme. This theme is always loaded. +The default configuration contains:

+
@theme "default"
+
+

To unload the default theme, and load another theme, add the @theme statement +to your config.rasi file.

+

If you have a theme loaded via @theme or use the default theme, you can tweak +it by adding overriding elements at the end of your config.rasi file.

+

For the difference between @import and @theme see the Multiple file +handling section in this manpage.

+

To see the default theme, run the following command:

+
rofi -no-config -dump-theme
+
+

Description

+

The need for a new theme format was motivated by the fact that the way rofi +handled widgets has changed. From a very static drawing of lines and text to a +nice structured form of packing widgets. This change made it possible to +provide a more flexible theme framework. The old theme format and config file +are not flexible enough to expose these options in a user-friendly way. +Therefore, a new file format has been created, replacing the old one.

+

Format specification

+

Encoding

+

The encoding of the file is UTF-8. Both unix (\n) and windows (\r\n) +newlines format are supported. But unix is preferred.

+

Comments

+

C and C++ file comments are supported.

+
    +
  • +

    Anything after // and before a newline is considered a comment.

    +
  • +
  • +

    Everything between /* and */ is a comment, this comment can span + multiple lines.

    +
  • +
+

Comments can be nested and the C comments can be inline.

+

The following is valid:

+
// Magic comment.
+property: /* comment */ value;
+
+

However, this is not:

+
prop/*comment*/erty: value;
+
+

White space

+

White space and newlines, like comments, are ignored by the parser.

+

This:

+
property: name;
+
+

Is identical to:

+
     property             :
+name
+
+;
+
+

File extension

+

The preferred file extension for the new theme format is rasi. This is an +abbreviation for rofi advanced style information. If a theme +file is split over multiple files, include files can have the: rasinc +extension.

+

Basic Structure

+

Each element has a section with defined properties. Global properties can be +defined in section * { }. Sub-section names begin with an optional hash +symbol #.

+

It is advised to define the global properties section on top of the file to +make inheritance of properties clearer.

+
/* Global properties section */
+* {
+    // list of properties
+}
+
+/* Element theme section. */
+{element path} {
+    // list of properties
+}
+{elements... } {
+    // list of properties
+}
+
+

If there are multiple sections with the same name, they are merged. Duplicate +properties are overwritten and the last parsed entry kept.

+

Global properties section

+

A theme can have one or more global properties sections. If there is more than +one, they will be merged.

+

The global properties section denotes the defaults for each element. +Each property of this section can be referenced with @{identifier} +(See Properties section)

+

A global properties section is indicated with a * as element path.

+

Element theme section

+

A theme can have multiple element theme sections.

+

The element path can consist of multiple names separated by whitespace or dots. +Each element may contain any number of letters, numbers and -'s. +The first element in the element path can optionally start with a # (for +historic reasons). Multiple elements can be specified by a ,.

+

This is a valid element name:

+
element normal.normal {
+    background-color: blue;
+}
+button {
+    background-color: blue;
+}
+
+

And is identical to:

+
element normal normal, button {
+    background-color: blue;
+}
+
+

Each section inherits the global properties. Properties can be explicitly +inherited from their parent with the inherit keyword. +In the following example:

+
window {
+ a: 1;
+ b: 2;
+ children: [ mainbox ];
+}
+mainbox {
+    a: inherit;
+    b: 4;
+    c: 8;
+}
+
+

The element mainbox will have the following set of properties (if mainbox +is a child of window):

+
a: 1;
+b: 4;
+c: 8;
+
+

If multiple sections are defined with the same name, they are merged by the +parser. If multiple properties with the same name are defined in one section, +the last encountered property is used.

+

Properties Format

+

The properties in a section consist of:

+
{identifier}: {value};
+
+

Both fields are mandatory for a property.

+

The identifier names the specified property. Identifiers can consist of any +combination of numbers, letters and '-'. It must not contain any whitespace. +The structure of the value defines the type of the property. The current +parser does not define or enforce a certain type of a particular identifier. +When used, values with the wrong type that cannot be converted are ignored.

+

The current theme format supports different types:

+
    +
  • a string
  • +
  • an integer number
  • +
  • a fractional number
  • +
  • a boolean value
  • +
  • a color
  • +
  • image
  • +
  • text style
  • +
  • line style
  • +
  • a distance
  • +
  • a padding
  • +
  • a border
  • +
  • a position
  • +
  • a reference
  • +
  • an orientation
  • +
  • a cursor
  • +
  • a list of keywords
  • +
  • an array of values
  • +
  • an environment variable
  • +
  • Inherit
  • +
+

Some of these types are a combination of other types.

+

String

+
    +
  • Format: (["'])[:print:]+\1
  • +
+

Strings are always surrounded by double (") or single (', apostrophe) quotes. Between +the quotes there can be any printable character.

+

For example:

+
font: "Awasome 12";
+
+

The string must be valid UTF-8, special characters can be escaped:

+
text { content: "Line one\n\tIndented line two 'Quoted text'"; }
+text { content: 'Line one\n\tIndented line two "Quoted text"'; }
+text { content: "Line one\n\tIndented line two \"Quoted text\""; }
+
+

The following special characters can be escaped: \b, \f, \n, \r, \t, \v, \, +" and ' (double quotes inside single-quotes or in reverse don't need escape).

+

Integer

+
    +
  • Format: [-+]?[:digit:]+
  • +
+

An integer may contain any number.

+

For examples:

+
lines: 12;
+
+

Real

+
    +
  • Format: [-+]?[:digit:]+(\.[:digit:]+)?
  • +
+

A real is an integer with an optional fraction.

+

For example:

+
real: 3.4;
+
+

The following is not valid: .3, 3. or scientific notation: 3.4e-3.

+

Boolean

+
    +
  • Format: (true|false)
  • +
+

Boolean value is either true or false. This is case-sensitive.

+

For example:

+
dynamic: false;
+
+

Image

+

rofi support a limited set of background-image formats.

+
    +
  • +

    Format: url("path to image");

    +
  • +
  • +

    Format: url("path to image", scale); + where scale is: none, both, width, height

    +
  • +
  • +

    Format: linear-gradient(stop color,stop1, color, stop2 color, ...);

    +
  • +
  • +

    Format: linear-gradient(to direction, stop color,stop1, color, stop2 color, + ...); where direction is: top,left,right,bottom.

    +
  • +
  • +

    Format: linear-gradient(angle, stop color,stop1, color, stop2 color, ...); + Angle in deg,rad,grad (as used in color).

    +
  • +
+

Where the path is a string, and stop color is of type color.

+

Color

+

rofi supports the color formats as specified in the CSS standard (1,2,3 and +some of CSS 4)

+
    +
  • +

    Format: #{HEX}{3} (rgb)

    +
  • +
  • +

    Format: #{HEX}{4} (rgba)

    +
  • +
  • +

    Format: #{HEX}{6} (rrggbb)

    +
  • +
  • +

    Format: #{HEX}{8} (rrggbbaa)

    +
  • +
  • +

    Format: rgb[a]({INTEGER},{INTEGER},{INTEGER}[, {PERCENTAGE}])

    +
  • +
  • +

    Format: rgb[a]({INTEGER}%,{INTEGER}%,{INTEGER}%[, {PERCENTAGE}])

    +
  • +
  • +

    Format: hsl[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])

    +
  • +
  • +

    Format: hwb[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}])

    +
  • +
  • +

    Format: cmyk( {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE} [, + {PERCENTAGE} ])

    +
  • +
  • +

    Format: {named-color} [ / {PERCENTAGE} ]

    +
  • +
+

The white-space format proposed in CSS4 is also supported.

+

The different values are:

+
    +
  • +

    {HEX} is a hexadecimal number ('0-9a-f' case insensitive).

    +
  • +
  • +

    {INTEGER} value can be between 0 and 255 or 0-100 when representing + percentage.

    +
  • +
  • +

    {ANGLE} is the angle on the color wheel, can be in deg, rad, grad + or turn. When no unit is specified, degrees is assumed.

    +
  • +
  • +

    {PERCENTAGE} can be between 0-1.0, or 0%-100%

    +
  • +
  • +

    {named-color} is one of the following colors:

    +

    AliceBlue, AntiqueWhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black, +BlanchedAlmond, Blue, BlueViolet, Brown, BurlyWood, CadetBlue, Chartreuse, +Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, +DarkCyan, DarkGoldenRod, DarkGray, DarkGrey, DarkGreen, DarkKhaki, +DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, DarkSalmon, +DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkSlateGrey, DarkTurquoise, +DarkViolet, DeepPink, DeepSkyBlue, DimGray, DimGrey, DodgerBlue, FireBrick, +FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, GoldenRod, +Gray, Grey, Green, GreenYellow, HoneyDew, HotPink, IndianRed, Indigo, +Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, LemonChiffon, LightBlue, +LightCoral, LightCyan, LightGoldenRodYellow, LightGray, LightGrey, +LightGreen, LightPink, LightSalmon, LightSeaGreen, LightSkyBlue, +LightSlateGray, LightSlateGrey, LightSteelBlue, LightYellow, Lime, +LimeGreen, Linen, Magenta, Maroon, MediumAquaMarine, MediumBlue, +MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, +MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, +MintCream, MistyRose, Moccasin, NavajoWhite, Navy, OldLace, Olive, +OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenRod, PaleGreen, +PaleTurquoise, PaleVioletRed, PapayaWhip, PeachPuff, Peru, Pink, Plum, +PowderBlue, Purple, RebeccaPurple, Red, RosyBrown, RoyalBlue, SaddleBrown, +Salmon, SandyBrown, SeaGreen, SeaShell, Sienna, Silver, SkyBlue, SlateBlue, +SlateGray, SlateGrey, Snow, SpringGreen, SteelBlue, Tan, Teal, Thistle, +Tomato, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, +YellowGreen,transparent

    +
  • +
+

For example:

+
background-color: #FF0000;
+border-color: rgba(0,0,1, 0.5);
+text-color: SeaGreen;
+
+

or

+
background-color: transparent;
+text-color: Black;
+
+

Text style

+
    +
  • Format: (bold|italic|underline|strikethrough|none)
  • +
+

Text style indicates how the highlighted text is emphasized. None indicates +that no emphasis should be applied.

+
    +
  • bold: make the text thicker then the surrounding text.
  • +
  • italic: put the highlighted text in script type (slanted).
  • +
  • underline: put a line under the text.
  • +
  • strikethrough: put a line through the text.
  • +
+

The following options are available on pango 1.50.0 and up:

+
    +
  • uppercase: Uppercase the text.
  • +
  • lowercase: Lowercase the text.
  • +
+

The following option is disabled as pango crashes on this if there is eel +upsizing or wrapping. This will be re-enabled once fixed:

+
    +
  • capitalize: Capitalize the text.
  • +
+

Line style

+
    +
  • Format: (dash|solid)
  • +
+

Indicates how a line should be drawn. +It currently supports: +- dash: a dashed line, where the gap is the same width as the dash +- solid: a solid line

+

Distance

+
    +
  • Format: {Integer}px
  • +
  • Format: {Real}em
  • +
  • Format: {Real}ch
  • +
  • Format: {Real}%
  • +
  • Format: {Real}mm
  • +
+

A distance can be specified in 3 different units:

+
    +
  • px: Screen pixels.
  • +
  • em: Relative to text height.
  • +
  • ch: Relative to width of a single number.
  • +
  • mm: Actual size in millimeters (based on dpi).
  • +
  • %: Percentage of the monitor size.
  • +
+

Distances used in the horizontal direction use the monitor width. Distances in +the vertical direction use the monitor height. +For example:

+
   padding: 10%;
+
+

On a full-HD (1920x1080) monitor, it defines a padding of 192 pixels on the left +and right side and 108 pixels on the top and bottom.

+

Calculating sizes

+

Rofi supports some maths in calculating sizes. For this it uses the CSS syntax:

+
width: calc( 100% - 37px );
+
+
width: calc( 20% min 512 );
+
+

It supports the following operations:

+
    +
  • + : Add
  • +
  • - : Subtract
  • +
  • / : Divide
  • +
  • - : Multiply
  • +
  • modulo : Modulo
  • +
  • min : Minimum of lvalue or rvalue;
  • +
  • max : Maximum of lvalue or rvalue;
  • +
  • floor : Round down lvalue to the next multiple of rvalue
  • +
  • ceil : Round up lvalue to the next multiple of rvalue
  • +
  • round : Round lvalue to the next multiple of rvalue
  • +
+

It uses the C precedence ordering.

+

Padding

+
    +
  • Format: {Integer}
  • +
  • Format: {Distance}
  • +
  • Format: {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance}
  • +
  • Format: {Distance} {Distance} {Distance} {Distance}
  • +
+

If no unit is specified, pixels are assumed.

+

The different number of fields in the formats are parsed like:

+
    +
  • 1 field: all
  • +
  • 2 fields: top&bottom left&right
  • +
  • 3 fields: top, left&right, bottom
  • +
  • 4 fields: top, right, bottom, left
  • +
+

Border

+
    +
  • +

    Format: {Integer}

    +
  • +
  • +

    Format: {Distance}

    +
  • +
  • +

    Format: {Distance} {Distance}

    +
  • +
  • +

    Format: {Distance} {Distance} {Distance}

    +
  • +
  • +

    Format: {Distance} {Distance} {Distance} {Distance}

    +
  • +
  • +

    Format: {Distance} {Line style}

    +
  • +
  • +

    Format: {Distance} {Line style} {Distance} {Line style}

    +
  • +
  • +

    Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line + style}

    +
  • +
  • +

    Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line + style} {Distance} {Line style}

    +
  • +
+

Borders are identical to padding, except that each distance field has a line +style property.

+
+

When no unit is specified, pixels are assumed.

+
+

Position

+

Indicate a place on the window/monitor.

+
┌─────────────┬─────────────┬─────────────┐
+│ north west  │    north    │  north east │
+├─────────────┼─────────────┼─────────────┤
+│   west      │   center    │     east    │
+├─────────────┼─────────────┼─────────────┤
+│ south west  │    south    │  south east │
+└─────────────┴─────────────┴─────────────┘
+
+
    +
  • Format: (center|east|north|west|south|north east|north west|south west|south + east)
  • +
+

Visibility

+

It is possible to hide widgets:

+
inputbar {
+    enabled: false;
+}
+
+

Reference

+
    +
  • Format: @{PROPERTY NAME}
  • +
+

A reference can point to another reference. Currently, the maximum number of +redirects is 20. A property always refers to another property. It cannot be +used for a subpart of the property. For example, this is not valid:

+
highlight: bold @pink;
+
+

But this is:

+
* {
+    myhigh: bold #FAA;
+}
+
+window {
+    highlight: @myhigh;
+}
+
+
    +
  • Format: var(PROPERTY NAME, DEFAULT)
  • +
+

A reference can point to another reference. Currently, the maximum number of +redirects is 20. A property always refers to another property. It cannot be +used for a subpart of the property.

+

Example:

+
window {
+    width: var( width, 30%);
+}
+
+

If the property width is set globally (*{}) that value is used, if the +property width is not set, the default value is used.

+

Orientation

+
    +
  • Format: (horizontal|vertical)
  • +
+

Specify the orientation of the widget.

+

Cursor

+
    +
  • Format: (default|pointer|text)
  • +
+

Specify the type of mouse cursor that is set when the mouse pointer is over the +widget.

+

List of keywords

+
    +
  • Format: [ keyword, keyword ]
  • +
+

A list starts with a '[' and ends with a ']'. The entries in the list are +comma-separated. The keyword in the list refers to an widget name.

+

List of values

+
    +
  • Format: [ value, value, ... ]
  • +
+

An list starts with a '[' and ends with a ']'. The entries in the list are +comma-separated.

+

Environment variable

+
    +
  • Format: ${:alnum:}
  • +
+

This will parse the environment variable as the property value. (that then can +be any of the above types). The environment variable should be an alphanumeric +string without white-space.

+
* {
+    background-color: ${BG};
+}
+
+
    +
  • Format: env(ENVIRONMENT, default)
  • +
+

This will parse the environment variable as the property value. (that then can +be any of the above types). The environment variable should be an alphanumeric +string without white-space. If the environment value is not found, the default +value is used.

+
window {
+    width: env(WIDTH, 40%);
+}
+
+

If environment WIDTH is set, then that value is parsed, otherwise the default +value (40%).

+

Inherit

+
    +
  • Format: inherit
  • +
+

Inherits the property from its parent widget.

+
mainbox {
+    border-color: inherit;
+}
+
+

Elements paths

+

Element paths exists of two parts, the first part refers to the actual widget +by name. Some widgets have an extra state.

+

For example:

+
element selected {
+}
+
+

Here element selected is the name of the widget, selected is the state of +the widget.

+

The difference between dots and spaces is purely cosmetic. These are all the +same:

+
element .selected {
+
+element.selected {
+}
+element selected {
+}
+
+

Supported element paths

+

Base widgets

+

The default widgets available in rofi and the default hierarchic:

+
    +
  • window
  • +
  • +

    overlay: the overlay widget.

    +
  • +
  • +

    mainbox: The mainbox box.

    +
  • +
  • +

    inputbar: The input bar box.

    +
      +
    • +

      box: the horizontal @box packing the widgets

      +
        +
      • +

        case-indicator: the case/sort indicator @textbox

        +
      • +
      • +

        prompt: the prompt @textbox

        +
      • +
      • +

        entry: the main entry @textbox

        +
      • +
      • +

        num-rows: Shows the total number of rows.

        +
      • +
      • +

        num-filtered-rows: Shows the total number of rows after + filtering.

        +
      • +
      • +

        textbox-current-entry: Shows the text of the currently selected + entry.

        +
      • +
      • +

        icon-current-entry: Shows the icon of the currently selected + entry.

        +
      • +
      +
    • +
    +
  • +
  • +

    listview: The listview.

    +
      +
    • +

      scrollbar: the listview scrollbar

      +
    • +
    • +

      element: a box in the listview holding the entries

      +
        +
      • +

        element-icon: the widget in the listview's entry showing the + (optional) icon

        +
      • +
      • +

        element-index: the widget in the listview's entry + keybindable index (1,2,3..0)

        +
      • +
      • +

        element-text: the widget in the listview's entry showing the + text.

        +
      • +
      +
    • +
    +
  • +
  • +

    mode-switcher: the main horizontal @box packing the buttons.

    +
      +
    • button: the buttons @textbox for each mode
    • +
    +
  • +
  • +

    message: The container holding the textbox.

    +
      +
    • textbox: the message textbox
    • +
    +
  • +
+

Note that these path names match the default theme. Themes that provide a +custom layout will have different elements, and structure.

+

State

+

State: State of widget

+

Optional flag(s) indicating state of the widget, used for theming.

+

These are appended after the name or class of the widget.

+

Example

+
button selected.normal { }
+
+element selected.urgent { }
+
+

Currently only the entrybox and scrollbar have states:

+

Entrybox

+
{visible modifier}.{state}
+
+

Where visible modifier can be: +- normal: no modification +- selected: the entry is selected/highlighted by user +- alternate: the entry is at an alternating row (uneven row)

+

Where state is: +- normal: no modification +- urgent: this entry is marked urgent +- active: this entry is marked active

+

These can be mixed.

+

Example:

+
nametotextbox selected.active {
+    background-color: #003642;
+    text-color: #008ed4;
+}
+
+

Sets all selected textboxes marked active to the given text and background +color. Note that a state modifies the original element, it therefore contains +all the properties of that element.

+

Scrollbar

+

The scrollbar uses the handle state when drawing the small scrollbar handle. +This allows the colors used for drawing the handle to be set independently.

+

Widget properties

+

The following properties are currently supported:

+

all widgets

+
    +
  • +

    enabled: enable/disable rendering of the widget

    +
  • +
  • +

    padding: padding + Padding on the inside of the widget

    +
  • +
  • +

    margin: padding + Margin on the outside of the widget

    +
  • +
  • +

    border: border + Border around the widget (between padding and margin)/

    +
  • +
  • +

    border-radius: padding + Sets a radius on the corners of the borders.

    +
  • +
  • +

    background-color: color + Background color

    +
  • +
  • +

    background-image: image + Background image

    +
  • +
  • +

    border-color: color + Color of the border

    +
  • +
  • +

    cursor: cursor + Type of mouse cursor that is set when the mouse pointer is hovered over the + widget.

    +
  • +
+

window

+
    +
  • +

    font: string + The font used in the window

    +
  • +
  • +

    transparency: string + Indicating if transparency should be used and what type:

    +
      +
    • real - True transparency. Only works with a compositor.
    • +
    • background - Take a screenshot of the background image and use that.
    • +
    • screenshot - Take a screenshot of the screen and use that.
    • +
    • Path to png file - Use an image.
    • +
    +
  • +
  • +

    location: position + The place of the anchor on the monitor

    +
  • +
  • +

    anchor: anchor + The anchor position on the window

    +
  • +
  • +

    fullscreen: boolean Window is fullscreen.

    +
  • +
  • +

    width: distance The width of the window

    +
  • +
  • +

    x-offset: distance

    +
  • +
  • +

    y-offset: distance The offset of the window to the anchor point, + allowing you to push the window left/right/up/down

    +
  • +
+

scrollbar Properties

+
    +
  • background-color: color
  • +
  • handle-width: distance
  • +
  • handle-color: color
  • +
  • border-color: color
  • +
+

box

+
    +
  • orientation: orientation Set the direction the elements are packed.
  • +
  • spacing: distance Distance between the packed elements.
  • +
+

textbox

+
    +
  • +

    background-color: color

    +
  • +
  • +

    border-color: the color used for the border around the widget.

    +
  • +
  • +

    font: the font used by this textbox (string).

    +
  • +
  • +

    str/content: the string to display by this textbox (string).

    +
  • +
  • +

    vertical-align: Vertical alignment of the text. A number between 0 + (top) and 1 (bottom).

    +
  • +
  • +

    horizontal-align: Horizontal alignment of the text. A number between 0 + (left) and 1 (right).

    +
  • +
  • +

    text-color: the text color to use.

    +
  • +
  • +

    text-transform: text style {color} for the whole text.

    +
  • +
  • +

    highlight: text style {color}. color is optional, multiple + highlight styles can be added like: bold underline italic #000000; This + option is only available on the element-text widget.

    +
  • +
  • +

    width: override the desired width for the textbox.

    +
  • +
  • +

    content: Set the displayed text (String).

    +
  • +
  • +

    placeholder: Set the displayed text (String) when nothing is + entered.

    +
  • +
  • +

    placeholder-markup: If true, placeholder text supports pango + markup for stylizing.

    +
  • +
  • +

    placeholder-color: Color of the placeholder text.

    +
  • +
  • +

    blink: Enable/Disable blinking on an input textbox + (Boolean).

    +
  • +
  • +

    markup: Force markup on, beware that only valid pango markup + strings are shown.

    +
  • +
  • +

    tab-stops: array of distances. Set the location of tab stops by + their distance from the beginning of the line. Each distance should be + greater than the previous one. The text appears to the right of the tab + stop position (other alignments are not supported yet).

    +
  • +
  • +

    cursor-width: The width of the cursor.

    +
  • +
  • +

    cursor-color: The color used to draw the cursor.

    +
  • +
  • +

    cursor-outline: Enable a border (outline) around the cursor. + (Boolean)

    +
  • +
  • +

    cursor-outline-width: The width of the border around the cursor. + (Double)

    +
  • +
  • +

    cursor-outline-color: The color to use for the cursor outline. + (Color)

    +
  • +
  • +

    text-outline: Enable a border (outline) around the text. (Boolean)

    +
  • +
  • +

    text-outline-width: The width of the border around the text. (Double)

    +
  • +
  • +

    text-outline-color: The color to use for the text outline. (Color)

    +
  • +
+

listview

+
    +
  • +

    columns: integer Number of columns to show (at least 1)

    +
  • +
  • +

    fixed-height: boolean Always show lines rows, even if fewer + elements are available.

    +
  • +
  • +

    dynamic: boolean True if the size should change when filtering + the list, False if it should keep the original height.

    +
  • +
  • +

    scrollbar: boolean If the scrollbar should be enabled/disabled.

    +
  • +
  • +

    scrollbar-width: distance Width of the scrollbar

    +
  • +
  • +

    cycle: boolean When navigating, it should wrap around

    +
  • +
  • +

    spacing: distance Spacing between the elements (both vertical + and horizontal)

    +
  • +
  • +

    lines: integer Number of rows to show in the list view.

    +
  • +
  • +

    layout: orientation Indicate how elements are stacked. + Horizontal implements the dmenu style.

    +
  • +
  • +

    reverse: boolean Reverse the ordering (top down to bottom up).

    +
  • +
  • +

    flow: orientation The order the elements are layed out. + Vertical is the original 'column' view.

    +
  • +
  • +

    fixed-columns: boolean Do not reduce the number of columns shown when + number of visible elements is not enough to fill them all.

    +
  • +
  • +

    require-input: boolean Listview requires user input to be unhidden. + The list is still present and hitting accept will activate the first entry.

    +
  • +
+

Listview widget

+

The listview widget is special container widget. +It has the following fixed children widgets:

+
    +
  • +

    0 or more element widgets of the type box.

    +
  • +
  • +

    An optional scrollbar widget. This can be enabled using the scrollbar + property.

    +
  • +
+

These cannot be changed using the children property.

+

Each Entry displayed by listview is captured by a box called element. +An element widget can contain the following special child widgets:

+
    +
  • element-icon: An icon widget showing the icon associated to the entry.
  • +
  • element-text: A textbox widget showing the text associated to the entry.
  • +
  • element-index: A textbox widget that shows the shortcut keybinding number.
  • +
+

By default the element-icon and element-text child widgets are added to the +element. This can be modified using the children property or the +[no]-show-icons option.

+

A child added with another name is treated the same as the special widget +described in the advanced layout section.

+

listview text highlight

+

The element-text widget in the listview is the one used to show the text. +On this widget set the highlight property (only place this property is used) +to change the style of highlighting. The highlight property consist of the +text-style property and a color.

+

To disable highlighting:

+
  element-text {
+    highlight: None;
+  }
+
+

To set to red underlined:

+
  element-text {
+    highlight: underline red;
+  }
+
+

Layout

+

The new format allows the layout of the rofi window to be tweaked +extensively. For each widget, the themer can specify padding, margin, border, +font, and more. It even allows, as an advanced feature, to pack widgets in a +custom structure.

+

Basic layout structure

+

The whole view is made out of boxes that pack other boxes or widgets. +The box can be vertical or horizontal. This is loosely inspired by GTK.

+

The current layout of rofi is structured as follows:

+
┌────────────────────────────────────────────────────────────────────────────────────┐
+│ window {BOX:vertical}                                                              │
+│ ┌───────────────────────────────────────────────────────────────────────────────┐  │
+│ │ mainbox  {BOX:vertical}                                                       │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │ inputbar {BOX:horizontal}                                                 │ │  │
+│ │ │ ┌─────────┐ ┌─┐ ┌───────────────────────────────┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ │ │  │
+│ │ │ │ prompt  │ │:│ │ entry                         │ │#fr│ │ / │ │#ns│ │ci │ │ │  │
+│ │ │ └─────────┘ └─┘ └───────────────────────────────┘ └───┘ └───┘ └───┘ └───┘ │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ │                                                                               │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │ message                                                                   │ │  │
+│ │ │ ┌───────────────────────────────────────────────────────────────────────┐ │ │  │
+│ │ │ │ textbox                                                               │ │ │  │
+│ │ │ └───────────────────────────────────────────────────────────────────────┘ │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ │                                                                               │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │ listview                                                                  │ │  │
+│ │ │ ┌─────────────────────────────────────────────────────────────────────┐   │ │  │
+│ │ │ │ element                                                             │   │ │  │
+│ │ │ │ ┌─────────────────┐ ┌─────────────────────────────────────────────┐ │   │ │  │
+│ │ │ │ │element─icon     │ │element─text                                 │ │   │ │  │
+│ │ │ │ └─────────────────┘ └─────────────────────────────────────────────┘ │   │ │  │
+│ │ │ └─────────────────────────────────────────────────────────────────────┘   │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ │                                                                               │  │
+│ │ ┌───────────────────────────────────────────────────────────────────────────┐ │  │
+│ │ │  mode─switcher {BOX:horizontal}                                           │ │  │
+│ │ │ ┌───────────────┐   ┌───────────────┐  ┌──────────────┐ ┌───────────────┐ │ │  │
+│ │ │ │ Button        │   │ Button        │  │ Button       │ │ Button        │ │ │  │
+│ │ │ └───────────────┘   └───────────────┘  └──────────────┘ └───────────────┘ │ │  │
+│ │ └───────────────────────────────────────────────────────────────────────────┘ │  │
+│ └───────────────────────────────────────────────────────────────────────────────┘  │
+└────────────────────────────────────────────────────────────────────────────────────┘
+
+
+
+
+
    +
  • ci is the case-indicator
  • +
  • fr is the num-filtered-rows
  • +
  • ns is the num-rows
  • +
+
+

Error message structure

+
┌──────────────────────────────────────────────────────────────────────────────────┐
+│ window {BOX:vertical}                                                            │
+│ ┌─────────────────────────────────────────────────────────────────────────────┐  │
+│ │ error─message {BOX:vertical}                                                │  │
+│ │ ┌────────────────────────────────────────────────────────────────────────┐  │  │
+│ │ │ textbox                                                                │  │  │
+│ │ └────────────────────────────────────────────────────────────────────────┘  │  │
+│ └─────────────────────────────────────────────────────────────────────────────┘  │
+└──────────────────────────────────────────────────────────────────────────────────┘
+
+
+

Advanced layout

+

The layout of rofi can be tweaked by packing the 'fixed' widgets in a +custom structure.

+

The following widgets are fixed, as they provide core rofi functionality:

+
    +
  • prompt
  • +
  • entry
  • +
  • overlay
  • +
  • case-indicator
  • +
  • message
  • +
  • listview
  • +
  • mode-switcher
  • +
  • num-rows
  • +
  • num-filtered-rows
  • +
+

The following keywords are defined and can be used to automatically pack a +subset of the widgets. These are used in the default theme as depicted in the +figure above.

+
    +
  • mainbox Packs: inputbar, message, listview, mode-switcher
  • +
  • inputbar Packs: prompt,entry,case-indicator
  • +
+

Any widget name starting with textbox is a textbox widget, others are box +widgets and can pack other widgets.

+

There are several special widgets that can be used by prefixing the name of the +widget:

+

Textbox widget

+

This is a read-only textbox widget. The displayed string can be set with content.

+

Example:

+
textbox-custom {
+  expand: false;
+  content: "My Message";
+}
+
+

Icon

+

This is an icon widget. The displayed icon can be set with filename and size +with size. If the property action is set, it acts as a button. action can +be set to a keybinding name and completes that action. (see rofi -show keys for +a list).

+

If the squared property is set to false the widget height and width are +not forced to be equal.

+

Example:

+
icon-paste {
+    expand: false;
+    filename: "gtk-paste";
+    size: 24;
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

button

+

This is a textbox widget that can have a 'clickable' action. The action can +be set to: keybinding: accepts a keybinding name and completes that action. +(see rofi -show keys for a list).

+
button-paste {
+    expand: false;
+    content: "My Clickable Message";
+    vertical-align: 0.5;
+    action: "kb-primary-paste";
+}
+
+

Children

+

To specify children, set the children +property (this always happens on the box child, see example below):

+
inputbar {
+  children: [prompt,entry,overlay,case-indicator];
+}
+
+

The theme needs to be updated to match the hierarchy specified.

+

Below is an example of a theme emulating dmenu:

+
* {
+    background-color:      Black;
+    text-color:            White;
+    border-color:          White;
+    font:            "Times New Roman 12";
+}
+
+window {
+    anchor:     north;
+    location:   north;
+    width:      100%;
+    padding:    4px;
+    children:   [ horibox ];
+}
+
+horibox {
+    orientation: horizontal;
+    children:   [ prompt, entry, listview ];
+}
+
+listview {
+    layout:     horizontal;
+    spacing:    5px;
+    lines:      10;
+}
+
+entry {
+    expand:     false;
+    width:      10em;
+}
+
+element {
+    padding: 0px 2px;
+}
+element selected {
+    background-color: SteelBlue;
+}
+
+

Padding and margin

+

Just like CSS, rofi uses the box model for each widget.

+
┌──────────────────────────────────────────────────────────────────┐
+│ margin                                                           │
+│  ┌────────────────────────────────────────────────────────────┐  │
+│  │ border                                                     │  │
+│  │ ┌────────────────────────────────────────────────────────┐ │  │
+│  │ │ padding                                                │ │  │
+│  │ │ ┌────────────────────────────────────────────────────┐ │ │  │
+│  │ │ │ content                                            │ │ │  │
+│  │ │ └────────────────────────────────────────────────────┘ │ │  │
+│  │ └────────────────────────────────────────────────────────┘ │  │
+│  └────────────────────────────────────────────────────────────┘  │
+└──────────────────────────────────────────────────────────────────┘
+
+

Explanation of the different parts:

+
    +
  • +

    Content - The content of the widget.

    +
  • +
  • +

    Padding - Clears an area around the widget. The padding shows the + background color of the widget.

    +
  • +
  • +

    Border - A border that goes around the padding and content. The border use + the border-color of the widget.

    +
  • +
  • +

    Margin - Clears an area outside the border. The margin is transparent.

    +
  • +
+

The box model allows us to add a border around elements, and to define space +between elements.

+

The size of each margin, border, and padding can be set. +For the border, a linestyle and radius can be set.

+

Spacing

+

Widgets that can pack more then one child widget (currently box and listview) +have the spacing property. This property sets the distance between the packed +widgets (both horizontally and vertically).

+
┌───────────────────────────────────────┐
+│ ┌────────┐ s ┌────────┐ s ┌────────┐  │
+│ │ child  │ p │ child  │ p │ child  │  │
+│ │        │ a │        │ a │        │  │
+│ │        │ c │        │ c │        │  │
+│ │        │ i │        │ i │        │  │
+│ │        │ n │        │ n │        │  │
+│ └────────┘ g └────────┘ g └────────┘  │
+└───────────────────────────────────────┘
+
+

Advanced box packing

+

More dynamic spacing can be achieved by adding dummy widgets, for example to +make one widget centered:

+
┌────────────────────────────────────────────────────┐
+│  ┌───────────────┐  ┌────────┐  ┌───────────────┐  │
+│  │ dummy         │  │ child  │  │ dummy         │  │
+│  │ expand: true; │  │        │  │ expand: true; │  │
+│  │               │  │        │  │               │  │
+│  │               │  │        │  │               │  │
+│  │               │  │        │  │               │  │
+│  └───────────────┘  └────────┘  └───────────────┘  │
+└────────────────────────────────────────────────────┘
+
+

If both dummy widgets are set to expand, child will be centered. Depending on +the expand flag of child the remaining space will be equally divided between +both dummy and child widget (expand enabled), or both dummy widgets (expand +disabled).

+

Debugging

+

To get debug information from the parser, run rofi like:

+
G_MESSAGES_DEBUG=Parser rofi -show run
+
+

Syntax errors are shown in a popup and printed out to command line with the +above command.

+

To see the elements queried during running, run:

+
G_MESSAGES_DEBUG=Theme rofi -show run
+
+

To test minor changes, part of the theme can be passed on the command line, for +example to set it to full-screen:

+
rofi -theme-str 'window { fullscreen:true;}' -show run
+
+

Another syntax to modify theme properties is:

+
rofi -theme+window+fullscreen true -show run
+
+

To print the current theme, run:

+
rofi -dump-theme
+
+

Media support

+

Parts of the theme can be conditionally loaded, like the CSS @media option.

+
@media ( min-width: 120 ) {
+
+}
+
+

It supports the following keys as constraint:

+
    +
  • min-width: load when width is bigger or equal then value.
  • +
  • max-width: load when width is smaller then value.
  • +
  • min-height: load when height is bigger or equal then value.
  • +
  • max-height: load when height is smaller then value.
  • +
  • min-aspect-ratio load when aspect ratio is over value.
  • +
  • max-aspect-ratio: load when aspect ratio is under value.
  • +
  • monitor-id: The monitor id, see rofi -help for id's.
  • +
  • enabled: Boolean option to enable. Supports environment variable + or DMENU to detect if in dmenu mode.
  • +
+

@media takes an integer number or a fraction, for integer number px can be +added.

+
@media ( min-width: 120 px ) {
+
+}
+
+
@media ( enabled: env(DO_LIGHT, false )) {
+
+}
+
+
@media ( enabled: DMENU) {
+
+}
+
+

Conflicting constraints

+

It is possible to define conflicting constraints in the theme. These conflicts +are not explicitly reported. The most common example is forcing a specific +window size, for example by enabling full-screen mode, having number of lines +set in the listview and having the listview expand to available space. There is +clearly a conflict in these 3 constraints. In this case, listview will not +limit to the number of lines, but tries to fill the available space. It is up +to the theme designer to make sure the theme handles this correctly.

+

Font Parsing

+

Rofi uses pango for font rendering. The font should +be specified in a format that pango understands. This normally is the font name +followed by the font size. For example:

+
mono 18
+
+

Or

+
FontAwesome 22
+
+

From the pango manpage:

+

The string must have the form

+
\[FAMILY-LIST] \[STYLE-OPTIONS] \[SIZE] \[VARIATIONS]
+
+

where FAMILY-LIST is a comma-separated list of families optionally terminated +by a comma, STYLE_OPTIONS is a whitespace-separated list of words where each +word describes one of style, variant, weight, stretch, or gravity, and SIZE is +a decimal number (size in points) or optionally followed by the unit modifier +“px” for absolute size. VARIATIONS is a comma-separated list of font variation +specifications of the form “axis=value” (the = sign is optional).

+

The following words are understood as styles: "Normal”, “Roman”, “Oblique”, +“Italic”.

+

The following words are understood as variants: “Small-Caps”, “All-Small-Caps”, +“Petite-Caps”, “All-Petite-Caps”, “Unicase”, “Title-Caps”.

+

The following words are understood as weights: “Thin”, “Ultra-Light”, +“Extra-Light”, “Light”, “Semi-Light”, “Demi-Light”, “Book”, “Regular”, +“Medium”, “Semi-Bold”, “Demi-Bold”, “Bold”, “Ultra-Bold”, “Extra-Bold”, +“Heavy”, “Black”, “Ultra-Black”, “Extra-Black”.

+

The following words are understood as stretch values: “Ultra-Condensed”, +“Extra-Condensed”, “Condensed”, “Semi-Condensed”, “Semi-Expanded”, “Expanded”, +“Extra-Expanded”, “Ultra-Expanded”.

+

The following words are understood as gravity values: “Not-Rotated”, “South”, +“Upside-Down”, “North”, “Rotated-Left”, “East”, “Rotated-Right”, “West”.

+

Any one of the options may be absent. If FAMILY-LIST is absent, then the +family_name field of the resulting font description will be initialized to +NULL. If STYLE-OPTIONS is missing, then all style options will be set to the +default values. If SIZE is missing, the size in the resulting font description +will be set to 0.

+

A typical example:

+

"Cantarell Italic Light 15 `wght`=200"

+

Icon Handling

+

Rofi supports 3 ways of specifying an icon:

+
    +
  • Filename
  • +
  • icon-name, this is looked up via the icon-theme.
  • +
  • Markup String. It renders a string as an icon.
  • +
+

For the first two options, GdkPixbuf is used to open and render the icons. +This in general gives support for most required image formats. +For the string option it uses Pango to render the string. The string needs to +start with a <span tag, that allows you to set color and font.

+

Markup string:

+
echo -en "testing\0icon\x1f<span color='red'>⏻</span>" | ./rofi -dmenu
+
+

Getting supported icon formats:

+
G_MESSAGES_DEBUG=Helpers.IconFetcher rofi
+
+

This uses the debug framework and prints out a list of supported image file +extensions.

+

Multiple file handling

+

The rasi file format offers two methods of including other files. This can be +used to modify existing themes, or have multiple variations on a theme.

+
    +
  • import: Import and parse a second file.
  • +
  • theme: Discard theme, and load file as a fresh theme.
  • +
+

Syntax:

+
@import "myfile"
+@theme "mytheme"
+
+

The specified file can either by name, filename,full path.

+

If a filename is provided, it will try to resolve it in the following order:

+
    +
  • If path is absolute and file exists, it will open the file. This includes expansion of '~' or '~user'
  • +
  • On an @import or @theme it looks in the directory of the file that tried to include it.
  • +
  • ${XDG_CONFIG_HOME}/rofi/themes/
  • +
  • ${XDG_CONFIG_HOME}/rofi/
  • +
  • ${XDG_DATA_HOME}/rofi/themes/
  • +
  • ${INSTALL PREFIX}/share/rofi/themes/
  • +
+

A name is resolved (if it has no valid extension) as a filename by appending the .rasi extension.

+

Examples

+

Several examples are installed together with rofi. These can be found in +{datadir}/rofi/themes/, where {datadir} is the install path of rofi +data. When installed using a package manager, this is usually: /usr/share/.

+

SEE ALSO

+

rofi(1), rofi-script(5), rofi-theme-selector(1)

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/current/rofi.1/index.html b/current/rofi.1/index.html new file mode 100644 index 00000000..9ffc66df --- /dev/null +++ b/current/rofi.1/index.html @@ -0,0 +1,2787 @@ + + + + + + + + + + + + + + + + + + + + + + Rofi - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

rofi(1)

+

NAME

+

rofi - A window switcher, application launcher, ssh dialog, dmenu +replacement and more

+

SYNOPSIS

+

rofi [ -show mode ]|[ -dmenu ]|[ -e msg ] [ CONFIGURATION ]

+

DESCRIPTION

+

rofi is an X11 pop-up window switcher, run dialog, dmenu replacement, and +more. It focuses on being fast to use and have minimal distraction. It supports +keyboard and mouse navigation, type to filter, tokenized search and more.

+

USAGE

+

rofi's main functionality is to assist in your workflow, allowing you to +quickly switch between windows, start applications or log into a remote machine +via ssh. There are different modes for different types of actions. rofi +is a standalone application and should not be integrated into scripts. For +integration into scripts it has a special mode that functions as a (drop-in) +replacement for dmenu(1). See emulating dmenu below.

+

Running rofi

+

To launch rofi directly in a certain mode, specify a mode with rofi -show +<mode>. To show the drun dialog:

+
    rofi -show drun
+
+

A useful setup in minimalistic window managers is to combine drun, run +with window mode:

+
  rofi -show combi -modes combi -combi-modes "window,drun,run"
+
+

In this setup it first list all open applications, then all installed +applications. So if you type firefox and hit return, it will switch to the +running firefox, or launch it when it is not running.

+

Emulating dmenu

+

rofi can emulate dmenu(1) (a dynamic menu for X11) when launched with +the -dmenu flag.

+

For more information see rofi-dmenu(5).

+

Display Error message

+

rofi error dialog can also be called from the command line.

+
    rofi -e "my message"
+
+

Markup support can be enabled, see CONFIGURATION options.

+

CONFIGURATION

+

There are currently three methods of setting configuration options (evaluated +in order below):

+
    +
  • +

    System configuration file (for example /etc/rofi.rasi). It first checks + XDG_CONFIG_DIRS, and then SYSCONFDIR (that is passed at compile time). + It loads the first config file it finds, it does not merge multiple system + configuration files.

    +
  • +
  • +

    Rasi theme file: The new theme format can be used to set configuration + values.

    +
  • +
  • +

    Command-line options: Arguments passed to rofi.

    +
  • +
+

To get a template config file, run: rofi -dump-config > config.rasi

+

This will contain (commented) all current configuration options, modified +options are uncommented.

+

To get a template config file that sets the icon-theme run: rofi -icon-theme +hicolor -dump-config.

+

It is strongly recommended to use this as a starting point for your +configuration.

+

An empty configuration section in the config file looks like:

+
configuration {
+ // set config options here
+}
+
+

Most of the configuration options mentioned below (beside options like -show, +-dump-config that apply to a single run) can be set here.

+

For example to set the dpi value to 72:

+
configuration {
+    dpi: 72;
+}
+
+

The configuration system supports the following types:

+
    +
  • string
  • +
  • integer (signed and unsigned)
  • +
  • char
  • +
  • boolean
  • +
  • lists
  • +
+

For the syntax of these options, see the rofi-theme(5) manpage.

+

For use on the command line, Boolean options have a non-default command-line +syntax. Example to enable option X:

+
    -X
+
+

To disable option X:

+
    -no-X
+
+

Below is a list of the most important options:

+

General

+

-help

+

The help option shows the full list of command-line options and the current set +values. These include dynamic (run-time generated) options.

+

-version

+

Show the rofi version and exit.

+

-dump-config

+

Dump the current active configuration, in rasi format, to stdout and exit. +Information about the rasi format can be found in the rofi-theme(5) manpage.

+

-dump-theme

+

Dump the current active theme, in rasi format, to stdout and exit.

+

-rasi-validate filename

+

Try to parse the file and return 0 when successful, non-zero when failed.

+

-list-keybindings

+

List all known keybindings without trying to parse them. This can be used to +look for duplicate bindings.

+

-threads num

+

Specify the number of threads rofi should use:

+
    +
  • 0: Autodetect the number of supported hardware threads.
  • +
  • 1: Disable threading
  • +
  • 2..n: Specify the maximum number of threads to use in the thread pool.
  • +
+

Default: Autodetect

+

-display display

+

The X server to contact. Default is $DISPLAY.

+

-dmenu

+

Run rofi in dmenu mode. This allows for interactive scripts. +In dmenu mode, rofi reads from STDIN, and output to STDOUT. +A simple example, displaying three pre-defined options:

+
    echo -e "Option #1\nOption #2\nOption #3" | rofi -dmenu
+
+

Or get the options from a script:

+
    ~/my_script.sh | rofi -dmenu
+
+

See the rofi-dmenu(5) manpage for more information.

+

-show mode

+

Open rofi in a certain mode. Available modes are window, run, drun, +ssh, combi. The special argument keys can be used to open a searchable +list of supported key bindings +(see the rofi-keys(5) manpage)

+

To show the run-dialog:

+
    rofi -show run
+
+

If -show is the last option passed to rofi, the first enabled modes is shown.

+

-modes mode1,mode2

+

Specify an ordered, comma-separated list of modes to enable. +Enabled modes can be changed at runtime. Default key is Ctrl+Tab. +If no modes are specified, all configured modes will be enabled. +To only show the run and ssh launcher:

+
    rofi -modes "run,ssh" -show run
+
+

Custom modes can be added using the internal script mode. Each such mode has +two parameters:

+
<name>:<script>
+
+

Example: Have a mode called 'Workspaces' using the i3_switch_workspaces.sh +script:

+
    rofi -modes "window,run,ssh,Workspaces:i3_switch_workspaces.sh" -show Workspaces
+
+

Notes: The i3 window manager dislikes commas in the command when specifying an +exec command. For that case, # can be used as a separator.

+

TIP: The name is allowed to contain spaces:

+
    rofi -modes "My File Browser:fb.sh" -show "My File Browser"
+
+

-case-sensitive

+

Start in case-sensitive mode. This option can be changed at run-time using the +-kb-toggle-case-sensitivity key binding.

+

-cycle

+

Cycle through the result list. Default is 'true'.

+

-filter filter

+

Filter the list by setting text in input bar to filter

+

-config filename

+

Load an alternative configuration file.

+

-cache-dir filename

+

Directory that is used to place temporary files, like history.

+

-scroll-method method

+

Select the scrolling method. 0: Per page, 1: continuous.

+

-normalize-match

+

Normalize the string before matching, so o will match ö, and é matches +e. This is not a perfect implementation, but works. For now, it disables +highlighting of the matched part.

+

-no-lazy-grab

+

Disables lazy grab, this forces the keyboard being grabbed before gui is shown.

+

-no-plugins

+

Disable plugin loading.

+

-plugin-path directory

+

Specify the directory where rofi should look for plugins.

+

-show-icons

+

Show application icons in drun and window modes.

+

-icon-theme

+

Specify icon theme to be used. If not specified default theme from DE is used, +Adwaita and gnome themes act as fallback themes.

+

-markup

+

Use Pango markup to format output wherever possible.

+

-normal-window

+

Make rofi react like a normal application window. Useful for scripts like +Clerk that are basically an application.

+

-[no-]steal-focus

+

Make rofi steal focus on launch and restore close to window that held it when +launched.

+

-refilter-timeout-limit

+

The time (in ms) boundary filter may take before switch from instant to delayed +filter mode.

+

Default: 300

+

A fallback icon can be specified for each mode:

+
configuration {
+    <mode>{
+      fallback-icon: "<icon name>";
+    }
+}
+
+

Example

+
configuration {
+    run,drun {
+      fallback-icon: "application-x-addon";
+    }
+}
+
+

Matching

+

-matching method

+

Specify the matching algorithm used. +Currently, the following methods are supported:

+
    +
  • normal: match the int string
  • +
  • regex: match a regex input
  • +
  • glob: match a glob pattern
  • +
  • fuzzy: do a fuzzy match
  • +
  • prefix: match prefix
  • +
+

Default: normal

+

Note: glob matching might be slow for larger lists

+

-tokenize

+

Tokenize the input.

+

-drun-categories category1,category2

+

Only show desktop files that are present in the listed categories.

+

-drun-match-fields field1,field2,...

+

When using drun, match only with the specified Desktop entry fields. +The different fields are:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
  • all: all the above
  • +
+

Default: name,generic,exec,categories,keywords

+

-drun-display-format

+

The format string for the drun dialog:

+
    +
  • name: the application's name
  • +
  • generic: the application's generic name
  • +
  • exec: the application's executable
  • +
  • categories: the application's categories
  • +
  • comment: the application comment
  • +
  • url: The url in case of a link type desktop file
  • +
+

Pango markup can be used to formatting the output.

+

Default: {name} [<span weight='light' size='small'><i>({generic})</i></span>]

+

Note: Only fields enabled in -drun-match-fields can be used in the format +string.

+

-[no-]drun-show-actions

+

Show actions present in the Desktop files.

+

Default: false

+

-window-match-fields field1,field2,...

+

When using window mode, match only with the specified fields. +The different fields are:

+
    +
  • title: window's title
  • +
  • class: window's class
  • +
  • role: window's role
  • +
  • name: window's name
  • +
  • desktop: window's current desktop
  • +
  • all: all the above
  • +
+

Default: all

+

-matching-negate-char char

+

Set the character used to negate the query (i.e. if it does not match the +next keyword). Set to '\x0' to disable.

+

Default: '-'

+

Filtered menu sort

+

-[no]-sort

+

Enable, disable sort for filtered menu. +This setting can be changed at runtime (see -kb-toggle-sort).

+

-sorting-method 'method' to specify the sort method.

+

There are 2 methods:

+
    +
  • levenshtein (Default)
  • +
  • fzf
  • +
+

Layout and Theming

+

IMPORTANT: In newer rofi releases, all the theming options have been +moved into the new theme format. They are no longer normal rofi options +that can be passed directly on the command line (there are too many). Small +snippets can be passed on the command line: rofi -theme-str 'window {width: +50%;}' to override a single setting. They are merged into the current theme. +They can also be appended at the end of the rofi config file to override +parts of the theme.

+

Most of the following options are deprecated and should not be used. Please +use the new theme format to customize rofi. More information about the new +format can be found in the rofi-theme(5) manpage.

+

-location

+

Specify where the window should be located. The numbers map to the following +locations on screen:

+
      1 2 3
+      8 0 4
+      7 6 5
+
+

Default: 0

+

-fixed-num-lines

+

Keep a fixed number of visible lines.

+

-sidebar-mode

+

Open in sidebar-mode. In this mode, a list of all enabled modes is shown at the +bottom (See -modes option). To show sidebar, use:

+
    rofi -show run -sidebar-mode 
+
+

-hover-select

+

Automatically select the entry the mouse is hovering over. This option is best +combined with custom mouse bindings. To utilize hover-select and accept an +entry in a single click, use:

+
    rofi -show run -hover-select -me-select-entry '' -me-accept-entry MousePrimary
+
+

-eh number

+

Set row height (in chars) +Default: 1

+

-auto-select

+

When one entry is left, automatically select it.

+

-m num, -m name, -monitor num, -monitor name

+

Select monitor to display rofi on. It accepts as input: primary (if +primary output is set), the xrandr output name, or integer number (in order +of detection). Negative numbers are handled differently:

+
    +
  • +

    -1: the currently focused monitor.

    +
  • +
  • +

    -2: the currently focused window (that is, rofi will be displayed + on top of the focused window).

    +
  • +
  • +

    -3: Position of mouse (overrides the location setting to get normal + context menu behavior.)

    +
  • +
  • +

    -4: the monitor with the focused window.

    +
  • +
  • +

    -5: the monitor that shows the mouse pointer.

    +
  • +
+

Default: -5

+

See rofi -h output for the detected monitors, their position, and size.

+

-theme filename

+

Path to the new theme file format. This overrides the old theme settings.

+

-theme-str string

+

Allow theme parts to be specified on the command line as an override.

+

For example:

+
    rofi -theme-str '#window { fullscreen: true; }'
+
+

This option can be specified multiple times. +This is now the method to tweak the theme via the command line.

+

-dpi number

+

Override the default DPI setting.

+
    +
  • +

    If set to 0, it tries to auto-detect based on X11 screen size (similar to + i3 and GTK).

    +
  • +
  • +

    If set to 1, it tries to auto-detect based on the size of the monitor + that rofi is displayed on (similar to latest Qt 5).

    +
  • +
+

-selected-row selected row

+

Select a certain row.

+

Default: 0

+

PATTERN setting

+

-terminal

+

Specify which terminal to start.

+
    rofi -terminal xterm
+
+

Pattern: {terminal}

+

Default: x-terminal-emulator

+

-ssh-client client

+

Override the used ssh client.

+

Pattern: {ssh-client}

+

Default: ssh

+

SSH settings

+

-ssh-command cmd

+

Set the command to execute when starting an ssh session. +The pattern {host} is replaced by the selected ssh entry.

+

Pattern: {ssh-client}

+

Default: {terminal} -e {ssh-client} {host}

+

-parse-hosts

+

Parse the /etc/hosts file for entries.

+

Default: disabled

+

-[no-]parse-known-hosts

+

Parse the ~/.ssh/known_hosts file for entries.

+

Default: enabled

+

Run settings

+

-run-command cmd

+

Set command ({cmd}) to execute when running an application. +See PATTERN.

+

Default: {cmd}

+

Example to run applications in a dedicated cgroup with systemd. Requires a +shell to escape and interpolate the unit name correctly.

+
"bash -c 'systemd-run --user --unit=app-rofi-\$(systemd-escape {cmd})-\$RANDOM {cmd}'"
+
+

-run-shell-command cmd

+

Set command to execute when running an application in a shell. +See PATTERN.

+

Default: {terminal} -e {cmd}

+

-run-list-command cmd

+

If set, use an external tool to generate a list of executable commands. Uses +run-command.

+

Default: {cmd}

+

Window switcher settings

+

-window-format format

+

Format what is being displayed for windows.

+

format: {field[:len]}

+

field:

+
    +
  • w: desktop name
  • +
  • t: title of window
  • +
  • n: name
  • +
  • r: role
  • +
  • c: class
  • +
+

len: maximum field length (0 for auto-size). If length is negative, the entry +will be unchanged. If length is positive, the entry will be truncated or padded +to fill that length.

+

default: {w} {c} {t}

+

-window-command cmd

+

Set command to execute on selected window for an alt action (-kb-accept-alt). +See PATTERN.

+

Default: "wmctrl -i -R {window}"

+

-window-thumbnail

+

Show window thumbnail (if available) as icon in the window switcher.

+

You can stop rofi from exiting when closing a window (allowing multiple to be +closed in a row).

+
configuration {
+  window {
+      close-on-delete: false;
+  }
+}
+
+

You can hide the currently active window with the 'hide-active-window' setting:

+
configuration {
+  window {
+      hide-active-window: true;
+  }
+}
+
+

or pass -window-hide-active-window true on command line.

+

You can prefer the icon theme above the window set icon with the +'prefer-icon-theme' setting:

+
configuration {
+  window {
+      prefer-icon-theme: true;
+  }
+}
+
+

or pass -window-prefer-icon-theme true on command line.

+

Combi settings

+

-combi-modes mode1,mode2

+

The modes to combine in combi mode. +For syntax to -combi-modes, see -modes. +To get one merge view, of window,run, and ssh:

+
    rofi -show combi -combi-modes "window,run,ssh" -modes combi
+
+

NOTE: The i3 window manager dislikes commas in the command when specifying +an exec command. For that case, # can be used as a separator.

+

-combi-display-format

+

The format string for entries in the combi dialog:

+
    +
  • mode: the mode display name
  • +
  • text: the entry text
  • +
+

Pango markup can be used to formatting the output.

+

Default: {mode} {text}

+

Note: This setting is ignored if combi-hide-mode-prefix is enabled.

+

History

+

-[no-]disable-history

+

Disable or re-enable history

+

-max-history-size number

+

Maximum number of entries to store in history. Defaults to 25. (WARNING: can +cause slowdowns when set too high)

+

Message dialog

+

-e message

+

Pops up a message dialog (used internally for showing errors) with message. +Message can be multi-line.

+

Passing -e - reads (blocking) from standard in and displays this.

+

File browser settings

+

File browser behavior can be controlled via the following options:

+
configuration {
+   filebrowser {
+      /** Directory the file browser starts in. */
+      directory: "/some/directory";
+      /**
+        * Sorting method. Can be set to:
+        *   - "name"
+        *   - "mtime" (modification time)
+        *   - "atime" (access time)
+        *   - "ctime" (change time)
+        */
+      sorting-method: "name";
+      /** Group directories before files. */
+      directories-first: true;
+      /** Show hidden files. */
+      show-hidden: false;
+      /** return 1 on cancel. */
+      cancel-returns-1: true;
+      /** command */
+      command: "xdg-open";
+   }
+}
+
+

These options can also be passed on the commandline, for example:

+
rofi -filebrowser-cancel-returns-1 true -show filebrowser
+
+

The show-hidden can also be triggered with the kb-delete-entry keybinding.

+

Recursive Browser settings

+

Recursive file browser behavior can be controlled via the following options:

+
configuration {
+   recursivebrowser {
+      /** Directory the file browser starts in. */
+      directory: "/some/directory";
+      /** return 1 on cancel. */
+      cancel-returns-1: true;
+      /** filter entries using regex */
+      filter-regex: "(.*cache.*|.*\.o)";
+      /** command */
+      command: "xdg-open";
+   }
+}
+
+

Entry history

+

The number of previous inputs for the entry box can be modified by setting +max-history on the entry box.

+
configuration {
+    entry  {
+        max-history: 30;
+    }
+}
+
+

By default the file is stored in the systems cache directory, in a file called +rofi-entry-history.txt.

+

Other

+

-drun-use-desktop-cache

+

Build and use a cache with the content of desktop files. Usable for systems +with slow hard drives.

+

-drun-reload-desktop-cache

+

If drun-use-desktop-cache is enabled, rebuild a cache with the content of +desktop files.

+

-drun-url-launcher command

+

Command to open a Desktop Entry that is a Link.

+

-pid path

+

Make rofi create a pid file and check this on startup. The pid file +prevents multiple rofi instances from running simultaneously. This is +useful when running rofi from a key-binding daemon.

+

-replace

+

If rofi is already running, based on pid file, try to kill that instance.

+

-display-{mode} string

+

Set the name to use for mode. This is used as prompt and in combi-browser.

+

It is now preferred to use the configuration file:

+
configuration {
+  {mode} {
+    display-name: *string*;
+  }
+}
+
+

-[no-]click-to-exit

+

Click the mouse outside the rofi window to exit.

+

Default: enabled

+

-xserver-i300-workaround

+

Workaround for bug in Xserver. See issue #611 and #1642 on the rofi issue +tracker.

+

Default: disabled

+

PATTERN

+

To launch commands (for example, when using the ssh launcher), the user can +enter the used command-line. The following keys can be used that will be +replaced at runtime:

+
    +
  • {host}: the host to connect to
  • +
  • {terminal}: the configured terminal (see -terminal)
  • +
  • {ssh-client}: the configured ssh client (see -ssh-client)
  • +
  • {cmd}: the command to execute
  • +
  • {window}: the window ID of the selected window (in window-command)
  • +
+

It processes the string as follows: {key} +is replaced by its value, if {key} is not set it is removed. If the {key} +is in between [] all the text between [] is removed if {key} is not set. +Otherwise key is replaced and the [] are removed.

+

For example: {ssh-client} [-p {port}] {host}

+

THEMING

+

Please see rofi-theme(5) manpage for more information on theming.

+

KEY BINDINGS

+

Please see the rofi-keys(5) manpage for the keybindings and how to set them +up.

+

The keybinding can also be used for actions, when the action is executed the +mentioned keystroke is inserted:

+

Timeout

+

You can configure an action to be taken when rofi has not been interacted +with for a certain amount of seconds. You can specify a keybinding to trigger +after X seconds.

+
configuration {
+  timeout {
+      delay:  15;
+      action: "kb-cancel";
+  }
+}
+
+

Input change

+

When the input of the textbox changes:

+
configuration {
+  inputchange {
+      action: "kb-row-first";
+  }
+}
+
+

Available Modes

+

window

+

Show a list of all the windows and allow switching between them. Pressing the +delete-entry binding (shift-delete) will close the window. Pressing the +accept-custom binding (control-enter or shift-enter) will run a command +on the window. (See option window-command );

+

If there is no match, it will try to launch the input.

+

windowcd

+

Shows a list of the windows on the current desktop and allows switching between +them. Pressing the delete-entry binding (shift-delete) will kill the +window. Pressing the accept-custom binding (control-enter or shift-enter) +will run a command on the window. (See option window-command );

+

If there is no match, it will try to launch the input.

+

run

+

Shows a list of executables in $PATH and can launch them (optional in a +terminal).

+
    +
  • +

    Pressing the delete-entry binding (shift-delete) will remove this entry + from the run history.

    +
  • +
  • +

    Pressing the accept-custom binding (control-enter) will run the command + as entered in the entry box.

    +
  • +
  • +

    Pressing the accept-alt binding (shift-enter) will run the command in a + terminal.

    +
  • +
+

When pressing the mode-complete binding (Control-l), you can use the File +Browser mode to launch the application with a file as the first argument.

+

drun

+

Same as the run launches, but the list is created from the installed +desktop files. It automatically launches them in a terminal if specified in the +Desktop File.

+
    +
  • +

    Pressing the delete-entry binding (shift-delete) will remove this entry + from the run history.

    +
  • +
  • +

    Pressing the accept-custom binding (control-enter) will run the command + as entered in the entry box.

    +
  • +
  • +

    Pressing the accept-alt binding (shift-enter) will run the command in a + terminal.

    +
  • +
+

When pressing the mode-complete binding (Control-l), you can use the File +Browser mode to launch the application passing a file as argument if specified +in the desktop file.

+

The DRUN mode tries to follow the XDG Desktop Entry +Specification +and should be compatible with applications using this standard. Some +applications create invalid desktop files, rofi will discard these entries. +See the debugging section for more info on DRUN mode, this will print why +desktop files are discarded.

+

There are a few advanced options to tweak the behaviour:

+
configuration {
+   drun {
+      /** Scan the current users desktop for desktop files. */
+      scan-desktop: true;
+      /** Parse user desktop files. */
+      parse-user:   true;
+      /** Parse system desktop files. */
+      parse-system: false;
+   }
+}
+
+

ssh

+

Shows a list of SSH targets based on your ssh config file, and allows to +quickly ssh into them.

+

keys

+

Shows a searchable list of key bindings.

+

script

+

Allows custom scripted Modes to be added, see the rofi-script(5) manpage +for more information.

+

combi

+

Combines multiple modes in one list. Specify which modes are included with the +-combi-modes option.

+

When using the combi mode, a !bang can be used to filter the results by modes. +All modes that match the bang as a prefix are included. +For example, say you have specified -combi-modes run,window,windowcd. If your +query begins with the bang !w, only results from the window and windowcd +modes are shown, even if the rest of the input text would match results from run.

+

If no match, the input is handled by the first combined modes.

+

FAQ

+

The text in the window switcher is not nicely aligned

+

Try using a mono-space font or tabs + the tab-stops setting..

+

The window is completely black

+

Check quotes used on the command-line: you might have used ("smart quotes") +instead of " ("machine quotes").

+

What does the icon in the top right show?

+

The indicator shows:

+
    +
  • Case insensitive and no sorting.
  • +
  • - Case sensitivity enabled, no sorting.
  • +
  • + Case insensitive and Sorting enabled
  • +
  • ± Sorting and Case sensitivity enabled"
  • +
+

Why do I see different icons for run,drun and window mode

+

Each of these modes uses different methods of resolving the icon:

+
    +
  • +

    Window: It first uses the icon that the application exposes via the X11 + Server, if none is set it does a lookup of the window Class name in the icon + theme.

    +
  • +
  • +

    drun: It uses the icon set in the desktop file.

    +
  • +
  • +

    run: It does a lookup using the executable name.

    +
  • +
+

EXAMPLES

+

Some basic usage examples of rofi:

+

Show the run dialog:

+
    rofi -modes run -show run
+
+

Show the run dialog, and allow switching to Desktop File run dialog (drun):

+
    rofi -modes run,drun -show run
+
+

Combine the run and Desktop File run dialog (drun):

+
    rofi -modes combi -show combi -combi-modes run,drun
+
+

Combine the run and Desktop File run dialog (drun), and allow switching to +window switcher:

+
    rofi -modes combi,window -show combi -combi-modes run,drun
+
+

Pop up a text message claiming that this is the end:

+
    rofi -e "This is the end"
+
+

Pop up a text message in red, bold font claiming that this is still the end:

+
    rofi -e "<span color='red'><b>This is still the end</b></span>" -markup
+
+

Show all key bindings:

+
    rofi -show keys
+
+

i3

+

In i3 you want to bind rofi to be launched on key +release. Otherwise, it cannot grab the keyboard. See also the i3 +manual:

+

Some tools (such as import or xdotool) might be unable to run upon a +KeyPress event, because the keyboard/pointer is still grabbed. For these +situations, the --release flag can be used, as it will execute the command +after the keys have been released.

+

LICENSE

+
    MIT/X11
+
+    Permission is hereby granted, free of charge, to any person obtaining
+    a copy of this software and associated documentation files (the
+    "Software"), to deal in the Software without restriction, including
+    without limitation the rights to use, copy, modify, merge, publish,
+    distribute, sublicense, and/or sell copies of the Software, and to
+    permit persons to whom the Software is furnished to do so, subject to
+    the following conditions:
+
+    The above copyright notice and this permission notice shall be
+    included in all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+

WEBSITE

+

rofi website can be found here

+

SUPPORT

+

rofi support can be obtained:

+ +

DEBUGGING

+

For more information see rofi-debugging(5) manpage.

+

ISSUE TRACKER

+

The rofi issue tracker can be found here +Before creating an issue, consider posting a question on the discussion forum first. +When creating an issue, please read this +first.

+

SEE ALSO

+

rofi-sensible-terminal(1), dmenu(1), rofi-debugging(5), +rofi-theme(5), rofi-script(5), +rofi-keys(5),rofi-theme-selector(1),rofi-dmenu(5)

+

AUTHOR

+ +

Original code based on work by: Sean Pringle sean.pringle@gmail.com

+

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

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/downloads/index.html b/downloads/index.html new file mode 100644 index 00000000..65b345bd --- /dev/null +++ b/downloads/index.html @@ -0,0 +1,1333 @@ + + + + + + + + + + + + + + + + + + + + + + Downloads - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/guides/DynamicThemes/1.png b/guides/DynamicThemes/1.png new file mode 100644 index 00000000..d219fa24 Binary files /dev/null and b/guides/DynamicThemes/1.png differ diff --git a/guides/DynamicThemes/2.png b/guides/DynamicThemes/2.png new file mode 100644 index 00000000..dfbc8af9 Binary files /dev/null and b/guides/DynamicThemes/2.png differ diff --git a/guides/DynamicThemes/dynamic_themes/index.html b/guides/DynamicThemes/dynamic_themes/index.html new file mode 100644 index 00000000..fd311916 --- /dev/null +++ b/guides/DynamicThemes/dynamic_themes/index.html @@ -0,0 +1,1400 @@ + + + + + + + + + + + + + + + + + + + + + + Dynamic Theme - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dynamic Theme

+

A new addition in rofi 1.7.5 that did not get a lot of attention is support for +the enabled keyword in the media statement and supporting environment values. +Or more practical, you can modify your theme based on environment variables.

+

+@media ( enabled: env(DO_X, false)) {
+  listview {
+    orientation: vertical;
+  }
+}
+
+

You can now enable this part of the theme by running rofi with DO_X set.

+
DO_X=true rofi -show combi
+
+

Image browser example

+

In the current release, there is a +fullscreen_preview +as an example.

+

In this theme we are going to modify the filebrowser view with a preview widget +that we can enable.

+

Lets start with the basic theme.

+
* {
+    background-color: transparent;
+    text-color:       white;
+}
+
+window {
+    fullscreen:       true;
+    background-color: black/80%;
+    padding:          4em;
+    children:         [ wrap, listview-split];
+    spacing:          1em;
+}
+
+
+/** We add an extra child to this if PREVIEW=true */
+listview-split {
+  orientation: horizontal;
+  spacing: 0.4em;
+  children: [listview];
+}
+
+wrap {
+    expand: false;
+    orientation: vertical;
+    children: [ inputbar, message ];
+    background-image: linear-gradient(white/5%, white/40%);
+    border-color: lightblue;
+    border: 3px;
+    border-radius: 0.4em;
+}
+
+icon-ib {
+    expand: false;
+    filename: "system-search";
+    vertical-align: 0.5;
+    horizontal-align: 0.5;
+    size: 1em;
+}
+inputbar {
+    spacing: 0.4em;
+    padding: 0.4em;
+    children: [ icon-ib, entry ];
+}
+entry {
+    placeholder: "Search";
+    placeholder-color: grey;
+}
+message {
+    background-color: red/20%;
+    border-color: lightsalmon;
+    border: 3px 0px 0px 0px;
+    padding: 0.4em;
+    spacing: 0.4em;
+}
+
+listview {
+    flow: horizontal;
+    fixed-columns: true;
+    columns: 7;
+    lines: 5;
+    spacing: 1.0em;
+}
+
+element {
+    orientation: vertical;
+    padding: 0.1em;
+
+    background-image: linear-gradient(white/5%, white/20%);
+    border-color: lightblue /15%;
+    border: 3px;
+    border-radius: 0.4em;
+
+  children: [element-icon, element-text ];
+}
+element-icon {
+    size: calc(((100% - 8em) / 7 ));
+    horizontal-align: 0.5;
+    vertical-align: 0.5;
+}
+element-text {
+    horizontal-align: 0.5;
+    vertical-align: 0.5;
+  padding: 0.2em;
+}
+
+element selected {
+    background-image: linear-gradient(white/25%, white/10%);
+    border-color: lightblue;
+    border: 3px;
+    border-radius: 0.4em;
+}
+
+
+

When running this theme:

+
rofi -theme fullscreen-preview.rasi -show filebrowser
+
+

Basic Theme

+

We already prepared the place where we are going to add a 2nd widget. +Now lets, at the end of the theme, add the extra element in a media block.

+
@media ( enabled: env(PREVIEW, false)) {
+
+

The variable is PREVIEW, if it is not set false is used. +Otherwise the content of PREVIEW is parsed.

+

These will be merged into the theme on load:

+

+/**
+ * Launching rofi with environment PREVIEW set to true
+ * will split the screen and show a preview widget.
+ */
+@media ( enabled: env(PREVIEW, false)) {
+  // preview widget
+  icon-current-entry {
+    expand:          true;
+    size:            80%;
+  }
+  // override the children of `listview-split`
+  listview-split {
+    children: [listview, icon-current-entry];
+  }
+  // Reduce to 4 columns
+  listview {
+    columns: 4;
+  }
+
+}
+
+

Now if we run it:

+
PREVIEW=true rofi -theme fullscreen-preview.rasi -show filebrowser
+
+

It looks like this:

+

Image preview

+

We can add more sections; for example for text only we hide the images:

+
@media ( enabled: env(NO_IMAGE, false)) {
+    listview {
+        columns: 1;
+        spacing: 0.4em;
+    }
+    element {
+        children: [ element-text ];
+    }
+    element-text {
+        horizontal-align: 0.0;
+    }
+}
+
+

Wallpaper picker

+

If you run latest git version, you can now easily make a wallpaper picker:

+
PREVIEW=true rofi -theme fullscreen-preview.rasi -show filebrowser -filebrowser-command 'feh --bg-scale' -filebrowser-directory ~/Wallpapers/
+
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/guides/Plugins/2017-04-19-rofi-140-sneak-preview-plugins/index.html b/guides/Plugins/2017-04-19-rofi-140-sneak-preview-plugins/index.html new file mode 100644 index 00000000..1c3de830 --- /dev/null +++ b/guides/Plugins/2017-04-19-rofi-140-sneak-preview-plugins/index.html @@ -0,0 +1,2003 @@ + + + + + + + + + + + + + + + + + + + + + + Plugins - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Plugins

+ +
+

This guide is taken from the 1.4.0 release preview posts. The information +might be outdated, but in general should still be correct and a good starting +point for writing a plugin. Links have been updated. A recent plugin that can +be used as example can be found here.

+
+

Build system

+

Rofi uses autotools as +build system. While there are many opinions about the pre/cons off all the +different options out there (to many to go into in this blog post), we will +stick to autotools for now.

+

To make life easier I create a template project +here

+

This includes the 2 files for the build system and the C template.

+

Configure.ac

+

First we are going to update the configure.ac file:

+
AC_INIT([rofi-plugin-template], [0.0.1],
+[https://my-neat-plugin.org//],[],[https://support.my-neat-plugin.org/])
+
+AC_CONFIG_HEADER([config.h])
+
+AC_CONFIG_MACRO_DIRS([m4])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects dist-xz])
+AM_SILENT_RULES([yes])
+
+AC_PROG_CC([clang gcc cc])
+AC_PROG_CC_C99
+AM_PROG_CC_C_O
+
+AC_USE_SYSTEM_EXTENSIONS
+
+AM_PROG_AR
+
+AM_CFLAGS="-Wall -Wextra -Wparentheses -Winline -pedantic  -Wunreachable-code"
+
+PKG_PROG_PKG_CONFIG
+
+PKG_CHECK_MODULES([glib],     [glib-2.0 >= 2.40 gio-unix-2.0 gmodule-2.0 ])
+PKG_CHECK_MODULES([rofi],     [rofi])
+
+[rofi_PLUGIN_INSTALL_DIR]="`$PKG_CONFIG --variable=pluginsdir rofi`"
+AC_SUBST([rofi_PLUGIN_INSTALL_DIR])
+
+LT_INIT([disable-static])
+
+AC_SUBST([AM_CFLAGS])
+
+
+AC_CONFIG_FILES([Makefile ])
+AC_OUTPUT
+
+

Basically the only thing here we need to change is the name of the plugin, the +website and the support site.

+
AC_INIT([rofi-file-browser], [0.0.1], [https://davedavenport.github.io/rofi/],[],[https://reddit.org/r/qtools/])
+
+

Makefile.am

+

We need to make a similar change in the Makefile.am file, this is important so +each plugin has a unique name. (if they are all called myplugin, it would be +hard to install more then one plugin.)

+
ACLOCAL_AMFLAGS=-I m4
+plugindir=@rofi_PLUGIN_INSTALL_DIR@
+
+plugin_LTLIBRARIES = myplugin.la
+
+myplugin_la_SOURCES=\
+         src/myplugin.c
+
+myplugin_la_CFLAGS= @glib_CFLAGS@ @rofi_CFLAGS@
+myplugin_la_LIBADD= @glib_LIBS@ @rofi_LIBS@
+myplugin_la_LDFLAGS= -module -avoid-version
+
+

So we do a search and replace from myplugin to file_browser:

+
ACLOCAL_AMFLAGS=-I m4
+plugindir=${libdir}/rofi/
+
+plugin_LTLIBRARIES = file_browser.la
+
+file_browser_la_SOURCES=\
+         src/file_browser.c
+
+file_browser_la_CFLAGS= @glib_CFLAGS@ @rofi_CFLAGS@
+file_browser_la_LIBADD= @glib_LIBS@ @rofi_LIBS@
+file_browser_la_LDFLAGS= -module -avoid-version
+
+

As you noticed I also changed the name of the c template file. This is not +needed.

+

Building the system

+

Now that we have this setup, it is easy to build:

+
    +
  • Generate the build system:
  • +
+
autoreconf -i
+
+
    +
  • Create a build directory.
  • +
+
mkdir build
+cd build
+
+
    +
  • Run configure
  • +
+
../configure
+
+
    +
  • build
  • +
+
make
+
+
    +
  • install
  • +
+
make install
+
+

You can now test the plugin by calling:

+
rofi -show myplugin -modi myplugin
+
+

If we start changing the template, the name to use will change.

+

Edit the C template

+

The first thing todo is personalize the template. Below I have modified it so +it is called file-browser:

+
/**
+ * rofi-file-browser
+ *
+ * MIT/X11 License
+ * Copyright (c) 2017 Qball Cow <qball@gmpclient.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <gmodule.h>
+
+#include <rofi/mode.h>
+#include <rofi/helper.h>
+#include <rofi/mode-private.h>
+
+#include <stdint.h>
+
+G_MODULE_EXPORT Mode mode;
+
+/**
+ * The internal data structure holding the private data of the TEST Mode.
+ */
+typedef struct
+{
+    char **array;
+    unsigned int array_length;
+} FileBrowserModePrivateData;
+
+
+static void get_file_browser (  Mode *sw )
+{
+    /**
+     * Get the entries to display.
+     * this gets called on plugin initialization.
+     */
+}
+
+
+static int file_browser_mode_init ( Mode *sw )
+{
+    /**
+     * Called on startup when enabled (in modi list)
+     */
+    if ( mode_get_private_data ( sw ) == NULL ) {
+        FileBrowserModePrivateData *pd = g_malloc0 ( sizeof ( *pd ) );
+        mode_set_private_data ( sw, (void *) pd );
+        // Load content.
+        get_file_browser ( sw );
+    }
+    return TRUE;
+}
+static unsigned int file_browser_mode_get_num_entries ( const Mode *sw )
+{
+    const FileBrowserModePrivateData *pd = (const FileBrowserModePrivateData *) mode_get_private_data ( sw );
+    return pd->array_length;
+}
+
+static ModeMode file_browser_mode_result ( Mode *sw, int mretv, char **input, unsigned int selected_line )
+{
+    ModeMode           retv  = MODE_EXIT;
+    FileBrowserModePrivateData *pd = (FileBrowserModePrivateData *) mode_get_private_data ( sw );
+    if ( mretv & MENU_NEXT ) {
+        retv = NEXT_DIALOG;
+    } else if ( mretv & MENU_PREVIOUS ) {
+        retv = PREVIOUS_DIALOG;
+    } else if ( mretv & MENU_QUICK_SWITCH ) {
+        retv = ( mretv & MENU_LOWER_MASK );
+    } else if ( ( mretv & MENU_OK ) ) {
+        retv = RELOAD_DIALOG;
+    } else if ( ( mretv & MENU_ENTRY_DELETE ) == MENU_ENTRY_DELETE ) {
+        retv = RELOAD_DIALOG;
+    }
+    return retv;
+}
+
+static void file_browser_mode_destroy ( Mode *sw )
+{
+    FileBrowserModePrivateData *pd = (FileBrowserModePrivateData *) mode_get_private_data ( sw );
+    if ( pd != NULL ) {
+        g_free ( pd );
+        mode_set_private_data ( sw, NULL );
+    }
+}
+
+static char *_get_display_value ( const Mode *sw, unsigned int selected_line, G_GNUC_UNUSED int *state, G_GNUC_UNUSED GList **attr_list, int get_entry )
+{
+    FileBrowserModePrivateData *pd = (FileBrowserModePrivateData *) mode_get_private_data ( sw );
+    // Only return the string if requested, otherwise only set state.
+    return get_entry ? g_strdup("n/a"): NULL;
+}
+
+static int file_browser_token_match ( const Mode *sw, GRegex **tokens, unsigned int index )
+{
+    FileBrowserModePrivateData *pd = (FileBrowserModePrivateData *) mode_get_private_data ( sw );
+    // Call default matching function.
+    return helper_token_match ( tokens, pd->array[index]);
+}
+
+Mode mode =
+{
+    .abi_version        = ABI_VERSION,
+    .name               = "file_browser",
+    .cfg_name_key       = "display-file_browser",
+    ._init              = file_browser_mode_init,
+    ._get_num_entries   = file_browser_mode_get_num_entries,
+    ._result            = file_browser_mode_result,
+    ._destroy           = file_browser_mode_destroy,
+    ._token_match       = file_browser_token_match,
+    ._get_display_value = _get_display_value,
+    ._get_message       = NULL,
+    ._get_completion    = NULL,
+    ._preprocess_input  = NULL,
+    .private_data       = NULL,
+    .free               = NULL,
+};
+
+

If we now rebuild the plugin, we need to run the following command:

+
rofi -show file_browser -modi file_browser
+
+

The mode description

+

The mode is defined by the Mode structure, every mode in rofi has one of the +plugins.

+
Mode mode =
+{
+    .abi_version        = ABI_VERSION,
+    .name               = "file_browser",
+    .cfg_name_key       = "display-file_browser",
+    ._init              = file_browser_mode_init,
+    ._get_num_entries   = file_browser_mode_get_num_entries,
+    ._result            = file_browser_mode_result,
+    ._destroy           = file_browser_mode_destroy,
+    ._token_match       = file_browser_token_match,
+    ._get_display_value = _get_display_value,
+    ._get_message       = NULL,
+    ._get_completion    = NULL,
+    ._preprocess_input  = NULL,
+    .private_data       = NULL,
+    .free               = NULL,
+};
+
+

The ABI_VERSION is defined in rofi header file, so that rofi can detect +what ABI the plugin was compiled against. Not every function needs to be +implemented, in the plugin we show the minimum set.

+

Lets modify each of the above functions to implement something useful.

+

FileBrowserModePrivateData

+

This is a structure that holds all the private data of this mode. +We are going to extend this so it can hold the state of information we want to +view.

+

We want to differentiate between 3 different rows:

+
    +
  • Go one level up
  • +
  • Directory
  • +
  • Regular file
  • +
+

So we add an enum:

+
enum FBFileType {                                                         
+    UP,                                                                   
+    DIRECTORY,                                                            
+    RFILE,                                                                
+};                                                                        
+
+

We need a structure that hold each entry.

+
    +
  • +

    It should have a name we are going to show the user. This will hold an + utf-8 string. (rofi will only display utf-8).

    +
  • +
  • +

    It should hold the path to the entry. This will be in the file-systems + encoding.

    +
  • +
  • +

    The type it holds.

    +
  • +
+
typedef struct {                                                          
+    char *name;                                                           
+    char *path;                                                           
+    enum FBFileType type;                                                 
+} FBFile;                                                                 
+
+

Then in the private data we hold all the relevant information.

+
    +
  • The current directory to show.
  • +
  • Array of all the FBFile we want to show.
  • +
  • The length of the array.
  • +
+
typedef struct                                                            
+{                                                                         
+    GFile *current_dir;                                                   
+    FBFile *array;                                                        
+    unsigned int array_length;                                            
+} FileBrowserModePrivateData;                                             
+
+

Initialization

+

Now that we have the data structure to hold our information, we need to +initialize it and fill it.

+
static int file_browser_mode_init ( Mode *sw )                        
+{                                                                     
+    if ( mode_get_private_data ( sw ) == NULL ) {                     
+        FileBrowserModePrivateData *pd = g_malloc0 ( sizeof ( *pd ) );
+        mode_set_private_data ( sw, (void *) pd );                    
+        pd->current_dir = g_file_new_for_path(g_get_home_dir () );    
+        get_file_browser ( sw );                                      
+    }                                                                 
+    return TRUE;                                                      
+}                                                                     
+
+

The function first checked if we already initialized the private data. You can +include a mode multiple times, and we normally don't want it initialized +multiple times.

+

We then create a, zero initialized, FileBrowserModePrivateData structure and +set this on the mode. Set the current directory to the users home directory and +call get_file_browser that will load in the entries. We will discuss this one +later.

+

Destroying

+

On shutdown we want to cleanup, so there is also a destroy function.

+
static void file_browser_mode_destroy ( Mode *sw )                                              
+{                                                                                               
+    FileBrowserModePrivateData *pd = (FileBrowserModePrivateData *) mode_get_private_data ( sw );
+    if ( pd != NULL ) {                                                                         
+        g_object_unref ( pd->current_dir );                                                     
+        free_list ( pd );                                                                       
+        g_free ( pd );                                                                          
+        mode_set_private_data ( sw, NULL );                                                     
+    }                                                                                           
+}                                                                                               
+
+

This does the exact opposite.

+

For completeness:

+
static void free_list ( FileBrowserModePrivateData *pd )
+{
+    for ( unsigned int i = 0; i < pd->array_length; i++ ) {
+        FBFile *fb = & ( pd->array[i] );
+        g_free ( fb->name );
+        g_free ( fb->path );
+    }
+    g_free (pd->array);
+    pd->array  = NULL;
+    pd->array_length = 0;
+}
+
+

Loading the entries

+

Lets dive deeper into the get_file_browser function.

+
static void get_file_browser (  Mode *sw )
+{
+    FileBrowserModePrivateData *pd = (FileBrowserModePrivateData *) mode_get_private_data ( sw );
+
+

We want to get access to the private data structure.

+
    char *cdir = g_file_get_path ( pd->current_dir );
+    DIR *dir = opendir ( cdir );
+    if ( dir ) {
+        struct dirent *rd = NULL;
+        while ((rd = readdir (dir)) != NULL )
+        {
+
+

We open the directory and we iterate over each entry. We then want to skip over +hidden files (starting with a .) and insert a special up node for going up one +directory. For this we do not need a path, and we show ".." to the user.

+
            if ( g_strcmp0 ( rd->d_name, ".." ) == 0 ){
+                    pd->array = g_realloc ( pd->array, (pd->array_length+1)*sizeof(FBFile));
+                    pd->array[pd->array_length].name = g_strdup ( ".." );
+                    pd->array[pd->array_length].path = NULL;
+                    pd->array[pd->array_length].type = UP;
+                    pd->array_length++;
+                    continue;
+
+            } else if ( rd->d_name[0] == '.' ) {
+                continue;
+            }
+
+

We do a similar filtering act for the rest of the files, we skip fifo, blk,character and socket files.

+
            switch ( rd->d_type )
+            {
+                case DT_BLK:
+                case DT_CHR:
+                case DT_FIFO:
+                case DT_UNKNOWN:
+                case DT_SOCK:
+                    break;
+                case DT_REG:
+                case DT_DIR:
+                    pd->array = g_realloc ( pd->array, (pd->array_length+1)*sizeof(FBFile));
+                    pd->array[pd->array_length].name = g_strdup ( rd->d_name );
+                    pd->array[pd->array_length].path = g_build_filename ( pd->current_dir, rd->d_name, NULL );
+                    pd->array[pd->array_length].type = (rd->d_type == DT_DIR)? DIRECTORY: RFILE;
+                    pd->array_length++; 
+            }
+        }
+        closedir ( dir );
+    }
+
+

We then sort the list in a way the user expects this.

+
    g_qsort_with_data ( pd->array, pd->array_length, sizeof (FBFile ), compare, NULL );
+}
+
+

Qsort here uses the following sort function:

+
static gint compare ( gconstpointer a, gconstpointer b, gpointer data )
+{
+    FBFile *fa = (FBFile*)a;
+    FBFile *fb = (FBFile*)b;
+    if ( fa->type != fb->type ){
+        return (fa->type - fb->type);
+    }
+
+    return g_strcmp0 ( fa->name, fb->name );
+}
+
+

Showing the entries

+

When showing each entry, rofi calls the _get_display_value function. It calls +them in two situations, to get the state and the display string. Or just to get +the new state. If you need to return a string (should always be malloced), the +get_entry parameter is set to 1.

+

We currently show the name, and prepend an icon using the Awesome Font.

+
static char *_get_display_value ( const Mode *sw, unsigned int selected_line, G_GNUC_UNUSED int *state, G_GNUC_UNUSED GList **attr_list, int get_entry )
+{
+    FileBrowserModePrivateData *pd = (FileBrowserModePrivateData *) mode_get_private_data ( sw );
+
+    // Only return the string if requested, otherwise only set state.
+    if ( !get_entry ) return NULL;
+    if ( pd->array[selected_line].type == DIRECTORY ){
+        return g_strdup_printf ( " %s", pd->array[selected_line].name);
+    } else if ( pd->array[selected_line].type == UP ){
+        return g_strdup( " ..");
+    } else {
+        return g_strdup_printf ( " %s", pd->array[selected_line].name);
+    }
+    return g_strdup("n/a"); 
+}
+
+

The selected_line setting will always be within range 0 and the result of +.get_num_entries.

+
static unsigned int file_browser_mode_get_num_entries ( const Mode *sw )
+{
+    const FileBrowserModePrivateData *pd = (const FileBrowserModePrivateData *) mode_get_private_data ( sw );
+    return pd->array_length;
+}
+
+
+

The attr_list argument is there for more advanced markup of the string.

+
+

Filtering the entries

+

When filtering we want to filter on the file name, we luckily store this entry +in FBFile::name. To use rofi's matching algorithm we can use the +helper_token_match function.

+
static int file_browser_token_match ( const Mode *sw, GRegex **tokens, unsigned int index )
+{
+    FileBrowserModePrivateData *pd = (FileBrowserModePrivateData *) mode_get_private_data ( sw );
+
+    // Call default matching function.
+    return helper_token_match ( tokens, pd->array[index].name);
+}
+
+

The index setting will always be within range 0 and the result of +.get_num_entries.

+

Running it

+

Now we should be able to build it, install it and run it and see the result.

+
rofi -show file_browser -modi file_browser
+
+

rofi file browser

+

Handling selected entries

+

This is just an example and can probably be implemented nicer. +Here it also shows some rudimentary parts in rofi, that show some of the +ugly details, that will be cleaned up in the future.

+

+static ModeMode file_browser_mode_result ( Mode *sw, int mretv, char **input, unsigned int selected_line )
+{
+    ModeMode           retv  = MODE_EXIT;
+    FileBrowserModePrivateData *pd = (FileBrowserModePrivateData *) mode_get_private_data ( sw );
+    if ( mretv & MENU_NEXT ) {
+        retv = NEXT_DIALOG;
+    } else if ( mretv & MENU_PREVIOUS ) {
+        retv = PREVIOUS_DIALOG;
+    } else if ( mretv & MENU_QUICK_SWITCH ) {
+        retv = ( mretv & MENU_LOWER_MASK );
+
+

This is the user pressing enter on the entry. We handle it differently for +each type.

+
    } else if ( ( mretv & MENU_OK ) ) {
+        if ( selected_line < pd->array_length )
+        {
+            if ( pd->array[selected_line].type == UP ) {
+                GFile *new = g_file_get_parent ( pd->current_dir );
+               if ( new ){
+                   g_object_unref ( pd->current_dir );
+                   pd->current_dir = new;
+                   free_list (pd);
+                   get_file_browser ( sw );
+                   return RESET_DIALOG;
+               }
+            } else if ( pd->array[selected_line].type == DIRECTORY ) {
+                GFile *new = g_file_new_for_path ( pd->array[selected_line].path );
+                g_object_unref ( pd->current_dir );
+                pd->current_dir = new;
+                free_list (pd);
+                get_file_browser ( sw );
+                return RESET_DIALOG;
+            } else if ( pd->array[selected_line].type == RFILE ) {
+                char *d = g_strescape ( pd->array[selected_line].path,NULL );
+                char *cmd = g_strdup_printf("xdg-open '%s'", d );
+                g_free(d);
+                char *cdir = g_file_get_path ( pd->current_dir );
+                helper_execute_command ( cdir,cmd, FALSE );
+                g_free ( cdir );
+                g_free ( cmd );
+                return MODE_EXIT;
+            }
+        }
+        retv = RELOAD_DIALOG;
+
+

Handle custom entry that does not match an entry:

+
    } else if ( (mretv&MENU_CUSTOM_INPUT) && *input ) {
+        char *p = rofi_expand_path ( *input );
+        char *dir = g_filename_from_utf8 ( p, -1, NULL, NULL, NULL );
+        g_free (p);
+        if ( g_file_test ( dir, G_FILE_TEST_EXISTS )  )
+        {
+            if ( g_file_test ( dir, G_FILE_TEST_IS_DIR ) ){
+                g_object_unref ( pd->current_dir );
+                pd->current_dir = g_file_new_for_path ( dir );
+                g_free ( dir );
+                free_list (pd);
+                get_file_browser ( sw );
+                return RESET_DIALOG;
+            }
+
+        }
+        g_free ( dir );
+        retv = RELOAD_DIALOG;
+
+

We do not support delete, just reload.

+
    } else if ( ( mretv & MENU_ENTRY_DELETE ) == MENU_ENTRY_DELETE ) {
+        retv = RELOAD_DIALOG;
+    }
+    return retv;
+}
+
+

The RESET_DIALOG will clear the input bar and reload the view, RELOAD_DIALOG +will reload the view and re-filter based on the current text.

+
+

Note: rofi_expand_path will expand ~ and ~me/ into it full absolute +path. Note: helper_execute_command will spawn command.

+
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/guides/Plugins/rofi-file-browser.png b/guides/Plugins/rofi-file-browser.png new file mode 100644 index 00000000..21244013 Binary files /dev/null and b/guides/Plugins/rofi-file-browser.png differ diff --git a/guides/Positioning/anchors.svg b/guides/Positioning/anchors.svg new file mode 100644 index 00000000..249fd99b --- /dev/null +++ b/guides/Positioning/anchors.svg @@ -0,0 +1,241 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + center + south + east + + west + + northwest + northeast + southwest + southeast + + + + + + + + + + north + + diff --git a/guides/Positioning/example-pos.png b/guides/Positioning/example-pos.png new file mode 100644 index 00000000..c4f4f2b2 Binary files /dev/null and b/guides/Positioning/example-pos.png differ diff --git a/guides/Positioning/theme3-positioning/index.html b/guides/Positioning/theme3-positioning/index.html new file mode 100644 index 00000000..f69dfa8d --- /dev/null +++ b/guides/Positioning/theme3-positioning/index.html @@ -0,0 +1,1285 @@ + + + + + + + + + + + + + + + + + + + + + + Positioning - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Positioning Rofi on the monitor

+

In the current theme format you set these properties on the window widget.

+

The first, location, determines where rofi is placed on the monitor, the +second what point of the rofi window connects there. This sounds +complicated, but it ain't.

+

location setting

+

The location setting determines the place of the window on the monitor.

+

The location setting supports the following values:

+
    +
  • north
  • +
  • northeast
  • +
  • northwest
  • +
  • south
  • +
  • southeast
  • +
  • southwest
  • +
  • east
  • +
  • west
  • +
  • center
  • +
+

This is depicted in the diagram below:

+

location

+

anchor setting

+

The anchor sets what point of the rofi window is placed at the specified +location.

+

The anchor settings supports the same values as the location setting.

+

If you want the middle of the rofi window to be always located at the +center of the monitor set both location and anchor to center.

+

If the rofi window resizes, its center will stay at the center. If you set +the anchor to north the top of the rofi window is at the center of the +monitor, and the window will grow down.

+

If you set the anchor and location to south, rofi is located at the +bottom center and the window grows up.

+
+

Note that if you set the anchor to south and the location to north +the rofi window will be placed above the monitor and might not be +visible.

+

In another blog post we will explain how the dynamic sizing behaviour of +rofi can be tweaked or disabled.

+
+

So the following theme setting will place the top of the rofi window in the +center of the monitor:

+
window {
+    location: center;
+    anchor: north;
+}
+
+

As depicted here, RED is the location (center of screen), GREEN is the anchor +on rofi window (north):

+

positions

+
+

Quick hint, if you want to quickly test out changes to the theme, without +editing the file, run rofi like:

+
+
rofi -show run -theme-str "window { location: center; anchor: north;}"
+
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/guides/Transparency/rofi-background.png b/guides/Transparency/rofi-background.png new file mode 100644 index 00000000..57030ccd Binary files /dev/null and b/guides/Transparency/rofi-background.png differ diff --git a/guides/Transparency/rofi-background2.png b/guides/Transparency/rofi-background2.png new file mode 100644 index 00000000..f4a00f57 Binary files /dev/null and b/guides/Transparency/rofi-background2.png differ diff --git a/guides/Transparency/rofi-fake.png b/guides/Transparency/rofi-fake.png new file mode 100644 index 00000000..825508e5 Binary files /dev/null and b/guides/Transparency/rofi-fake.png differ diff --git a/guides/Transparency/rofi-paper.png b/guides/Transparency/rofi-paper.png new file mode 100644 index 00000000..0a8ffcc2 Binary files /dev/null and b/guides/Transparency/rofi-paper.png differ diff --git a/guides/Transparency/rofi-real.png b/guides/Transparency/rofi-real.png new file mode 100644 index 00000000..21b53811 Binary files /dev/null and b/guides/Transparency/rofi-real.png differ diff --git a/guides/Transparency/rofi-transp.png b/guides/Transparency/rofi-transp.png new file mode 100644 index 00000000..ac38f4f5 Binary files /dev/null and b/guides/Transparency/rofi-transp.png differ diff --git a/guides/Transparency/structure.svg b/guides/Transparency/structure.svg new file mode 100644 index 00000000..ccfe2e6b --- /dev/null +++ b/guides/Transparency/structure.svg @@ -0,0 +1,520 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + button + + #window + #window mainbox + + + + Expand + + + + + + #window mainbox listview + + #window mainbox inputbar + #window mainbox sidebar + + prompt + + + + entry + + + case-indicator + + + button + + + Element + + + + + Scrollbar + + + + + + + #window mainbox message + + textbox + + + + Element + + + + Element + + + + Element + + + + Element + + + + Element + + + + diff --git a/guides/Transparency/theme3-transparency/index.html b/guides/Transparency/theme3-transparency/index.html new file mode 100644 index 00000000..6a6a7695 --- /dev/null +++ b/guides/Transparency/theme3-transparency/index.html @@ -0,0 +1,1358 @@ + + + + + + + + + + + + + + + + + + + + + + Transparency - Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+ +
+ + + +
+
+ + + + + + + + +

Transparency

+ +

Transparency within rofi

+
+

The images in this guide are outdated, but the principals still hold.

+
+

Rofi window is build up by first drawing the background, and then each +widget above it, with the correct transparency factor.

+

Remember the general widget structure:

+

structure

+

This means if you set every widget to be 30% transparent on a white background: +it will look like:

+

images

+

The transparency applies one on top of the other, so while they all are 30%, in +the end it will be less transparent.

+
+

Try it yourself

+
+
rofi -theme-str '@theme "/dev/null"  window { background-color: white; }* { padding:5; background-color: rgba(20,20,20,0.5);}' -show run
+
+

This can sometimes be difficult when creating themes with a nice transparent +background. +The trick to make this work nicely is the following.

+

Specify fully transparent background on the highest level.

+
* {
+    background:  transparent;
+}
+
+

Then set the background on the window box.

+
window {
+    background: #cc1c1c1c;
+}
+
+

Now if you only set the background on widgets you want differently colored, it +nicely works out.

+

Transparency on the window

+

This determines how transparency on the window is handled. +This is set the be transparency option on the window widget. +The option takes a string. There are basically 4 options:

+

No transparency or "real"

+

The background of the window is black and fully transparent, and everything is +drawn on top of this. This means that if you have a composite manager (ARGB +window), you get a fully transparent background, otherwise fully black.

+

This is the preferred option if you have a composite manager running.

+

rofi real

+

This image is actually partially transparent (won't show here clearly as block +background is white.)

+

Fake transparency or "screenshot"

+

This tries to emulate a transparent window by taking a screenshot of the window +before showing and then drawing everything on top of this. While this is not an +ideal solution (it won't update if something changes in the background) it is +often a very usable facsimile.

+

rofi fake

+
+

Note: It can get very slow, especially on high resolution (4k) monitors.

+
+

Background transparency or "background"

+

This uses the background image (the root window image). This is, in my opinion, +mostly useful when used fullscreen.

+

rofi background

+

rofi background2

+

Picture

+

If instead of one of the above option, you specify a path to a png file this is +used as background image. This can create a theme where you use paper as +background.

+

rofi paper

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/images/rofi-logo-full.png b/images/rofi-logo-full.png new file mode 100644 index 00000000..e95d73f4 Binary files /dev/null and b/images/rofi-logo-full.png differ diff --git a/images/rofi.png b/images/rofi.png new file mode 100644 index 00000000..adccdca2 Binary files /dev/null and b/images/rofi.png differ diff --git a/index.html b/index.html new file mode 100644 index 00000000..d1f0d48f --- /dev/null +++ b/index.html @@ -0,0 +1,1219 @@ + + + + + + + + + + + + + + + + + + Rofi Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/search/lunr.js b/search/lunr.js new file mode 100644 index 00000000..aca0a167 --- /dev/null +++ b/search/lunr.js @@ -0,0 +1,3475 @@ +/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + */ + +;(function(){ + +/** + * A convenience function for configuring and constructing + * a new lunr Index. + * + * A lunr.Builder instance is created and the pipeline setup + * with a trimmer, stop word filter and stemmer. + * + * This builder object is yielded to the configuration function + * that is passed as a parameter, allowing the list of fields + * and other builder parameters to be customised. + * + * All documents _must_ be added within the passed config function. + * + * @example + * var idx = lunr(function () { + * this.field('title') + * this.field('body') + * this.ref('id') + * + * documents.forEach(function (doc) { + * this.add(doc) + * }, this) + * }) + * + * @see {@link lunr.Builder} + * @see {@link lunr.Pipeline} + * @see {@link lunr.trimmer} + * @see {@link lunr.stopWordFilter} + * @see {@link lunr.stemmer} + * @namespace {function} lunr + */ +var lunr = function (config) { + var builder = new lunr.Builder + + builder.pipeline.add( + lunr.trimmer, + lunr.stopWordFilter, + lunr.stemmer + ) + + builder.searchPipeline.add( + lunr.stemmer + ) + + config.call(builder, builder) + return builder.build() +} + +lunr.version = "2.3.9" +/*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A namespace containing utils for the rest of the lunr library + * @namespace lunr.utils + */ +lunr.utils = {} + +/** + * Print a warning message to the console. + * + * @param {String} message The message to be printed. + * @memberOf lunr.utils + * @function + */ +lunr.utils.warn = (function (global) { + /* eslint-disable no-console */ + return function (message) { + if (global.console && console.warn) { + console.warn(message) + } + } + /* eslint-enable no-console */ +})(this) + +/** + * Convert an object to a string. + * + * In the case of `null` and `undefined` the function returns + * the empty string, in all other cases the result of calling + * `toString` on the passed object is returned. + * + * @param {Any} obj The object to convert to a string. + * @return {String} string representation of the passed object. + * @memberOf lunr.utils + */ +lunr.utils.asString = function (obj) { + if (obj === void 0 || obj === null) { + return "" + } else { + return obj.toString() + } +} + +/** + * Clones an object. + * + * Will create a copy of an existing object such that any mutations + * on the copy cannot affect the original. + * + * Only shallow objects are supported, passing a nested object to this + * function will cause a TypeError. + * + * Objects with primitives, and arrays of primitives are supported. + * + * @param {Object} obj The object to clone. + * @return {Object} a clone of the passed object. + * @throws {TypeError} when a nested object is passed. + * @memberOf Utils + */ +lunr.utils.clone = function (obj) { + if (obj === null || obj === undefined) { + return obj + } + + var clone = Object.create(null), + keys = Object.keys(obj) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i], + val = obj[key] + + if (Array.isArray(val)) { + clone[key] = val.slice() + continue + } + + if (typeof val === 'string' || + typeof val === 'number' || + typeof val === 'boolean') { + clone[key] = val + continue + } + + throw new TypeError("clone is not deep and does not support nested objects") + } + + return clone +} +lunr.FieldRef = function (docRef, fieldName, stringValue) { + this.docRef = docRef + this.fieldName = fieldName + this._stringValue = stringValue +} + +lunr.FieldRef.joiner = "/" + +lunr.FieldRef.fromString = function (s) { + var n = s.indexOf(lunr.FieldRef.joiner) + + if (n === -1) { + throw "malformed field ref string" + } + + var fieldRef = s.slice(0, n), + docRef = s.slice(n + 1) + + return new lunr.FieldRef (docRef, fieldRef, s) +} + +lunr.FieldRef.prototype.toString = function () { + if (this._stringValue == undefined) { + this._stringValue = this.fieldName + lunr.FieldRef.joiner + this.docRef + } + + return this._stringValue +} +/*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A lunr set. + * + * @constructor + */ +lunr.Set = function (elements) { + this.elements = Object.create(null) + + if (elements) { + this.length = elements.length + + for (var i = 0; i < this.length; i++) { + this.elements[elements[i]] = true + } + } else { + this.length = 0 + } +} + +/** + * A complete set that contains all elements. + * + * @static + * @readonly + * @type {lunr.Set} + */ +lunr.Set.complete = { + intersect: function (other) { + return other + }, + + union: function () { + return this + }, + + contains: function () { + return true + } +} + +/** + * An empty set that contains no elements. + * + * @static + * @readonly + * @type {lunr.Set} + */ +lunr.Set.empty = { + intersect: function () { + return this + }, + + union: function (other) { + return other + }, + + contains: function () { + return false + } +} + +/** + * Returns true if this set contains the specified object. + * + * @param {object} object - Object whose presence in this set is to be tested. + * @returns {boolean} - True if this set contains the specified object. + */ +lunr.Set.prototype.contains = function (object) { + return !!this.elements[object] +} + +/** + * Returns a new set containing only the elements that are present in both + * this set and the specified set. + * + * @param {lunr.Set} other - set to intersect with this set. + * @returns {lunr.Set} a new set that is the intersection of this and the specified set. + */ + +lunr.Set.prototype.intersect = function (other) { + var a, b, elements, intersection = [] + + if (other === lunr.Set.complete) { + return this + } + + if (other === lunr.Set.empty) { + return other + } + + if (this.length < other.length) { + a = this + b = other + } else { + a = other + b = this + } + + elements = Object.keys(a.elements) + + for (var i = 0; i < elements.length; i++) { + var element = elements[i] + if (element in b.elements) { + intersection.push(element) + } + } + + return new lunr.Set (intersection) +} + +/** + * Returns a new set combining the elements of this and the specified set. + * + * @param {lunr.Set} other - set to union with this set. + * @return {lunr.Set} a new set that is the union of this and the specified set. + */ + +lunr.Set.prototype.union = function (other) { + if (other === lunr.Set.complete) { + return lunr.Set.complete + } + + if (other === lunr.Set.empty) { + return this + } + + return new lunr.Set(Object.keys(this.elements).concat(Object.keys(other.elements))) +} +/** + * A function to calculate the inverse document frequency for + * a posting. This is shared between the builder and the index + * + * @private + * @param {object} posting - The posting for a given term + * @param {number} documentCount - The total number of documents. + */ +lunr.idf = function (posting, documentCount) { + var documentsWithTerm = 0 + + for (var fieldName in posting) { + if (fieldName == '_index') continue // Ignore the term index, its not a field + documentsWithTerm += Object.keys(posting[fieldName]).length + } + + var x = (documentCount - documentsWithTerm + 0.5) / (documentsWithTerm + 0.5) + + return Math.log(1 + Math.abs(x)) +} + +/** + * A token wraps a string representation of a token + * as it is passed through the text processing pipeline. + * + * @constructor + * @param {string} [str=''] - The string token being wrapped. + * @param {object} [metadata={}] - Metadata associated with this token. + */ +lunr.Token = function (str, metadata) { + this.str = str || "" + this.metadata = metadata || {} +} + +/** + * Returns the token string that is being wrapped by this object. + * + * @returns {string} + */ +lunr.Token.prototype.toString = function () { + return this.str +} + +/** + * A token update function is used when updating or optionally + * when cloning a token. + * + * @callback lunr.Token~updateFunction + * @param {string} str - The string representation of the token. + * @param {Object} metadata - All metadata associated with this token. + */ + +/** + * Applies the given function to the wrapped string token. + * + * @example + * token.update(function (str, metadata) { + * return str.toUpperCase() + * }) + * + * @param {lunr.Token~updateFunction} fn - A function to apply to the token string. + * @returns {lunr.Token} + */ +lunr.Token.prototype.update = function (fn) { + this.str = fn(this.str, this.metadata) + return this +} + +/** + * Creates a clone of this token. Optionally a function can be + * applied to the cloned token. + * + * @param {lunr.Token~updateFunction} [fn] - An optional function to apply to the cloned token. + * @returns {lunr.Token} + */ +lunr.Token.prototype.clone = function (fn) { + fn = fn || function (s) { return s } + return new lunr.Token (fn(this.str, this.metadata), this.metadata) +} +/*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A function for splitting a string into tokens ready to be inserted into + * the search index. Uses `lunr.tokenizer.separator` to split strings, change + * the value of this property to change how strings are split into tokens. + * + * This tokenizer will convert its parameter to a string by calling `toString` and + * then will split this string on the character in `lunr.tokenizer.separator`. + * Arrays will have their elements converted to strings and wrapped in a lunr.Token. + * + * Optional metadata can be passed to the tokenizer, this metadata will be cloned and + * added as metadata to every token that is created from the object to be tokenized. + * + * @static + * @param {?(string|object|object[])} obj - The object to convert into tokens + * @param {?object} metadata - Optional metadata to associate with every token + * @returns {lunr.Token[]} + * @see {@link lunr.Pipeline} + */ +lunr.tokenizer = function (obj, metadata) { + if (obj == null || obj == undefined) { + return [] + } + + if (Array.isArray(obj)) { + return obj.map(function (t) { + return new lunr.Token( + lunr.utils.asString(t).toLowerCase(), + lunr.utils.clone(metadata) + ) + }) + } + + var str = obj.toString().toLowerCase(), + len = str.length, + tokens = [] + + for (var sliceEnd = 0, sliceStart = 0; sliceEnd <= len; sliceEnd++) { + var char = str.charAt(sliceEnd), + sliceLength = sliceEnd - sliceStart + + if ((char.match(lunr.tokenizer.separator) || sliceEnd == len)) { + + if (sliceLength > 0) { + var tokenMetadata = lunr.utils.clone(metadata) || {} + tokenMetadata["position"] = [sliceStart, sliceLength] + tokenMetadata["index"] = tokens.length + + tokens.push( + new lunr.Token ( + str.slice(sliceStart, sliceEnd), + tokenMetadata + ) + ) + } + + sliceStart = sliceEnd + 1 + } + + } + + return tokens +} + +/** + * The separator used to split a string into tokens. Override this property to change the behaviour of + * `lunr.tokenizer` behaviour when tokenizing strings. By default this splits on whitespace and hyphens. + * + * @static + * @see lunr.tokenizer + */ +lunr.tokenizer.separator = /[\s\-]+/ +/*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * lunr.Pipelines maintain an ordered list of functions to be applied to all + * tokens in documents entering the search index and queries being ran against + * the index. + * + * An instance of lunr.Index created with the lunr shortcut will contain a + * pipeline with a stop word filter and an English language stemmer. Extra + * functions can be added before or after either of these functions or these + * default functions can be removed. + * + * When run the pipeline will call each function in turn, passing a token, the + * index of that token in the original list of all tokens and finally a list of + * all the original tokens. + * + * The output of functions in the pipeline will be passed to the next function + * in the pipeline. To exclude a token from entering the index the function + * should return undefined, the rest of the pipeline will not be called with + * this token. + * + * For serialisation of pipelines to work, all functions used in an instance of + * a pipeline should be registered with lunr.Pipeline. Registered functions can + * then be loaded. If trying to load a serialised pipeline that uses functions + * that are not registered an error will be thrown. + * + * If not planning on serialising the pipeline then registering pipeline functions + * is not necessary. + * + * @constructor + */ +lunr.Pipeline = function () { + this._stack = [] +} + +lunr.Pipeline.registeredFunctions = Object.create(null) + +/** + * A pipeline function maps lunr.Token to lunr.Token. A lunr.Token contains the token + * string as well as all known metadata. A pipeline function can mutate the token string + * or mutate (or add) metadata for a given token. + * + * A pipeline function can indicate that the passed token should be discarded by returning + * null, undefined or an empty string. This token will not be passed to any downstream pipeline + * functions and will not be added to the index. + * + * Multiple tokens can be returned by returning an array of tokens. Each token will be passed + * to any downstream pipeline functions and all will returned tokens will be added to the index. + * + * Any number of pipeline functions may be chained together using a lunr.Pipeline. + * + * @interface lunr.PipelineFunction + * @param {lunr.Token} token - A token from the document being processed. + * @param {number} i - The index of this token in the complete list of tokens for this document/field. + * @param {lunr.Token[]} tokens - All tokens for this document/field. + * @returns {(?lunr.Token|lunr.Token[])} + */ + +/** + * Register a function with the pipeline. + * + * Functions that are used in the pipeline should be registered if the pipeline + * needs to be serialised, or a serialised pipeline needs to be loaded. + * + * Registering a function does not add it to a pipeline, functions must still be + * added to instances of the pipeline for them to be used when running a pipeline. + * + * @param {lunr.PipelineFunction} fn - The function to check for. + * @param {String} label - The label to register this function with + */ +lunr.Pipeline.registerFunction = function (fn, label) { + if (label in this.registeredFunctions) { + lunr.utils.warn('Overwriting existing registered function: ' + label) + } + + fn.label = label + lunr.Pipeline.registeredFunctions[fn.label] = fn +} + +/** + * Warns if the function is not registered as a Pipeline function. + * + * @param {lunr.PipelineFunction} fn - The function to check for. + * @private + */ +lunr.Pipeline.warnIfFunctionNotRegistered = function (fn) { + var isRegistered = fn.label && (fn.label in this.registeredFunctions) + + if (!isRegistered) { + lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\n', fn) + } +} + +/** + * Loads a previously serialised pipeline. + * + * All functions to be loaded must already be registered with lunr.Pipeline. + * If any function from the serialised data has not been registered then an + * error will be thrown. + * + * @param {Object} serialised - The serialised pipeline to load. + * @returns {lunr.Pipeline} + */ +lunr.Pipeline.load = function (serialised) { + var pipeline = new lunr.Pipeline + + serialised.forEach(function (fnName) { + var fn = lunr.Pipeline.registeredFunctions[fnName] + + if (fn) { + pipeline.add(fn) + } else { + throw new Error('Cannot load unregistered function: ' + fnName) + } + }) + + return pipeline +} + +/** + * Adds new functions to the end of the pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction[]} functions - Any number of functions to add to the pipeline. + */ +lunr.Pipeline.prototype.add = function () { + var fns = Array.prototype.slice.call(arguments) + + fns.forEach(function (fn) { + lunr.Pipeline.warnIfFunctionNotRegistered(fn) + this._stack.push(fn) + }, this) +} + +/** + * Adds a single function after a function that already exists in the + * pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. + * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. + */ +lunr.Pipeline.prototype.after = function (existingFn, newFn) { + lunr.Pipeline.warnIfFunctionNotRegistered(newFn) + + var pos = this._stack.indexOf(existingFn) + if (pos == -1) { + throw new Error('Cannot find existingFn') + } + + pos = pos + 1 + this._stack.splice(pos, 0, newFn) +} + +/** + * Adds a single function before a function that already exists in the + * pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. + * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. + */ +lunr.Pipeline.prototype.before = function (existingFn, newFn) { + lunr.Pipeline.warnIfFunctionNotRegistered(newFn) + + var pos = this._stack.indexOf(existingFn) + if (pos == -1) { + throw new Error('Cannot find existingFn') + } + + this._stack.splice(pos, 0, newFn) +} + +/** + * Removes a function from the pipeline. + * + * @param {lunr.PipelineFunction} fn The function to remove from the pipeline. + */ +lunr.Pipeline.prototype.remove = function (fn) { + var pos = this._stack.indexOf(fn) + if (pos == -1) { + return + } + + this._stack.splice(pos, 1) +} + +/** + * Runs the current list of functions that make up the pipeline against the + * passed tokens. + * + * @param {Array} tokens The tokens to run through the pipeline. + * @returns {Array} + */ +lunr.Pipeline.prototype.run = function (tokens) { + var stackLength = this._stack.length + + for (var i = 0; i < stackLength; i++) { + var fn = this._stack[i] + var memo = [] + + for (var j = 0; j < tokens.length; j++) { + var result = fn(tokens[j], j, tokens) + + if (result === null || result === void 0 || result === '') continue + + if (Array.isArray(result)) { + for (var k = 0; k < result.length; k++) { + memo.push(result[k]) + } + } else { + memo.push(result) + } + } + + tokens = memo + } + + return tokens +} + +/** + * Convenience method for passing a string through a pipeline and getting + * strings out. This method takes care of wrapping the passed string in a + * token and mapping the resulting tokens back to strings. + * + * @param {string} str - The string to pass through the pipeline. + * @param {?object} metadata - Optional metadata to associate with the token + * passed to the pipeline. + * @returns {string[]} + */ +lunr.Pipeline.prototype.runString = function (str, metadata) { + var token = new lunr.Token (str, metadata) + + return this.run([token]).map(function (t) { + return t.toString() + }) +} + +/** + * Resets the pipeline by removing any existing processors. + * + */ +lunr.Pipeline.prototype.reset = function () { + this._stack = [] +} + +/** + * Returns a representation of the pipeline ready for serialisation. + * + * Logs a warning if the function has not been registered. + * + * @returns {Array} + */ +lunr.Pipeline.prototype.toJSON = function () { + return this._stack.map(function (fn) { + lunr.Pipeline.warnIfFunctionNotRegistered(fn) + + return fn.label + }) +} +/*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A vector is used to construct the vector space of documents and queries. These + * vectors support operations to determine the similarity between two documents or + * a document and a query. + * + * Normally no parameters are required for initializing a vector, but in the case of + * loading a previously dumped vector the raw elements can be provided to the constructor. + * + * For performance reasons vectors are implemented with a flat array, where an elements + * index is immediately followed by its value. E.g. [index, value, index, value]. This + * allows the underlying array to be as sparse as possible and still offer decent + * performance when being used for vector calculations. + * + * @constructor + * @param {Number[]} [elements] - The flat list of element index and element value pairs. + */ +lunr.Vector = function (elements) { + this._magnitude = 0 + this.elements = elements || [] +} + + +/** + * Calculates the position within the vector to insert a given index. + * + * This is used internally by insert and upsert. If there are duplicate indexes then + * the position is returned as if the value for that index were to be updated, but it + * is the callers responsibility to check whether there is a duplicate at that index + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @returns {Number} + */ +lunr.Vector.prototype.positionForIndex = function (index) { + // For an empty vector the tuple can be inserted at the beginning + if (this.elements.length == 0) { + return 0 + } + + var start = 0, + end = this.elements.length / 2, + sliceLength = end - start, + pivotPoint = Math.floor(sliceLength / 2), + pivotIndex = this.elements[pivotPoint * 2] + + while (sliceLength > 1) { + if (pivotIndex < index) { + start = pivotPoint + } + + if (pivotIndex > index) { + end = pivotPoint + } + + if (pivotIndex == index) { + break + } + + sliceLength = end - start + pivotPoint = start + Math.floor(sliceLength / 2) + pivotIndex = this.elements[pivotPoint * 2] + } + + if (pivotIndex == index) { + return pivotPoint * 2 + } + + if (pivotIndex > index) { + return pivotPoint * 2 + } + + if (pivotIndex < index) { + return (pivotPoint + 1) * 2 + } +} + +/** + * Inserts an element at an index within the vector. + * + * Does not allow duplicates, will throw an error if there is already an entry + * for this index. + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @param {Number} val - The value to be inserted into the vector. + */ +lunr.Vector.prototype.insert = function (insertIdx, val) { + this.upsert(insertIdx, val, function () { + throw "duplicate index" + }) +} + +/** + * Inserts or updates an existing index within the vector. + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @param {Number} val - The value to be inserted into the vector. + * @param {function} fn - A function that is called for updates, the existing value and the + * requested value are passed as arguments + */ +lunr.Vector.prototype.upsert = function (insertIdx, val, fn) { + this._magnitude = 0 + var position = this.positionForIndex(insertIdx) + + if (this.elements[position] == insertIdx) { + this.elements[position + 1] = fn(this.elements[position + 1], val) + } else { + this.elements.splice(position, 0, insertIdx, val) + } +} + +/** + * Calculates the magnitude of this vector. + * + * @returns {Number} + */ +lunr.Vector.prototype.magnitude = function () { + if (this._magnitude) return this._magnitude + + var sumOfSquares = 0, + elementsLength = this.elements.length + + for (var i = 1; i < elementsLength; i += 2) { + var val = this.elements[i] + sumOfSquares += val * val + } + + return this._magnitude = Math.sqrt(sumOfSquares) +} + +/** + * Calculates the dot product of this vector and another vector. + * + * @param {lunr.Vector} otherVector - The vector to compute the dot product with. + * @returns {Number} + */ +lunr.Vector.prototype.dot = function (otherVector) { + var dotProduct = 0, + a = this.elements, b = otherVector.elements, + aLen = a.length, bLen = b.length, + aVal = 0, bVal = 0, + i = 0, j = 0 + + while (i < aLen && j < bLen) { + aVal = a[i], bVal = b[j] + if (aVal < bVal) { + i += 2 + } else if (aVal > bVal) { + j += 2 + } else if (aVal == bVal) { + dotProduct += a[i + 1] * b[j + 1] + i += 2 + j += 2 + } + } + + return dotProduct +} + +/** + * Calculates the similarity between this vector and another vector. + * + * @param {lunr.Vector} otherVector - The other vector to calculate the + * similarity with. + * @returns {Number} + */ +lunr.Vector.prototype.similarity = function (otherVector) { + return this.dot(otherVector) / this.magnitude() || 0 +} + +/** + * Converts the vector to an array of the elements within the vector. + * + * @returns {Number[]} + */ +lunr.Vector.prototype.toArray = function () { + var output = new Array (this.elements.length / 2) + + for (var i = 1, j = 0; i < this.elements.length; i += 2, j++) { + output[j] = this.elements[i] + } + + return output +} + +/** + * A JSON serializable representation of the vector. + * + * @returns {Number[]} + */ +lunr.Vector.prototype.toJSON = function () { + return this.elements +} +/* eslint-disable */ +/*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + */ + +/** + * lunr.stemmer is an english language stemmer, this is a JavaScript + * implementation of the PorterStemmer taken from http://tartarus.org/~martin + * + * @static + * @implements {lunr.PipelineFunction} + * @param {lunr.Token} token - The string to stem + * @returns {lunr.Token} + * @see {@link lunr.Pipeline} + * @function + */ +lunr.stemmer = (function(){ + var step2list = { + "ational" : "ate", + "tional" : "tion", + "enci" : "ence", + "anci" : "ance", + "izer" : "ize", + "bli" : "ble", + "alli" : "al", + "entli" : "ent", + "eli" : "e", + "ousli" : "ous", + "ization" : "ize", + "ation" : "ate", + "ator" : "ate", + "alism" : "al", + "iveness" : "ive", + "fulness" : "ful", + "ousness" : "ous", + "aliti" : "al", + "iviti" : "ive", + "biliti" : "ble", + "logi" : "log" + }, + + step3list = { + "icate" : "ic", + "ative" : "", + "alize" : "al", + "iciti" : "ic", + "ical" : "ic", + "ful" : "", + "ness" : "" + }, + + c = "[^aeiou]", // consonant + v = "[aeiouy]", // vowel + C = c + "[^aeiouy]*", // consonant sequence + V = v + "[aeiou]*", // vowel sequence + + mgr0 = "^(" + C + ")?" + V + C, // [C]VC... is m>0 + meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$", // [C]VC[V] is m=1 + mgr1 = "^(" + C + ")?" + V + C + V + C, // [C]VCVC... is m>1 + s_v = "^(" + C + ")?" + v; // vowel in stem + + var re_mgr0 = new RegExp(mgr0); + var re_mgr1 = new RegExp(mgr1); + var re_meq1 = new RegExp(meq1); + var re_s_v = new RegExp(s_v); + + var re_1a = /^(.+?)(ss|i)es$/; + var re2_1a = /^(.+?)([^s])s$/; + var re_1b = /^(.+?)eed$/; + var re2_1b = /^(.+?)(ed|ing)$/; + var re_1b_2 = /.$/; + var re2_1b_2 = /(at|bl|iz)$/; + var re3_1b_2 = new RegExp("([^aeiouylsz])\\1$"); + var re4_1b_2 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + + var re_1c = /^(.+?[^aeiou])y$/; + var re_2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + + var re_3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + + var re_4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + var re2_4 = /^(.+?)(s|t)(ion)$/; + + var re_5 = /^(.+?)e$/; + var re_5_1 = /ll$/; + var re3_5 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + + var porterStemmer = function porterStemmer(w) { + var stem, + suffix, + firstch, + re, + re2, + re3, + re4; + + if (w.length < 3) { return w; } + + firstch = w.substr(0,1); + if (firstch == "y") { + w = firstch.toUpperCase() + w.substr(1); + } + + // Step 1a + re = re_1a + re2 = re2_1a; + + if (re.test(w)) { w = w.replace(re,"$1$2"); } + else if (re2.test(w)) { w = w.replace(re2,"$1$2"); } + + // Step 1b + re = re_1b; + re2 = re2_1b; + if (re.test(w)) { + var fp = re.exec(w); + re = re_mgr0; + if (re.test(fp[1])) { + re = re_1b_2; + w = w.replace(re,""); + } + } else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = re_s_v; + if (re2.test(stem)) { + w = stem; + re2 = re2_1b_2; + re3 = re3_1b_2; + re4 = re4_1b_2; + if (re2.test(w)) { w = w + "e"; } + else if (re3.test(w)) { re = re_1b_2; w = w.replace(re,""); } + else if (re4.test(w)) { w = w + "e"; } + } + } + + // Step 1c - replace suffix y or Y by i if preceded by a non-vowel which is not the first letter of the word (so cry -> cri, by -> by, say -> say) + re = re_1c; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem + "i"; + } + + // Step 2 + re = re_2; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = re_mgr0; + if (re.test(stem)) { + w = stem + step2list[suffix]; + } + } + + // Step 3 + re = re_3; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = re_mgr0; + if (re.test(stem)) { + w = stem + step3list[suffix]; + } + } + + // Step 4 + re = re_4; + re2 = re2_4; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = re_mgr1; + if (re.test(stem)) { + w = stem; + } + } else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = re_mgr1; + if (re2.test(stem)) { + w = stem; + } + } + + // Step 5 + re = re_5; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = re_mgr1; + re2 = re_meq1; + re3 = re3_5; + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) { + w = stem; + } + } + + re = re_5_1; + re2 = re_mgr1; + if (re.test(w) && re2.test(w)) { + re = re_1b_2; + w = w.replace(re,""); + } + + // and turn initial Y back to y + + if (firstch == "y") { + w = firstch.toLowerCase() + w.substr(1); + } + + return w; + }; + + return function (token) { + return token.update(porterStemmer); + } +})(); + +lunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer') +/*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * lunr.generateStopWordFilter builds a stopWordFilter function from the provided + * list of stop words. + * + * The built in lunr.stopWordFilter is built using this generator and can be used + * to generate custom stopWordFilters for applications or non English languages. + * + * @function + * @param {Array} token The token to pass through the filter + * @returns {lunr.PipelineFunction} + * @see lunr.Pipeline + * @see lunr.stopWordFilter + */ +lunr.generateStopWordFilter = function (stopWords) { + var words = stopWords.reduce(function (memo, stopWord) { + memo[stopWord] = stopWord + return memo + }, {}) + + return function (token) { + if (token && words[token.toString()] !== token.toString()) return token + } +} + +/** + * lunr.stopWordFilter is an English language stop word list filter, any words + * contained in the list will not be passed through the filter. + * + * This is intended to be used in the Pipeline. If the token does not pass the + * filter then undefined will be returned. + * + * @function + * @implements {lunr.PipelineFunction} + * @params {lunr.Token} token - A token to check for being a stop word. + * @returns {lunr.Token} + * @see {@link lunr.Pipeline} + */ +lunr.stopWordFilter = lunr.generateStopWordFilter([ + 'a', + 'able', + 'about', + 'across', + 'after', + 'all', + 'almost', + 'also', + 'am', + 'among', + 'an', + 'and', + 'any', + 'are', + 'as', + 'at', + 'be', + 'because', + 'been', + 'but', + 'by', + 'can', + 'cannot', + 'could', + 'dear', + 'did', + 'do', + 'does', + 'either', + 'else', + 'ever', + 'every', + 'for', + 'from', + 'get', + 'got', + 'had', + 'has', + 'have', + 'he', + 'her', + 'hers', + 'him', + 'his', + 'how', + 'however', + 'i', + 'if', + 'in', + 'into', + 'is', + 'it', + 'its', + 'just', + 'least', + 'let', + 'like', + 'likely', + 'may', + 'me', + 'might', + 'most', + 'must', + 'my', + 'neither', + 'no', + 'nor', + 'not', + 'of', + 'off', + 'often', + 'on', + 'only', + 'or', + 'other', + 'our', + 'own', + 'rather', + 'said', + 'say', + 'says', + 'she', + 'should', + 'since', + 'so', + 'some', + 'than', + 'that', + 'the', + 'their', + 'them', + 'then', + 'there', + 'these', + 'they', + 'this', + 'tis', + 'to', + 'too', + 'twas', + 'us', + 'wants', + 'was', + 'we', + 'were', + 'what', + 'when', + 'where', + 'which', + 'while', + 'who', + 'whom', + 'why', + 'will', + 'with', + 'would', + 'yet', + 'you', + 'your' +]) + +lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter') +/*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * lunr.trimmer is a pipeline function for trimming non word + * characters from the beginning and end of tokens before they + * enter the index. + * + * This implementation may not work correctly for non latin + * characters and should either be removed or adapted for use + * with languages with non-latin characters. + * + * @static + * @implements {lunr.PipelineFunction} + * @param {lunr.Token} token The token to pass through the filter + * @returns {lunr.Token} + * @see lunr.Pipeline + */ +lunr.trimmer = function (token) { + return token.update(function (s) { + return s.replace(/^\W+/, '').replace(/\W+$/, '') + }) +} + +lunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer') +/*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A token set is used to store the unique list of all tokens + * within an index. Token sets are also used to represent an + * incoming query to the index, this query token set and index + * token set are then intersected to find which tokens to look + * up in the inverted index. + * + * A token set can hold multiple tokens, as in the case of the + * index token set, or it can hold a single token as in the + * case of a simple query token set. + * + * Additionally token sets are used to perform wildcard matching. + * Leading, contained and trailing wildcards are supported, and + * from this edit distance matching can also be provided. + * + * Token sets are implemented as a minimal finite state automata, + * where both common prefixes and suffixes are shared between tokens. + * This helps to reduce the space used for storing the token set. + * + * @constructor + */ +lunr.TokenSet = function () { + this.final = false + this.edges = {} + this.id = lunr.TokenSet._nextId + lunr.TokenSet._nextId += 1 +} + +/** + * Keeps track of the next, auto increment, identifier to assign + * to a new tokenSet. + * + * TokenSets require a unique identifier to be correctly minimised. + * + * @private + */ +lunr.TokenSet._nextId = 1 + +/** + * Creates a TokenSet instance from the given sorted array of words. + * + * @param {String[]} arr - A sorted array of strings to create the set from. + * @returns {lunr.TokenSet} + * @throws Will throw an error if the input array is not sorted. + */ +lunr.TokenSet.fromArray = function (arr) { + var builder = new lunr.TokenSet.Builder + + for (var i = 0, len = arr.length; i < len; i++) { + builder.insert(arr[i]) + } + + builder.finish() + return builder.root +} + +/** + * Creates a token set from a query clause. + * + * @private + * @param {Object} clause - A single clause from lunr.Query. + * @param {string} clause.term - The query clause term. + * @param {number} [clause.editDistance] - The optional edit distance for the term. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.fromClause = function (clause) { + if ('editDistance' in clause) { + return lunr.TokenSet.fromFuzzyString(clause.term, clause.editDistance) + } else { + return lunr.TokenSet.fromString(clause.term) + } +} + +/** + * Creates a token set representing a single string with a specified + * edit distance. + * + * Insertions, deletions, substitutions and transpositions are each + * treated as an edit distance of 1. + * + * Increasing the allowed edit distance will have a dramatic impact + * on the performance of both creating and intersecting these TokenSets. + * It is advised to keep the edit distance less than 3. + * + * @param {string} str - The string to create the token set from. + * @param {number} editDistance - The allowed edit distance to match. + * @returns {lunr.Vector} + */ +lunr.TokenSet.fromFuzzyString = function (str, editDistance) { + var root = new lunr.TokenSet + + var stack = [{ + node: root, + editsRemaining: editDistance, + str: str + }] + + while (stack.length) { + var frame = stack.pop() + + // no edit + if (frame.str.length > 0) { + var char = frame.str.charAt(0), + noEditNode + + if (char in frame.node.edges) { + noEditNode = frame.node.edges[char] + } else { + noEditNode = new lunr.TokenSet + frame.node.edges[char] = noEditNode + } + + if (frame.str.length == 1) { + noEditNode.final = true + } + + stack.push({ + node: noEditNode, + editsRemaining: frame.editsRemaining, + str: frame.str.slice(1) + }) + } + + if (frame.editsRemaining == 0) { + continue + } + + // insertion + if ("*" in frame.node.edges) { + var insertionNode = frame.node.edges["*"] + } else { + var insertionNode = new lunr.TokenSet + frame.node.edges["*"] = insertionNode + } + + if (frame.str.length == 0) { + insertionNode.final = true + } + + stack.push({ + node: insertionNode, + editsRemaining: frame.editsRemaining - 1, + str: frame.str + }) + + // deletion + // can only do a deletion if we have enough edits remaining + // and if there are characters left to delete in the string + if (frame.str.length > 1) { + stack.push({ + node: frame.node, + editsRemaining: frame.editsRemaining - 1, + str: frame.str.slice(1) + }) + } + + // deletion + // just removing the last character from the str + if (frame.str.length == 1) { + frame.node.final = true + } + + // substitution + // can only do a substitution if we have enough edits remaining + // and if there are characters left to substitute + if (frame.str.length >= 1) { + if ("*" in frame.node.edges) { + var substitutionNode = frame.node.edges["*"] + } else { + var substitutionNode = new lunr.TokenSet + frame.node.edges["*"] = substitutionNode + } + + if (frame.str.length == 1) { + substitutionNode.final = true + } + + stack.push({ + node: substitutionNode, + editsRemaining: frame.editsRemaining - 1, + str: frame.str.slice(1) + }) + } + + // transposition + // can only do a transposition if there are edits remaining + // and there are enough characters to transpose + if (frame.str.length > 1) { + var charA = frame.str.charAt(0), + charB = frame.str.charAt(1), + transposeNode + + if (charB in frame.node.edges) { + transposeNode = frame.node.edges[charB] + } else { + transposeNode = new lunr.TokenSet + frame.node.edges[charB] = transposeNode + } + + if (frame.str.length == 1) { + transposeNode.final = true + } + + stack.push({ + node: transposeNode, + editsRemaining: frame.editsRemaining - 1, + str: charA + frame.str.slice(2) + }) + } + } + + return root +} + +/** + * Creates a TokenSet from a string. + * + * The string may contain one or more wildcard characters (*) + * that will allow wildcard matching when intersecting with + * another TokenSet. + * + * @param {string} str - The string to create a TokenSet from. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.fromString = function (str) { + var node = new lunr.TokenSet, + root = node + + /* + * Iterates through all characters within the passed string + * appending a node for each character. + * + * When a wildcard character is found then a self + * referencing edge is introduced to continually match + * any number of any characters. + */ + for (var i = 0, len = str.length; i < len; i++) { + var char = str[i], + final = (i == len - 1) + + if (char == "*") { + node.edges[char] = node + node.final = final + + } else { + var next = new lunr.TokenSet + next.final = final + + node.edges[char] = next + node = next + } + } + + return root +} + +/** + * Converts this TokenSet into an array of strings + * contained within the TokenSet. + * + * This is not intended to be used on a TokenSet that + * contains wildcards, in these cases the results are + * undefined and are likely to cause an infinite loop. + * + * @returns {string[]} + */ +lunr.TokenSet.prototype.toArray = function () { + var words = [] + + var stack = [{ + prefix: "", + node: this + }] + + while (stack.length) { + var frame = stack.pop(), + edges = Object.keys(frame.node.edges), + len = edges.length + + if (frame.node.final) { + /* In Safari, at this point the prefix is sometimes corrupted, see: + * https://github.com/olivernn/lunr.js/issues/279 Calling any + * String.prototype method forces Safari to "cast" this string to what + * it's supposed to be, fixing the bug. */ + frame.prefix.charAt(0) + words.push(frame.prefix) + } + + for (var i = 0; i < len; i++) { + var edge = edges[i] + + stack.push({ + prefix: frame.prefix.concat(edge), + node: frame.node.edges[edge] + }) + } + } + + return words +} + +/** + * Generates a string representation of a TokenSet. + * + * This is intended to allow TokenSets to be used as keys + * in objects, largely to aid the construction and minimisation + * of a TokenSet. As such it is not designed to be a human + * friendly representation of the TokenSet. + * + * @returns {string} + */ +lunr.TokenSet.prototype.toString = function () { + // NOTE: Using Object.keys here as this.edges is very likely + // to enter 'hash-mode' with many keys being added + // + // avoiding a for-in loop here as it leads to the function + // being de-optimised (at least in V8). From some simple + // benchmarks the performance is comparable, but allowing + // V8 to optimize may mean easy performance wins in the future. + + if (this._str) { + return this._str + } + + var str = this.final ? '1' : '0', + labels = Object.keys(this.edges).sort(), + len = labels.length + + for (var i = 0; i < len; i++) { + var label = labels[i], + node = this.edges[label] + + str = str + label + node.id + } + + return str +} + +/** + * Returns a new TokenSet that is the intersection of + * this TokenSet and the passed TokenSet. + * + * This intersection will take into account any wildcards + * contained within the TokenSet. + * + * @param {lunr.TokenSet} b - An other TokenSet to intersect with. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.prototype.intersect = function (b) { + var output = new lunr.TokenSet, + frame = undefined + + var stack = [{ + qNode: b, + output: output, + node: this + }] + + while (stack.length) { + frame = stack.pop() + + // NOTE: As with the #toString method, we are using + // Object.keys and a for loop instead of a for-in loop + // as both of these objects enter 'hash' mode, causing + // the function to be de-optimised in V8 + var qEdges = Object.keys(frame.qNode.edges), + qLen = qEdges.length, + nEdges = Object.keys(frame.node.edges), + nLen = nEdges.length + + for (var q = 0; q < qLen; q++) { + var qEdge = qEdges[q] + + for (var n = 0; n < nLen; n++) { + var nEdge = nEdges[n] + + if (nEdge == qEdge || qEdge == '*') { + var node = frame.node.edges[nEdge], + qNode = frame.qNode.edges[qEdge], + final = node.final && qNode.final, + next = undefined + + if (nEdge in frame.output.edges) { + // an edge already exists for this character + // no need to create a new node, just set the finality + // bit unless this node is already final + next = frame.output.edges[nEdge] + next.final = next.final || final + + } else { + // no edge exists yet, must create one + // set the finality bit and insert it + // into the output + next = new lunr.TokenSet + next.final = final + frame.output.edges[nEdge] = next + } + + stack.push({ + qNode: qNode, + output: next, + node: node + }) + } + } + } + } + + return output +} +lunr.TokenSet.Builder = function () { + this.previousWord = "" + this.root = new lunr.TokenSet + this.uncheckedNodes = [] + this.minimizedNodes = {} +} + +lunr.TokenSet.Builder.prototype.insert = function (word) { + var node, + commonPrefix = 0 + + if (word < this.previousWord) { + throw new Error ("Out of order word insertion") + } + + for (var i = 0; i < word.length && i < this.previousWord.length; i++) { + if (word[i] != this.previousWord[i]) break + commonPrefix++ + } + + this.minimize(commonPrefix) + + if (this.uncheckedNodes.length == 0) { + node = this.root + } else { + node = this.uncheckedNodes[this.uncheckedNodes.length - 1].child + } + + for (var i = commonPrefix; i < word.length; i++) { + var nextNode = new lunr.TokenSet, + char = word[i] + + node.edges[char] = nextNode + + this.uncheckedNodes.push({ + parent: node, + char: char, + child: nextNode + }) + + node = nextNode + } + + node.final = true + this.previousWord = word +} + +lunr.TokenSet.Builder.prototype.finish = function () { + this.minimize(0) +} + +lunr.TokenSet.Builder.prototype.minimize = function (downTo) { + for (var i = this.uncheckedNodes.length - 1; i >= downTo; i--) { + var node = this.uncheckedNodes[i], + childKey = node.child.toString() + + if (childKey in this.minimizedNodes) { + node.parent.edges[node.char] = this.minimizedNodes[childKey] + } else { + // Cache the key for this node since + // we know it can't change anymore + node.child._str = childKey + + this.minimizedNodes[childKey] = node.child + } + + this.uncheckedNodes.pop() + } +} +/*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * An index contains the built index of all documents and provides a query interface + * to the index. + * + * Usually instances of lunr.Index will not be created using this constructor, instead + * lunr.Builder should be used to construct new indexes, or lunr.Index.load should be + * used to load previously built and serialized indexes. + * + * @constructor + * @param {Object} attrs - The attributes of the built search index. + * @param {Object} attrs.invertedIndex - An index of term/field to document reference. + * @param {Object} attrs.fieldVectors - Field vectors + * @param {lunr.TokenSet} attrs.tokenSet - An set of all corpus tokens. + * @param {string[]} attrs.fields - The names of indexed document fields. + * @param {lunr.Pipeline} attrs.pipeline - The pipeline to use for search terms. + */ +lunr.Index = function (attrs) { + this.invertedIndex = attrs.invertedIndex + this.fieldVectors = attrs.fieldVectors + this.tokenSet = attrs.tokenSet + this.fields = attrs.fields + this.pipeline = attrs.pipeline +} + +/** + * A result contains details of a document matching a search query. + * @typedef {Object} lunr.Index~Result + * @property {string} ref - The reference of the document this result represents. + * @property {number} score - A number between 0 and 1 representing how similar this document is to the query. + * @property {lunr.MatchData} matchData - Contains metadata about this match including which term(s) caused the match. + */ + +/** + * Although lunr provides the ability to create queries using lunr.Query, it also provides a simple + * query language which itself is parsed into an instance of lunr.Query. + * + * For programmatically building queries it is advised to directly use lunr.Query, the query language + * is best used for human entered text rather than program generated text. + * + * At its simplest queries can just be a single term, e.g. `hello`, multiple terms are also supported + * and will be combined with OR, e.g `hello world` will match documents that contain either 'hello' + * or 'world', though those that contain both will rank higher in the results. + * + * Wildcards can be included in terms to match one or more unspecified characters, these wildcards can + * be inserted anywhere within the term, and more than one wildcard can exist in a single term. Adding + * wildcards will increase the number of documents that will be found but can also have a negative + * impact on query performance, especially with wildcards at the beginning of a term. + * + * Terms can be restricted to specific fields, e.g. `title:hello`, only documents with the term + * hello in the title field will match this query. Using a field not present in the index will lead + * to an error being thrown. + * + * Modifiers can also be added to terms, lunr supports edit distance and boost modifiers on terms. A term + * boost will make documents matching that term score higher, e.g. `foo^5`. Edit distance is also supported + * to provide fuzzy matching, e.g. 'hello~2' will match documents with hello with an edit distance of 2. + * Avoid large values for edit distance to improve query performance. + * + * Each term also supports a presence modifier. By default a term's presence in document is optional, however + * this can be changed to either required or prohibited. For a term's presence to be required in a document the + * term should be prefixed with a '+', e.g. `+foo bar` is a search for documents that must contain 'foo' and + * optionally contain 'bar'. Conversely a leading '-' sets the terms presence to prohibited, i.e. it must not + * appear in a document, e.g. `-foo bar` is a search for documents that do not contain 'foo' but may contain 'bar'. + * + * To escape special characters the backslash character '\' can be used, this allows searches to include + * characters that would normally be considered modifiers, e.g. `foo\~2` will search for a term "foo~2" instead + * of attempting to apply a boost of 2 to the search term "foo". + * + * @typedef {string} lunr.Index~QueryString + * @example Simple single term query + * hello + * @example Multiple term query + * hello world + * @example term scoped to a field + * title:hello + * @example term with a boost of 10 + * hello^10 + * @example term with an edit distance of 2 + * hello~2 + * @example terms with presence modifiers + * -foo +bar baz + */ + +/** + * Performs a search against the index using lunr query syntax. + * + * Results will be returned sorted by their score, the most relevant results + * will be returned first. For details on how the score is calculated, please see + * the {@link https://lunrjs.com/guides/searching.html#scoring|guide}. + * + * For more programmatic querying use lunr.Index#query. + * + * @param {lunr.Index~QueryString} queryString - A string containing a lunr query. + * @throws {lunr.QueryParseError} If the passed query string cannot be parsed. + * @returns {lunr.Index~Result[]} + */ +lunr.Index.prototype.search = function (queryString) { + return this.query(function (query) { + var parser = new lunr.QueryParser(queryString, query) + parser.parse() + }) +} + +/** + * A query builder callback provides a query object to be used to express + * the query to perform on the index. + * + * @callback lunr.Index~queryBuilder + * @param {lunr.Query} query - The query object to build up. + * @this lunr.Query + */ + +/** + * Performs a query against the index using the yielded lunr.Query object. + * + * If performing programmatic queries against the index, this method is preferred + * over lunr.Index#search so as to avoid the additional query parsing overhead. + * + * A query object is yielded to the supplied function which should be used to + * express the query to be run against the index. + * + * Note that although this function takes a callback parameter it is _not_ an + * asynchronous operation, the callback is just yielded a query object to be + * customized. + * + * @param {lunr.Index~queryBuilder} fn - A function that is used to build the query. + * @returns {lunr.Index~Result[]} + */ +lunr.Index.prototype.query = function (fn) { + // for each query clause + // * process terms + // * expand terms from token set + // * find matching documents and metadata + // * get document vectors + // * score documents + + var query = new lunr.Query(this.fields), + matchingFields = Object.create(null), + queryVectors = Object.create(null), + termFieldCache = Object.create(null), + requiredMatches = Object.create(null), + prohibitedMatches = Object.create(null) + + /* + * To support field level boosts a query vector is created per + * field. An empty vector is eagerly created to support negated + * queries. + */ + for (var i = 0; i < this.fields.length; i++) { + queryVectors[this.fields[i]] = new lunr.Vector + } + + fn.call(query, query) + + for (var i = 0; i < query.clauses.length; i++) { + /* + * Unless the pipeline has been disabled for this term, which is + * the case for terms with wildcards, we need to pass the clause + * term through the search pipeline. A pipeline returns an array + * of processed terms. Pipeline functions may expand the passed + * term, which means we may end up performing multiple index lookups + * for a single query term. + */ + var clause = query.clauses[i], + terms = null, + clauseMatches = lunr.Set.empty + + if (clause.usePipeline) { + terms = this.pipeline.runString(clause.term, { + fields: clause.fields + }) + } else { + terms = [clause.term] + } + + for (var m = 0; m < terms.length; m++) { + var term = terms[m] + + /* + * Each term returned from the pipeline needs to use the same query + * clause object, e.g. the same boost and or edit distance. The + * simplest way to do this is to re-use the clause object but mutate + * its term property. + */ + clause.term = term + + /* + * From the term in the clause we create a token set which will then + * be used to intersect the indexes token set to get a list of terms + * to lookup in the inverted index + */ + var termTokenSet = lunr.TokenSet.fromClause(clause), + expandedTerms = this.tokenSet.intersect(termTokenSet).toArray() + + /* + * If a term marked as required does not exist in the tokenSet it is + * impossible for the search to return any matches. We set all the field + * scoped required matches set to empty and stop examining any further + * clauses. + */ + if (expandedTerms.length === 0 && clause.presence === lunr.Query.presence.REQUIRED) { + for (var k = 0; k < clause.fields.length; k++) { + var field = clause.fields[k] + requiredMatches[field] = lunr.Set.empty + } + + break + } + + for (var j = 0; j < expandedTerms.length; j++) { + /* + * For each term get the posting and termIndex, this is required for + * building the query vector. + */ + var expandedTerm = expandedTerms[j], + posting = this.invertedIndex[expandedTerm], + termIndex = posting._index + + for (var k = 0; k < clause.fields.length; k++) { + /* + * For each field that this query term is scoped by (by default + * all fields are in scope) we need to get all the document refs + * that have this term in that field. + * + * The posting is the entry in the invertedIndex for the matching + * term from above. + */ + var field = clause.fields[k], + fieldPosting = posting[field], + matchingDocumentRefs = Object.keys(fieldPosting), + termField = expandedTerm + "/" + field, + matchingDocumentsSet = new lunr.Set(matchingDocumentRefs) + + /* + * if the presence of this term is required ensure that the matching + * documents are added to the set of required matches for this clause. + * + */ + if (clause.presence == lunr.Query.presence.REQUIRED) { + clauseMatches = clauseMatches.union(matchingDocumentsSet) + + if (requiredMatches[field] === undefined) { + requiredMatches[field] = lunr.Set.complete + } + } + + /* + * if the presence of this term is prohibited ensure that the matching + * documents are added to the set of prohibited matches for this field, + * creating that set if it does not yet exist. + */ + if (clause.presence == lunr.Query.presence.PROHIBITED) { + if (prohibitedMatches[field] === undefined) { + prohibitedMatches[field] = lunr.Set.empty + } + + prohibitedMatches[field] = prohibitedMatches[field].union(matchingDocumentsSet) + + /* + * Prohibited matches should not be part of the query vector used for + * similarity scoring and no metadata should be extracted so we continue + * to the next field + */ + continue + } + + /* + * The query field vector is populated using the termIndex found for + * the term and a unit value with the appropriate boost applied. + * Using upsert because there could already be an entry in the vector + * for the term we are working with. In that case we just add the scores + * together. + */ + queryVectors[field].upsert(termIndex, clause.boost, function (a, b) { return a + b }) + + /** + * If we've already seen this term, field combo then we've already collected + * the matching documents and metadata, no need to go through all that again + */ + if (termFieldCache[termField]) { + continue + } + + for (var l = 0; l < matchingDocumentRefs.length; l++) { + /* + * All metadata for this term/field/document triple + * are then extracted and collected into an instance + * of lunr.MatchData ready to be returned in the query + * results + */ + var matchingDocumentRef = matchingDocumentRefs[l], + matchingFieldRef = new lunr.FieldRef (matchingDocumentRef, field), + metadata = fieldPosting[matchingDocumentRef], + fieldMatch + + if ((fieldMatch = matchingFields[matchingFieldRef]) === undefined) { + matchingFields[matchingFieldRef] = new lunr.MatchData (expandedTerm, field, metadata) + } else { + fieldMatch.add(expandedTerm, field, metadata) + } + + } + + termFieldCache[termField] = true + } + } + } + + /** + * If the presence was required we need to update the requiredMatches field sets. + * We do this after all fields for the term have collected their matches because + * the clause terms presence is required in _any_ of the fields not _all_ of the + * fields. + */ + if (clause.presence === lunr.Query.presence.REQUIRED) { + for (var k = 0; k < clause.fields.length; k++) { + var field = clause.fields[k] + requiredMatches[field] = requiredMatches[field].intersect(clauseMatches) + } + } + } + + /** + * Need to combine the field scoped required and prohibited + * matching documents into a global set of required and prohibited + * matches + */ + var allRequiredMatches = lunr.Set.complete, + allProhibitedMatches = lunr.Set.empty + + for (var i = 0; i < this.fields.length; i++) { + var field = this.fields[i] + + if (requiredMatches[field]) { + allRequiredMatches = allRequiredMatches.intersect(requiredMatches[field]) + } + + if (prohibitedMatches[field]) { + allProhibitedMatches = allProhibitedMatches.union(prohibitedMatches[field]) + } + } + + var matchingFieldRefs = Object.keys(matchingFields), + results = [], + matches = Object.create(null) + + /* + * If the query is negated (contains only prohibited terms) + * we need to get _all_ fieldRefs currently existing in the + * index. This is only done when we know that the query is + * entirely prohibited terms to avoid any cost of getting all + * fieldRefs unnecessarily. + * + * Additionally, blank MatchData must be created to correctly + * populate the results. + */ + if (query.isNegated()) { + matchingFieldRefs = Object.keys(this.fieldVectors) + + for (var i = 0; i < matchingFieldRefs.length; i++) { + var matchingFieldRef = matchingFieldRefs[i] + var fieldRef = lunr.FieldRef.fromString(matchingFieldRef) + matchingFields[matchingFieldRef] = new lunr.MatchData + } + } + + for (var i = 0; i < matchingFieldRefs.length; i++) { + /* + * Currently we have document fields that match the query, but we + * need to return documents. The matchData and scores are combined + * from multiple fields belonging to the same document. + * + * Scores are calculated by field, using the query vectors created + * above, and combined into a final document score using addition. + */ + var fieldRef = lunr.FieldRef.fromString(matchingFieldRefs[i]), + docRef = fieldRef.docRef + + if (!allRequiredMatches.contains(docRef)) { + continue + } + + if (allProhibitedMatches.contains(docRef)) { + continue + } + + var fieldVector = this.fieldVectors[fieldRef], + score = queryVectors[fieldRef.fieldName].similarity(fieldVector), + docMatch + + if ((docMatch = matches[docRef]) !== undefined) { + docMatch.score += score + docMatch.matchData.combine(matchingFields[fieldRef]) + } else { + var match = { + ref: docRef, + score: score, + matchData: matchingFields[fieldRef] + } + matches[docRef] = match + results.push(match) + } + } + + /* + * Sort the results objects by score, highest first. + */ + return results.sort(function (a, b) { + return b.score - a.score + }) +} + +/** + * Prepares the index for JSON serialization. + * + * The schema for this JSON blob will be described in a + * separate JSON schema file. + * + * @returns {Object} + */ +lunr.Index.prototype.toJSON = function () { + var invertedIndex = Object.keys(this.invertedIndex) + .sort() + .map(function (term) { + return [term, this.invertedIndex[term]] + }, this) + + var fieldVectors = Object.keys(this.fieldVectors) + .map(function (ref) { + return [ref, this.fieldVectors[ref].toJSON()] + }, this) + + return { + version: lunr.version, + fields: this.fields, + fieldVectors: fieldVectors, + invertedIndex: invertedIndex, + pipeline: this.pipeline.toJSON() + } +} + +/** + * Loads a previously serialized lunr.Index + * + * @param {Object} serializedIndex - A previously serialized lunr.Index + * @returns {lunr.Index} + */ +lunr.Index.load = function (serializedIndex) { + var attrs = {}, + fieldVectors = {}, + serializedVectors = serializedIndex.fieldVectors, + invertedIndex = Object.create(null), + serializedInvertedIndex = serializedIndex.invertedIndex, + tokenSetBuilder = new lunr.TokenSet.Builder, + pipeline = lunr.Pipeline.load(serializedIndex.pipeline) + + if (serializedIndex.version != lunr.version) { + lunr.utils.warn("Version mismatch when loading serialised index. Current version of lunr '" + lunr.version + "' does not match serialized index '" + serializedIndex.version + "'") + } + + for (var i = 0; i < serializedVectors.length; i++) { + var tuple = serializedVectors[i], + ref = tuple[0], + elements = tuple[1] + + fieldVectors[ref] = new lunr.Vector(elements) + } + + for (var i = 0; i < serializedInvertedIndex.length; i++) { + var tuple = serializedInvertedIndex[i], + term = tuple[0], + posting = tuple[1] + + tokenSetBuilder.insert(term) + invertedIndex[term] = posting + } + + tokenSetBuilder.finish() + + attrs.fields = serializedIndex.fields + + attrs.fieldVectors = fieldVectors + attrs.invertedIndex = invertedIndex + attrs.tokenSet = tokenSetBuilder.root + attrs.pipeline = pipeline + + return new lunr.Index(attrs) +} +/*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * lunr.Builder performs indexing on a set of documents and + * returns instances of lunr.Index ready for querying. + * + * All configuration of the index is done via the builder, the + * fields to index, the document reference, the text processing + * pipeline and document scoring parameters are all set on the + * builder before indexing. + * + * @constructor + * @property {string} _ref - Internal reference to the document reference field. + * @property {string[]} _fields - Internal reference to the document fields to index. + * @property {object} invertedIndex - The inverted index maps terms to document fields. + * @property {object} documentTermFrequencies - Keeps track of document term frequencies. + * @property {object} documentLengths - Keeps track of the length of documents added to the index. + * @property {lunr.tokenizer} tokenizer - Function for splitting strings into tokens for indexing. + * @property {lunr.Pipeline} pipeline - The pipeline performs text processing on tokens before indexing. + * @property {lunr.Pipeline} searchPipeline - A pipeline for processing search terms before querying the index. + * @property {number} documentCount - Keeps track of the total number of documents indexed. + * @property {number} _b - A parameter to control field length normalization, setting this to 0 disabled normalization, 1 fully normalizes field lengths, the default value is 0.75. + * @property {number} _k1 - A parameter to control how quickly an increase in term frequency results in term frequency saturation, the default value is 1.2. + * @property {number} termIndex - A counter incremented for each unique term, used to identify a terms position in the vector space. + * @property {array} metadataWhitelist - A list of metadata keys that have been whitelisted for entry in the index. + */ +lunr.Builder = function () { + this._ref = "id" + this._fields = Object.create(null) + this._documents = Object.create(null) + this.invertedIndex = Object.create(null) + this.fieldTermFrequencies = {} + this.fieldLengths = {} + this.tokenizer = lunr.tokenizer + this.pipeline = new lunr.Pipeline + this.searchPipeline = new lunr.Pipeline + this.documentCount = 0 + this._b = 0.75 + this._k1 = 1.2 + this.termIndex = 0 + this.metadataWhitelist = [] +} + +/** + * Sets the document field used as the document reference. Every document must have this field. + * The type of this field in the document should be a string, if it is not a string it will be + * coerced into a string by calling toString. + * + * The default ref is 'id'. + * + * The ref should _not_ be changed during indexing, it should be set before any documents are + * added to the index. Changing it during indexing can lead to inconsistent results. + * + * @param {string} ref - The name of the reference field in the document. + */ +lunr.Builder.prototype.ref = function (ref) { + this._ref = ref +} + +/** + * A function that is used to extract a field from a document. + * + * Lunr expects a field to be at the top level of a document, if however the field + * is deeply nested within a document an extractor function can be used to extract + * the right field for indexing. + * + * @callback fieldExtractor + * @param {object} doc - The document being added to the index. + * @returns {?(string|object|object[])} obj - The object that will be indexed for this field. + * @example Extracting a nested field + * function (doc) { return doc.nested.field } + */ + +/** + * Adds a field to the list of document fields that will be indexed. Every document being + * indexed should have this field. Null values for this field in indexed documents will + * not cause errors but will limit the chance of that document being retrieved by searches. + * + * All fields should be added before adding documents to the index. Adding fields after + * a document has been indexed will have no effect on already indexed documents. + * + * Fields can be boosted at build time. This allows terms within that field to have more + * importance when ranking search results. Use a field boost to specify that matches within + * one field are more important than other fields. + * + * @param {string} fieldName - The name of a field to index in all documents. + * @param {object} attributes - Optional attributes associated with this field. + * @param {number} [attributes.boost=1] - Boost applied to all terms within this field. + * @param {fieldExtractor} [attributes.extractor] - Function to extract a field from a document. + * @throws {RangeError} fieldName cannot contain unsupported characters '/' + */ +lunr.Builder.prototype.field = function (fieldName, attributes) { + if (/\//.test(fieldName)) { + throw new RangeError ("Field '" + fieldName + "' contains illegal character '/'") + } + + this._fields[fieldName] = attributes || {} +} + +/** + * A parameter to tune the amount of field length normalisation that is applied when + * calculating relevance scores. A value of 0 will completely disable any normalisation + * and a value of 1 will fully normalise field lengths. The default is 0.75. Values of b + * will be clamped to the range 0 - 1. + * + * @param {number} number - The value to set for this tuning parameter. + */ +lunr.Builder.prototype.b = function (number) { + if (number < 0) { + this._b = 0 + } else if (number > 1) { + this._b = 1 + } else { + this._b = number + } +} + +/** + * A parameter that controls the speed at which a rise in term frequency results in term + * frequency saturation. The default value is 1.2. Setting this to a higher value will give + * slower saturation levels, a lower value will result in quicker saturation. + * + * @param {number} number - The value to set for this tuning parameter. + */ +lunr.Builder.prototype.k1 = function (number) { + this._k1 = number +} + +/** + * Adds a document to the index. + * + * Before adding fields to the index the index should have been fully setup, with the document + * ref and all fields to index already having been specified. + * + * The document must have a field name as specified by the ref (by default this is 'id') and + * it should have all fields defined for indexing, though null or undefined values will not + * cause errors. + * + * Entire documents can be boosted at build time. Applying a boost to a document indicates that + * this document should rank higher in search results than other documents. + * + * @param {object} doc - The document to add to the index. + * @param {object} attributes - Optional attributes associated with this document. + * @param {number} [attributes.boost=1] - Boost applied to all terms within this document. + */ +lunr.Builder.prototype.add = function (doc, attributes) { + var docRef = doc[this._ref], + fields = Object.keys(this._fields) + + this._documents[docRef] = attributes || {} + this.documentCount += 1 + + for (var i = 0; i < fields.length; i++) { + var fieldName = fields[i], + extractor = this._fields[fieldName].extractor, + field = extractor ? extractor(doc) : doc[fieldName], + tokens = this.tokenizer(field, { + fields: [fieldName] + }), + terms = this.pipeline.run(tokens), + fieldRef = new lunr.FieldRef (docRef, fieldName), + fieldTerms = Object.create(null) + + this.fieldTermFrequencies[fieldRef] = fieldTerms + this.fieldLengths[fieldRef] = 0 + + // store the length of this field for this document + this.fieldLengths[fieldRef] += terms.length + + // calculate term frequencies for this field + for (var j = 0; j < terms.length; j++) { + var term = terms[j] + + if (fieldTerms[term] == undefined) { + fieldTerms[term] = 0 + } + + fieldTerms[term] += 1 + + // add to inverted index + // create an initial posting if one doesn't exist + if (this.invertedIndex[term] == undefined) { + var posting = Object.create(null) + posting["_index"] = this.termIndex + this.termIndex += 1 + + for (var k = 0; k < fields.length; k++) { + posting[fields[k]] = Object.create(null) + } + + this.invertedIndex[term] = posting + } + + // add an entry for this term/fieldName/docRef to the invertedIndex + if (this.invertedIndex[term][fieldName][docRef] == undefined) { + this.invertedIndex[term][fieldName][docRef] = Object.create(null) + } + + // store all whitelisted metadata about this token in the + // inverted index + for (var l = 0; l < this.metadataWhitelist.length; l++) { + var metadataKey = this.metadataWhitelist[l], + metadata = term.metadata[metadataKey] + + if (this.invertedIndex[term][fieldName][docRef][metadataKey] == undefined) { + this.invertedIndex[term][fieldName][docRef][metadataKey] = [] + } + + this.invertedIndex[term][fieldName][docRef][metadataKey].push(metadata) + } + } + + } +} + +/** + * Calculates the average document length for this index + * + * @private + */ +lunr.Builder.prototype.calculateAverageFieldLengths = function () { + + var fieldRefs = Object.keys(this.fieldLengths), + numberOfFields = fieldRefs.length, + accumulator = {}, + documentsWithField = {} + + for (var i = 0; i < numberOfFields; i++) { + var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]), + field = fieldRef.fieldName + + documentsWithField[field] || (documentsWithField[field] = 0) + documentsWithField[field] += 1 + + accumulator[field] || (accumulator[field] = 0) + accumulator[field] += this.fieldLengths[fieldRef] + } + + var fields = Object.keys(this._fields) + + for (var i = 0; i < fields.length; i++) { + var fieldName = fields[i] + accumulator[fieldName] = accumulator[fieldName] / documentsWithField[fieldName] + } + + this.averageFieldLength = accumulator +} + +/** + * Builds a vector space model of every document using lunr.Vector + * + * @private + */ +lunr.Builder.prototype.createFieldVectors = function () { + var fieldVectors = {}, + fieldRefs = Object.keys(this.fieldTermFrequencies), + fieldRefsLength = fieldRefs.length, + termIdfCache = Object.create(null) + + for (var i = 0; i < fieldRefsLength; i++) { + var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]), + fieldName = fieldRef.fieldName, + fieldLength = this.fieldLengths[fieldRef], + fieldVector = new lunr.Vector, + termFrequencies = this.fieldTermFrequencies[fieldRef], + terms = Object.keys(termFrequencies), + termsLength = terms.length + + + var fieldBoost = this._fields[fieldName].boost || 1, + docBoost = this._documents[fieldRef.docRef].boost || 1 + + for (var j = 0; j < termsLength; j++) { + var term = terms[j], + tf = termFrequencies[term], + termIndex = this.invertedIndex[term]._index, + idf, score, scoreWithPrecision + + if (termIdfCache[term] === undefined) { + idf = lunr.idf(this.invertedIndex[term], this.documentCount) + termIdfCache[term] = idf + } else { + idf = termIdfCache[term] + } + + score = idf * ((this._k1 + 1) * tf) / (this._k1 * (1 - this._b + this._b * (fieldLength / this.averageFieldLength[fieldName])) + tf) + score *= fieldBoost + score *= docBoost + scoreWithPrecision = Math.round(score * 1000) / 1000 + // Converts 1.23456789 to 1.234. + // Reducing the precision so that the vectors take up less + // space when serialised. Doing it now so that they behave + // the same before and after serialisation. Also, this is + // the fastest approach to reducing a number's precision in + // JavaScript. + + fieldVector.insert(termIndex, scoreWithPrecision) + } + + fieldVectors[fieldRef] = fieldVector + } + + this.fieldVectors = fieldVectors +} + +/** + * Creates a token set of all tokens in the index using lunr.TokenSet + * + * @private + */ +lunr.Builder.prototype.createTokenSet = function () { + this.tokenSet = lunr.TokenSet.fromArray( + Object.keys(this.invertedIndex).sort() + ) +} + +/** + * Builds the index, creating an instance of lunr.Index. + * + * This completes the indexing process and should only be called + * once all documents have been added to the index. + * + * @returns {lunr.Index} + */ +lunr.Builder.prototype.build = function () { + this.calculateAverageFieldLengths() + this.createFieldVectors() + this.createTokenSet() + + return new lunr.Index({ + invertedIndex: this.invertedIndex, + fieldVectors: this.fieldVectors, + tokenSet: this.tokenSet, + fields: Object.keys(this._fields), + pipeline: this.searchPipeline + }) +} + +/** + * Applies a plugin to the index builder. + * + * A plugin is a function that is called with the index builder as its context. + * Plugins can be used to customise or extend the behaviour of the index + * in some way. A plugin is just a function, that encapsulated the custom + * behaviour that should be applied when building the index. + * + * The plugin function will be called with the index builder as its argument, additional + * arguments can also be passed when calling use. The function will be called + * with the index builder as its context. + * + * @param {Function} plugin The plugin to apply. + */ +lunr.Builder.prototype.use = function (fn) { + var args = Array.prototype.slice.call(arguments, 1) + args.unshift(this) + fn.apply(this, args) +} +/** + * Contains and collects metadata about a matching document. + * A single instance of lunr.MatchData is returned as part of every + * lunr.Index~Result. + * + * @constructor + * @param {string} term - The term this match data is associated with + * @param {string} field - The field in which the term was found + * @param {object} metadata - The metadata recorded about this term in this field + * @property {object} metadata - A cloned collection of metadata associated with this document. + * @see {@link lunr.Index~Result} + */ +lunr.MatchData = function (term, field, metadata) { + var clonedMetadata = Object.create(null), + metadataKeys = Object.keys(metadata || {}) + + // Cloning the metadata to prevent the original + // being mutated during match data combination. + // Metadata is kept in an array within the inverted + // index so cloning the data can be done with + // Array#slice + for (var i = 0; i < metadataKeys.length; i++) { + var key = metadataKeys[i] + clonedMetadata[key] = metadata[key].slice() + } + + this.metadata = Object.create(null) + + if (term !== undefined) { + this.metadata[term] = Object.create(null) + this.metadata[term][field] = clonedMetadata + } +} + +/** + * An instance of lunr.MatchData will be created for every term that matches a + * document. However only one instance is required in a lunr.Index~Result. This + * method combines metadata from another instance of lunr.MatchData with this + * objects metadata. + * + * @param {lunr.MatchData} otherMatchData - Another instance of match data to merge with this one. + * @see {@link lunr.Index~Result} + */ +lunr.MatchData.prototype.combine = function (otherMatchData) { + var terms = Object.keys(otherMatchData.metadata) + + for (var i = 0; i < terms.length; i++) { + var term = terms[i], + fields = Object.keys(otherMatchData.metadata[term]) + + if (this.metadata[term] == undefined) { + this.metadata[term] = Object.create(null) + } + + for (var j = 0; j < fields.length; j++) { + var field = fields[j], + keys = Object.keys(otherMatchData.metadata[term][field]) + + if (this.metadata[term][field] == undefined) { + this.metadata[term][field] = Object.create(null) + } + + for (var k = 0; k < keys.length; k++) { + var key = keys[k] + + if (this.metadata[term][field][key] == undefined) { + this.metadata[term][field][key] = otherMatchData.metadata[term][field][key] + } else { + this.metadata[term][field][key] = this.metadata[term][field][key].concat(otherMatchData.metadata[term][field][key]) + } + + } + } + } +} + +/** + * Add metadata for a term/field pair to this instance of match data. + * + * @param {string} term - The term this match data is associated with + * @param {string} field - The field in which the term was found + * @param {object} metadata - The metadata recorded about this term in this field + */ +lunr.MatchData.prototype.add = function (term, field, metadata) { + if (!(term in this.metadata)) { + this.metadata[term] = Object.create(null) + this.metadata[term][field] = metadata + return + } + + if (!(field in this.metadata[term])) { + this.metadata[term][field] = metadata + return + } + + var metadataKeys = Object.keys(metadata) + + for (var i = 0; i < metadataKeys.length; i++) { + var key = metadataKeys[i] + + if (key in this.metadata[term][field]) { + this.metadata[term][field][key] = this.metadata[term][field][key].concat(metadata[key]) + } else { + this.metadata[term][field][key] = metadata[key] + } + } +} +/** + * A lunr.Query provides a programmatic way of defining queries to be performed + * against a {@link lunr.Index}. + * + * Prefer constructing a lunr.Query using the {@link lunr.Index#query} method + * so the query object is pre-initialized with the right index fields. + * + * @constructor + * @property {lunr.Query~Clause[]} clauses - An array of query clauses. + * @property {string[]} allFields - An array of all available fields in a lunr.Index. + */ +lunr.Query = function (allFields) { + this.clauses = [] + this.allFields = allFields +} + +/** + * Constants for indicating what kind of automatic wildcard insertion will be used when constructing a query clause. + * + * This allows wildcards to be added to the beginning and end of a term without having to manually do any string + * concatenation. + * + * The wildcard constants can be bitwise combined to select both leading and trailing wildcards. + * + * @constant + * @default + * @property {number} wildcard.NONE - The term will have no wildcards inserted, this is the default behaviour + * @property {number} wildcard.LEADING - Prepend the term with a wildcard, unless a leading wildcard already exists + * @property {number} wildcard.TRAILING - Append a wildcard to the term, unless a trailing wildcard already exists + * @see lunr.Query~Clause + * @see lunr.Query#clause + * @see lunr.Query#term + * @example query term with trailing wildcard + * query.term('foo', { wildcard: lunr.Query.wildcard.TRAILING }) + * @example query term with leading and trailing wildcard + * query.term('foo', { + * wildcard: lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING + * }) + */ + +lunr.Query.wildcard = new String ("*") +lunr.Query.wildcard.NONE = 0 +lunr.Query.wildcard.LEADING = 1 +lunr.Query.wildcard.TRAILING = 2 + +/** + * Constants for indicating what kind of presence a term must have in matching documents. + * + * @constant + * @enum {number} + * @see lunr.Query~Clause + * @see lunr.Query#clause + * @see lunr.Query#term + * @example query term with required presence + * query.term('foo', { presence: lunr.Query.presence.REQUIRED }) + */ +lunr.Query.presence = { + /** + * Term's presence in a document is optional, this is the default value. + */ + OPTIONAL: 1, + + /** + * Term's presence in a document is required, documents that do not contain + * this term will not be returned. + */ + REQUIRED: 2, + + /** + * Term's presence in a document is prohibited, documents that do contain + * this term will not be returned. + */ + PROHIBITED: 3 +} + +/** + * A single clause in a {@link lunr.Query} contains a term and details on how to + * match that term against a {@link lunr.Index}. + * + * @typedef {Object} lunr.Query~Clause + * @property {string[]} fields - The fields in an index this clause should be matched against. + * @property {number} [boost=1] - Any boost that should be applied when matching this clause. + * @property {number} [editDistance] - Whether the term should have fuzzy matching applied, and how fuzzy the match should be. + * @property {boolean} [usePipeline] - Whether the term should be passed through the search pipeline. + * @property {number} [wildcard=lunr.Query.wildcard.NONE] - Whether the term should have wildcards appended or prepended. + * @property {number} [presence=lunr.Query.presence.OPTIONAL] - The terms presence in any matching documents. + */ + +/** + * Adds a {@link lunr.Query~Clause} to this query. + * + * Unless the clause contains the fields to be matched all fields will be matched. In addition + * a default boost of 1 is applied to the clause. + * + * @param {lunr.Query~Clause} clause - The clause to add to this query. + * @see lunr.Query~Clause + * @returns {lunr.Query} + */ +lunr.Query.prototype.clause = function (clause) { + if (!('fields' in clause)) { + clause.fields = this.allFields + } + + if (!('boost' in clause)) { + clause.boost = 1 + } + + if (!('usePipeline' in clause)) { + clause.usePipeline = true + } + + if (!('wildcard' in clause)) { + clause.wildcard = lunr.Query.wildcard.NONE + } + + if ((clause.wildcard & lunr.Query.wildcard.LEADING) && (clause.term.charAt(0) != lunr.Query.wildcard)) { + clause.term = "*" + clause.term + } + + if ((clause.wildcard & lunr.Query.wildcard.TRAILING) && (clause.term.slice(-1) != lunr.Query.wildcard)) { + clause.term = "" + clause.term + "*" + } + + if (!('presence' in clause)) { + clause.presence = lunr.Query.presence.OPTIONAL + } + + this.clauses.push(clause) + + return this +} + +/** + * A negated query is one in which every clause has a presence of + * prohibited. These queries require some special processing to return + * the expected results. + * + * @returns boolean + */ +lunr.Query.prototype.isNegated = function () { + for (var i = 0; i < this.clauses.length; i++) { + if (this.clauses[i].presence != lunr.Query.presence.PROHIBITED) { + return false + } + } + + return true +} + +/** + * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause} + * to the list of clauses that make up this query. + * + * The term is used as is, i.e. no tokenization will be performed by this method. Instead conversion + * to a token or token-like string should be done before calling this method. + * + * The term will be converted to a string by calling `toString`. Multiple terms can be passed as an + * array, each term in the array will share the same options. + * + * @param {object|object[]} term - The term(s) to add to the query. + * @param {object} [options] - Any additional properties to add to the query clause. + * @returns {lunr.Query} + * @see lunr.Query#clause + * @see lunr.Query~Clause + * @example adding a single term to a query + * query.term("foo") + * @example adding a single term to a query and specifying search fields, term boost and automatic trailing wildcard + * query.term("foo", { + * fields: ["title"], + * boost: 10, + * wildcard: lunr.Query.wildcard.TRAILING + * }) + * @example using lunr.tokenizer to convert a string to tokens before using them as terms + * query.term(lunr.tokenizer("foo bar")) + */ +lunr.Query.prototype.term = function (term, options) { + if (Array.isArray(term)) { + term.forEach(function (t) { this.term(t, lunr.utils.clone(options)) }, this) + return this + } + + var clause = options || {} + clause.term = term.toString() + + this.clause(clause) + + return this +} +lunr.QueryParseError = function (message, start, end) { + this.name = "QueryParseError" + this.message = message + this.start = start + this.end = end +} + +lunr.QueryParseError.prototype = new Error +lunr.QueryLexer = function (str) { + this.lexemes = [] + this.str = str + this.length = str.length + this.pos = 0 + this.start = 0 + this.escapeCharPositions = [] +} + +lunr.QueryLexer.prototype.run = function () { + var state = lunr.QueryLexer.lexText + + while (state) { + state = state(this) + } +} + +lunr.QueryLexer.prototype.sliceString = function () { + var subSlices = [], + sliceStart = this.start, + sliceEnd = this.pos + + for (var i = 0; i < this.escapeCharPositions.length; i++) { + sliceEnd = this.escapeCharPositions[i] + subSlices.push(this.str.slice(sliceStart, sliceEnd)) + sliceStart = sliceEnd + 1 + } + + subSlices.push(this.str.slice(sliceStart, this.pos)) + this.escapeCharPositions.length = 0 + + return subSlices.join('') +} + +lunr.QueryLexer.prototype.emit = function (type) { + this.lexemes.push({ + type: type, + str: this.sliceString(), + start: this.start, + end: this.pos + }) + + this.start = this.pos +} + +lunr.QueryLexer.prototype.escapeCharacter = function () { + this.escapeCharPositions.push(this.pos - 1) + this.pos += 1 +} + +lunr.QueryLexer.prototype.next = function () { + if (this.pos >= this.length) { + return lunr.QueryLexer.EOS + } + + var char = this.str.charAt(this.pos) + this.pos += 1 + return char +} + +lunr.QueryLexer.prototype.width = function () { + return this.pos - this.start +} + +lunr.QueryLexer.prototype.ignore = function () { + if (this.start == this.pos) { + this.pos += 1 + } + + this.start = this.pos +} + +lunr.QueryLexer.prototype.backup = function () { + this.pos -= 1 +} + +lunr.QueryLexer.prototype.acceptDigitRun = function () { + var char, charCode + + do { + char = this.next() + charCode = char.charCodeAt(0) + } while (charCode > 47 && charCode < 58) + + if (char != lunr.QueryLexer.EOS) { + this.backup() + } +} + +lunr.QueryLexer.prototype.more = function () { + return this.pos < this.length +} + +lunr.QueryLexer.EOS = 'EOS' +lunr.QueryLexer.FIELD = 'FIELD' +lunr.QueryLexer.TERM = 'TERM' +lunr.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE' +lunr.QueryLexer.BOOST = 'BOOST' +lunr.QueryLexer.PRESENCE = 'PRESENCE' + +lunr.QueryLexer.lexField = function (lexer) { + lexer.backup() + lexer.emit(lunr.QueryLexer.FIELD) + lexer.ignore() + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexTerm = function (lexer) { + if (lexer.width() > 1) { + lexer.backup() + lexer.emit(lunr.QueryLexer.TERM) + } + + lexer.ignore() + + if (lexer.more()) { + return lunr.QueryLexer.lexText + } +} + +lunr.QueryLexer.lexEditDistance = function (lexer) { + lexer.ignore() + lexer.acceptDigitRun() + lexer.emit(lunr.QueryLexer.EDIT_DISTANCE) + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexBoost = function (lexer) { + lexer.ignore() + lexer.acceptDigitRun() + lexer.emit(lunr.QueryLexer.BOOST) + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexEOS = function (lexer) { + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } +} + +// This matches the separator used when tokenising fields +// within a document. These should match otherwise it is +// not possible to search for some tokens within a document. +// +// It is possible for the user to change the separator on the +// tokenizer so it _might_ clash with any other of the special +// characters already used within the search string, e.g. :. +// +// This means that it is possible to change the separator in +// such a way that makes some words unsearchable using a search +// string. +lunr.QueryLexer.termSeparator = lunr.tokenizer.separator + +lunr.QueryLexer.lexText = function (lexer) { + while (true) { + var char = lexer.next() + + if (char == lunr.QueryLexer.EOS) { + return lunr.QueryLexer.lexEOS + } + + // Escape character is '\' + if (char.charCodeAt(0) == 92) { + lexer.escapeCharacter() + continue + } + + if (char == ":") { + return lunr.QueryLexer.lexField + } + + if (char == "~") { + lexer.backup() + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } + return lunr.QueryLexer.lexEditDistance + } + + if (char == "^") { + lexer.backup() + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } + return lunr.QueryLexer.lexBoost + } + + // "+" indicates term presence is required + // checking for length to ensure that only + // leading "+" are considered + if (char == "+" && lexer.width() === 1) { + lexer.emit(lunr.QueryLexer.PRESENCE) + return lunr.QueryLexer.lexText + } + + // "-" indicates term presence is prohibited + // checking for length to ensure that only + // leading "-" are considered + if (char == "-" && lexer.width() === 1) { + lexer.emit(lunr.QueryLexer.PRESENCE) + return lunr.QueryLexer.lexText + } + + if (char.match(lunr.QueryLexer.termSeparator)) { + return lunr.QueryLexer.lexTerm + } + } +} + +lunr.QueryParser = function (str, query) { + this.lexer = new lunr.QueryLexer (str) + this.query = query + this.currentClause = {} + this.lexemeIdx = 0 +} + +lunr.QueryParser.prototype.parse = function () { + this.lexer.run() + this.lexemes = this.lexer.lexemes + + var state = lunr.QueryParser.parseClause + + while (state) { + state = state(this) + } + + return this.query +} + +lunr.QueryParser.prototype.peekLexeme = function () { + return this.lexemes[this.lexemeIdx] +} + +lunr.QueryParser.prototype.consumeLexeme = function () { + var lexeme = this.peekLexeme() + this.lexemeIdx += 1 + return lexeme +} + +lunr.QueryParser.prototype.nextClause = function () { + var completedClause = this.currentClause + this.query.clause(completedClause) + this.currentClause = {} +} + +lunr.QueryParser.parseClause = function (parser) { + var lexeme = parser.peekLexeme() + + if (lexeme == undefined) { + return + } + + switch (lexeme.type) { + case lunr.QueryLexer.PRESENCE: + return lunr.QueryParser.parsePresence + case lunr.QueryLexer.FIELD: + return lunr.QueryParser.parseField + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expected either a field or a term, found " + lexeme.type + + if (lexeme.str.length >= 1) { + errorMessage += " with value '" + lexeme.str + "'" + } + + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } +} + +lunr.QueryParser.parsePresence = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + switch (lexeme.str) { + case "-": + parser.currentClause.presence = lunr.Query.presence.PROHIBITED + break + case "+": + parser.currentClause.presence = lunr.Query.presence.REQUIRED + break + default: + var errorMessage = "unrecognised presence operator'" + lexeme.str + "'" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + var errorMessage = "expecting term or field, found nothing" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.FIELD: + return lunr.QueryParser.parseField + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expecting term or field, found '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseField = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + if (parser.query.allFields.indexOf(lexeme.str) == -1) { + var possibleFields = parser.query.allFields.map(function (f) { return "'" + f + "'" }).join(', '), + errorMessage = "unrecognised field '" + lexeme.str + "', possible fields: " + possibleFields + + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.fields = [lexeme.str] + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + var errorMessage = "expecting term, found nothing" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expecting term, found '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseTerm = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + parser.currentClause.term = lexeme.str.toLowerCase() + + if (lexeme.str.indexOf("*") != -1) { + parser.currentClause.usePipeline = false + } + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + case lunr.QueryLexer.PRESENCE: + parser.nextClause() + return lunr.QueryParser.parsePresence + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseEditDistance = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + var editDistance = parseInt(lexeme.str, 10) + + if (isNaN(editDistance)) { + var errorMessage = "edit distance must be numeric" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.editDistance = editDistance + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + case lunr.QueryLexer.PRESENCE: + parser.nextClause() + return lunr.QueryParser.parsePresence + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseBoost = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + var boost = parseInt(lexeme.str, 10) + + if (isNaN(boost)) { + var errorMessage = "boost must be numeric" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.boost = boost + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + case lunr.QueryLexer.PRESENCE: + parser.nextClause() + return lunr.QueryParser.parsePresence + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + + /** + * export the module via AMD, CommonJS or as a browser global + * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js + */ + ;(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(factory) + } else if (typeof exports === 'object') { + /** + * Node. Does not work with strict CommonJS, but + * only CommonJS-like environments that support module.exports, + * like Node. + */ + module.exports = factory() + } else { + // Browser globals (root is window) + root.lunr = factory() + } + }(this, function () { + /** + * Just return a value to define the module export. + * This example returns an object, but the module + * can return a function as the exported value. + */ + return lunr + })) +})(); diff --git a/search/main.js b/search/main.js new file mode 100644 index 00000000..a5e469d7 --- /dev/null +++ b/search/main.js @@ -0,0 +1,109 @@ +function getSearchTermFromLocation() { + var sPageURL = window.location.search.substring(1); + var sURLVariables = sPageURL.split('&'); + for (var i = 0; i < sURLVariables.length; i++) { + var sParameterName = sURLVariables[i].split('='); + if (sParameterName[0] == 'q') { + return decodeURIComponent(sParameterName[1].replace(/\+/g, '%20')); + } + } +} + +function joinUrl (base, path) { + if (path.substring(0, 1) === "/") { + // path starts with `/`. Thus it is absolute. + return path; + } + if (base.substring(base.length-1) === "/") { + // base ends with `/` + return base + path; + } + return base + "/" + path; +} + +function escapeHtml (value) { + return value.replace(/&/g, '&') + .replace(/"/g, '"') + .replace(//g, '>'); +} + +function formatResult (location, title, summary) { + return ''; +} + +function displayResults (results) { + var search_results = document.getElementById("mkdocs-search-results"); + while (search_results.firstChild) { + search_results.removeChild(search_results.firstChild); + } + if (results.length > 0){ + for (var i=0; i < results.length; i++){ + var result = results[i]; + var html = formatResult(result.location, result.title, result.summary); + search_results.insertAdjacentHTML('beforeend', html); + } + } else { + var noResultsText = search_results.getAttribute('data-no-results-text'); + if (!noResultsText) { + noResultsText = "No results found"; + } + search_results.insertAdjacentHTML('beforeend', '

' + noResultsText + '

'); + } +} + +function doSearch () { + var query = document.getElementById('mkdocs-search-query').value; + if (query.length > min_search_length) { + if (!window.Worker) { + displayResults(search(query)); + } else { + searchWorker.postMessage({query: query}); + } + } else { + // Clear results for short queries + displayResults([]); + } +} + +function initSearch () { + var search_input = document.getElementById('mkdocs-search-query'); + if (search_input) { + search_input.addEventListener("keyup", doSearch); + } + var term = getSearchTermFromLocation(); + if (term) { + search_input.value = term; + doSearch(); + } +} + +function onWorkerMessage (e) { + if (e.data.allowSearch) { + initSearch(); + } else if (e.data.results) { + var results = e.data.results; + displayResults(results); + } else if (e.data.config) { + min_search_length = e.data.config.min_search_length-1; + } +} + +if (!window.Worker) { + console.log('Web Worker API not supported'); + // load index in main thread + $.getScript(joinUrl(base_url, "search/worker.js")).done(function () { + console.log('Loaded worker'); + init(); + window.postMessage = function (msg) { + onWorkerMessage({data: msg}); + }; + }).fail(function (jqxhr, settings, exception) { + console.error('Could not load worker.js'); + }); +} else { + // Wrap search in a web worker + var searchWorker = new Worker(joinUrl(base_url, "search/worker.js")); + searchWorker.postMessage({init: true}); + searchWorker.onmessage = onWorkerMessage; +} diff --git a/search/search_index.json b/search/search_index.json new file mode 100644 index 00000000..5e48cade --- /dev/null +++ b/search/search_index.json @@ -0,0 +1 @@ +{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Welcome to Rofi Documentation This website holds the web-version of the manpages for rofi and several guides that have been published over the past years. The manpages are grouped on rofi version. Downloads Installation Themes User scripts (wiki) Development version Rofi manpage Themes Dmenu Script Debugging Keys Stable Rofi manpage Themes Dmenu Script Debugging Keys Guides Transparency Positioning Plugins Dynamic Theme","title":"Home"},{"location":"#welcome-to-rofi-documentation","text":"This website holds the web-version of the manpages for rofi and several guides that have been published over the past years. The manpages are grouped on rofi version. Downloads Installation Themes User scripts (wiki)","title":"Welcome to Rofi Documentation"},{"location":"#development-version","text":"Rofi manpage Themes Dmenu Script Debugging Keys","title":"Development version"},{"location":"#stable","text":"Rofi manpage Themes Dmenu Script Debugging Keys","title":"Stable"},{"location":"#guides","text":"Transparency Positioning Plugins Dynamic Theme","title":"Guides"},{"location":"CONFIG/","text":"This page does not describe all of ROFI 's configuration options, just the most common usecase. For the full configuration options, check the manpages. Where does the configuration live Rofi's configurations, custom themes live in ${XDG_CONFIG_HOME}/rofi/ , on most systems this is ~/.config/rofi/ . The name of the main configuration file is config.rasi . ( ~/.config/rofi/config.rasi ). Create an empty configuration file Open ~/.config/rofi/config.rasi in your favorite text editor and add the following block: configuration { } You can now set the options in the configuration block. Create a configuration file from current setup If you do not want to start from scratch, or want to migrate from older configuration format, you can get tell rofi to dumps it configuration: rofi -dump-config > ~/.config/rofi/config.rasi This will have all the possible settings and their current value. If a value is the default value, the entry will be commented. For example: configuration { /* modes: \"window,run,ssh,drun\";*/ /* font: \"mono 12\";*/ /* location: 0;*/ /* yoffset: 0;*/ /* xoffset: 0;*/ /* fixed-num-lines: true;*/ ... cut ... /* ml-row-down: \"ScrollDown\";*/ /* me-select-entry: \"MousePrimary\";*/ /* me-accept-entry: \"MouseDPrimary\";*/ /* me-accept-custom: \"Control+MouseDPrimary\";*/ } To create a copy of the current theme, you can run: rofi -dump-theme > ~/.config/rofi/current.rasi Configuration file format Encoding The encoding of the file is utf-8. Both Unix ( \\n ) and windows ( \\r\\n ) newlines format are supported. But Unix is preferred. Comments C and C++ file comments are supported. Anything after // and before a newline is considered a comment. Everything between /* and */ is a comment. Comments can be nested and the C comments can be inline. The following is valid: // Magic comment. property: /* comment */ value; However, this is not: prop/*comment*/erty: value; White space White space and newlines, like comments, are ignored by the parser. This: property: name; Is identical to: property : name ; Data types ROFI 's configuration supports several data formats: String A string is always surrounded by double quotes ( \" ). Between the quotes there can be any printable character. For example: ml-row-down: \"ScrollDown\"; Number An integer may contain any full number. For example: eh: 2; Boolean Boolean value is either true or false . This is case-sensitive. For example: show-icons: true; This is equal to the -show-icons option on the commandline, and show-icons: false; is equal to -no-show-icons . Character Character value is always surrounded by single quotes (') and should contain a single character. It supports escaping. matching-negate-char: '-'; List This is not supported by the old configuration system, but can be used in the rasi format. A list starts with a '[' and ends with a ']'. The entries in the list are comma-separated. The entry in the list single ASCII words. combi-modes: [window,drun]; For older versions you have : combi-modes: \"window,drun\"; Get a list of all possible options There are 2 ways to get a list of all options: Dump the configuration file explained above. ( rofi -dump-config ) Look at output of rofi -h . To see what values an option support check the manpage, it describes most of them. NOTE: not all options might be in the manpage, as options can be added at run-time. (f.e. by plugins). Splitting configuration over multiple files It is possible to split configuration over multiple files using imports. For example in ~/.config/rofi/config.rasi configuration { } @import \"myConfig\" @theme \"MyTheme\" Rofi will first parse the config block in ~/.config/rofi/config.rasi , then parse ~/.config/rofi/myConfig.rasi and then load the theme myTheme . More information can be obtained from the rofi-theme(5) manpage. Imports can be nested.","title":"Configuration"},{"location":"CONFIG/#where-does-the-configuration-live","text":"Rofi's configurations, custom themes live in ${XDG_CONFIG_HOME}/rofi/ , on most systems this is ~/.config/rofi/ . The name of the main configuration file is config.rasi . ( ~/.config/rofi/config.rasi ).","title":"Where does the configuration live"},{"location":"CONFIG/#create-an-empty-configuration-file","text":"Open ~/.config/rofi/config.rasi in your favorite text editor and add the following block: configuration { } You can now set the options in the configuration block.","title":"Create an empty configuration file"},{"location":"CONFIG/#create-a-configuration-file-from-current-setup","text":"If you do not want to start from scratch, or want to migrate from older configuration format, you can get tell rofi to dumps it configuration: rofi -dump-config > ~/.config/rofi/config.rasi This will have all the possible settings and their current value. If a value is the default value, the entry will be commented. For example: configuration { /* modes: \"window,run,ssh,drun\";*/ /* font: \"mono 12\";*/ /* location: 0;*/ /* yoffset: 0;*/ /* xoffset: 0;*/ /* fixed-num-lines: true;*/ ... cut ... /* ml-row-down: \"ScrollDown\";*/ /* me-select-entry: \"MousePrimary\";*/ /* me-accept-entry: \"MouseDPrimary\";*/ /* me-accept-custom: \"Control+MouseDPrimary\";*/ } To create a copy of the current theme, you can run: rofi -dump-theme > ~/.config/rofi/current.rasi","title":"Create a configuration file from current setup"},{"location":"CONFIG/#configuration-file-format","text":"","title":"Configuration file format"},{"location":"CONFIG/#encoding","text":"The encoding of the file is utf-8. Both Unix ( \\n ) and windows ( \\r\\n ) newlines format are supported. But Unix is preferred.","title":"Encoding"},{"location":"CONFIG/#comments","text":"C and C++ file comments are supported. Anything after // and before a newline is considered a comment. Everything between /* and */ is a comment. Comments can be nested and the C comments can be inline. The following is valid: // Magic comment. property: /* comment */ value; However, this is not: prop/*comment*/erty: value;","title":"Comments"},{"location":"CONFIG/#white-space","text":"White space and newlines, like comments, are ignored by the parser. This: property: name; Is identical to: property : name ;","title":"White space"},{"location":"CONFIG/#data-types","text":"ROFI 's configuration supports several data formats:","title":"Data types"},{"location":"CONFIG/#string","text":"A string is always surrounded by double quotes ( \" ). Between the quotes there can be any printable character. For example: ml-row-down: \"ScrollDown\";","title":"String"},{"location":"CONFIG/#number","text":"An integer may contain any full number. For example: eh: 2;","title":"Number"},{"location":"CONFIG/#boolean","text":"Boolean value is either true or false . This is case-sensitive. For example: show-icons: true; This is equal to the -show-icons option on the commandline, and show-icons: false; is equal to -no-show-icons .","title":"Boolean"},{"location":"CONFIG/#character","text":"Character value is always surrounded by single quotes (') and should contain a single character. It supports escaping. matching-negate-char: '-';","title":"Character"},{"location":"CONFIG/#list","text":"This is not supported by the old configuration system, but can be used in the rasi format. A list starts with a '[' and ends with a ']'. The entries in the list are comma-separated. The entry in the list single ASCII words. combi-modes: [window,drun]; For older versions you have : combi-modes: \"window,drun\";","title":"List"},{"location":"CONFIG/#get-a-list-of-all-possible-options","text":"There are 2 ways to get a list of all options: Dump the configuration file explained above. ( rofi -dump-config ) Look at output of rofi -h . To see what values an option support check the manpage, it describes most of them. NOTE: not all options might be in the manpage, as options can be added at run-time. (f.e. by plugins).","title":"Get a list of all possible options"},{"location":"CONFIG/#splitting-configuration-over-multiple-files","text":"It is possible to split configuration over multiple files using imports. For example in ~/.config/rofi/config.rasi configuration { } @import \"myConfig\" @theme \"MyTheme\" Rofi will first parse the config block in ~/.config/rofi/config.rasi , then parse ~/.config/rofi/myConfig.rasi and then load the theme myTheme . More information can be obtained from the rofi-theme(5) manpage. Imports can be nested.","title":"Splitting configuration over multiple files"},{"location":"COPYING/","text":"MIT/X11 License Modified 2013-2023 Qball Cow qball@gmpclient.org Copyright (c) 2012 Sean Pringle sean.pringle@gmail.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","title":"License"},{"location":"INSTALL/","text":"Installation guide This guide explains how to install rofi using its build system and how you can make debug builds. Rofi uses autotools (GNU Build system), for more information see here . You can also use Meson as an alternative. DEPENDENCY For building C compiler that supports the c99 standard. (gcc or clang) make autoconf automake (1.11.3 or up) pkg-config flex 2.5.39 or higher bison check (Can be disabled using the --disable-check configure flag) check is used for build-time tests and does not affect functionality. Developer packages of the external libraries glib-compile-resources External libraries libpango >= 1.50 libpangocairo libcairo libcairo-xcb libglib2.0 >= 2.72 gmodule-2.0 gio-unix-2.0 libgdk-pixbuf-2.0 libstartup-notification-1.0 libxkbcommon >= 0.4.1 libxkbcommon-x11 libxcb (sometimes split, you need libxcb, libxcb-xkb and libxcb-randr libxcb-xinerama) xcb-util xcb-util-wm (sometimes split as libxcb-ewmh and libxcb-icccm) xcb-util-cursor xcb-imdkit (optional, 1.0.3 or up preferred) On debian based systems, the developer packages are in the form of: -dev on rpm based -devel . Install from a release When downloading from the github release page, make sure to grab the archive rofi-{version}.tar.[g|x]z . The auto-attached files source code (zip|tar.gz) by github do not contain a valid release. It misses a setup build system and includes irrelevant files. Autotools Create a build directory and enter it: mkdir build && cd build Check dependencies and configure build system: ../configure Build Rofi: make The actual install, execute as root (if needed): make install The default installation prefix is: /usr/local/ use ./configure --prefix={prefix} to install into another location. Meson Check dependencies and configure build system: meson setup build Build Rofi: ninja -C build The actual install, execute as root (if needed): ninja -C build install The default installation prefix is: /usr/local/ use meson setup build --prefix={prefix} to install into another location. Install a checkout from git The GitHub Pages version of these directions may be out of date. Please use INSTALL.md from the online repo or your local repository. If you don't have a checkout: git clone --recursive https://github.com/DaveDavenport/rofi cd rofi/ If you already have a checkout: cd rofi/ git pull git submodule update --init For Autotools you have an extra step, to generate build system: autoreconf -i From this point, use the same steps you use for a release. Options for configure When you run the configure step there are several options you can configure. For Autotools, you can see the full list with ./configure --help . For Meson, before the initial setup, you can see rofi options in meson_options.txt and Meson options with meson setup --help . Meson's built-in options can be set using regular command line arguments, like so: meson setup build --option=value . Rofi-specific options can be set using the -D argument, like so: meson setup build -Doption=value . After the build dir is set up by meson setup build , the meson configure build command can be used to configure options, by the same means. The most useful one to set is the installation prefix: # Autotools ../configure --prefix= # Meson meson setup build --prefix f.e. # Autotools ../configure --prefix=/usr/ # Meson meson setup build --prefix /usr Install locally or to install locally: # Autotools ../configure --prefix=${HOME}/.local/ # Meson meson setup build --prefix ${HOME}/.local Options for make When you run make you can tweak the build process a little. Verbose output Show the commands called: # Autotools make V=1 # Meson ninja -C build -v Debug build Compile with debug symbols and no optimization, this is useful for making backtraces: # Autotools make CFLAGS=\"-O0 -g3\" clean rofi # Meson meson configure build --debug ninja -C build Get a backtrace Getting a backtrace using GDB is not very handy. Because if rofi get stuck, it grabs keyboard and mouse. So if it crashes in GDB you are stuck. The best way to go is to enable core file. (ulimit -c unlimited in bash) then make rofi crash. You can then load the core in GDB. # Autotools gdb rofi core # Meson (because it uses a separate build directory) gdb build/rofi core Where the core file is located and what its exact name is different on each distributions. Please consult the relevant documentation. For more information see the rofi-debugging(5) manpage. Install distribution Debian or Ubuntu apt install rofi Fedora dnf install rofi ArchLinux pacman -S rofi Gentoo An ebuild is available, x11-misc/rofi . It's up to date, but you may need to enable ~arch to get the latest release: echo 'x11-misc/rofi ~amd64' >> /etc/portage/package.accept_keywords for amd64 or: echo 'x11-misc/rofi ~x86' >> /etc/portage/package.accept_keywords for i386. To install it, simply issue emerge rofi . openSUSE On both openSUSE Leap and openSUSE Tumbleweed rofi can be installed using: sudo zypper install rofi FreeBSD sudo pkg install rofi macOS On macOS rofi can be installed via MacPorts : sudo port install rofi","title":"Installation"},{"location":"INSTALL/#installation-guide","text":"This guide explains how to install rofi using its build system and how you can make debug builds. Rofi uses autotools (GNU Build system), for more information see here . You can also use Meson as an alternative.","title":"Installation guide"},{"location":"INSTALL/#dependency","text":"","title":"DEPENDENCY"},{"location":"INSTALL/#for-building","text":"C compiler that supports the c99 standard. (gcc or clang) make autoconf automake (1.11.3 or up) pkg-config flex 2.5.39 or higher bison check (Can be disabled using the --disable-check configure flag) check is used for build-time tests and does not affect functionality. Developer packages of the external libraries glib-compile-resources","title":"For building"},{"location":"INSTALL/#external-libraries","text":"libpango >= 1.50 libpangocairo libcairo libcairo-xcb libglib2.0 >= 2.72 gmodule-2.0 gio-unix-2.0 libgdk-pixbuf-2.0 libstartup-notification-1.0 libxkbcommon >= 0.4.1 libxkbcommon-x11 libxcb (sometimes split, you need libxcb, libxcb-xkb and libxcb-randr libxcb-xinerama) xcb-util xcb-util-wm (sometimes split as libxcb-ewmh and libxcb-icccm) xcb-util-cursor xcb-imdkit (optional, 1.0.3 or up preferred) On debian based systems, the developer packages are in the form of: -dev on rpm based -devel .","title":"External libraries"},{"location":"INSTALL/#install-from-a-release","text":"When downloading from the github release page, make sure to grab the archive rofi-{version}.tar.[g|x]z . The auto-attached files source code (zip|tar.gz) by github do not contain a valid release. It misses a setup build system and includes irrelevant files.","title":"Install from a release"},{"location":"INSTALL/#autotools","text":"Create a build directory and enter it: mkdir build && cd build Check dependencies and configure build system: ../configure Build Rofi: make The actual install, execute as root (if needed): make install The default installation prefix is: /usr/local/ use ./configure --prefix={prefix} to install into another location.","title":"Autotools"},{"location":"INSTALL/#meson","text":"Check dependencies and configure build system: meson setup build Build Rofi: ninja -C build The actual install, execute as root (if needed): ninja -C build install The default installation prefix is: /usr/local/ use meson setup build --prefix={prefix} to install into another location.","title":"Meson"},{"location":"INSTALL/#install-a-checkout-from-git","text":"The GitHub Pages version of these directions may be out of date. Please use INSTALL.md from the online repo or your local repository. If you don't have a checkout: git clone --recursive https://github.com/DaveDavenport/rofi cd rofi/ If you already have a checkout: cd rofi/ git pull git submodule update --init For Autotools you have an extra step, to generate build system: autoreconf -i From this point, use the same steps you use for a release.","title":"Install a checkout from git"},{"location":"INSTALL/#options-for-configure","text":"When you run the configure step there are several options you can configure. For Autotools, you can see the full list with ./configure --help . For Meson, before the initial setup, you can see rofi options in meson_options.txt and Meson options with meson setup --help . Meson's built-in options can be set using regular command line arguments, like so: meson setup build --option=value . Rofi-specific options can be set using the -D argument, like so: meson setup build -Doption=value . After the build dir is set up by meson setup build , the meson configure build command can be used to configure options, by the same means. The most useful one to set is the installation prefix: # Autotools ../configure --prefix= # Meson meson setup build --prefix f.e. # Autotools ../configure --prefix=/usr/ # Meson meson setup build --prefix /usr","title":"Options for configure"},{"location":"INSTALL/#install-locally","text":"or to install locally: # Autotools ../configure --prefix=${HOME}/.local/ # Meson meson setup build --prefix ${HOME}/.local","title":"Install locally"},{"location":"INSTALL/#options-for-make","text":"When you run make you can tweak the build process a little.","title":"Options for make"},{"location":"INSTALL/#verbose-output","text":"Show the commands called: # Autotools make V=1 # Meson ninja -C build -v","title":"Verbose output"},{"location":"INSTALL/#debug-build","text":"Compile with debug symbols and no optimization, this is useful for making backtraces: # Autotools make CFLAGS=\"-O0 -g3\" clean rofi # Meson meson configure build --debug ninja -C build","title":"Debug build"},{"location":"INSTALL/#get-a-backtrace","text":"Getting a backtrace using GDB is not very handy. Because if rofi get stuck, it grabs keyboard and mouse. So if it crashes in GDB you are stuck. The best way to go is to enable core file. (ulimit -c unlimited in bash) then make rofi crash. You can then load the core in GDB. # Autotools gdb rofi core # Meson (because it uses a separate build directory) gdb build/rofi core Where the core file is located and what its exact name is different on each distributions. Please consult the relevant documentation. For more information see the rofi-debugging(5) manpage.","title":"Get a backtrace"},{"location":"INSTALL/#install-distribution","text":"","title":"Install distribution"},{"location":"INSTALL/#debian-or-ubuntu","text":"apt install rofi","title":"Debian or Ubuntu"},{"location":"INSTALL/#fedora","text":"dnf install rofi","title":"Fedora"},{"location":"INSTALL/#archlinux","text":"pacman -S rofi","title":"ArchLinux"},{"location":"INSTALL/#gentoo","text":"An ebuild is available, x11-misc/rofi . It's up to date, but you may need to enable ~arch to get the latest release: echo 'x11-misc/rofi ~amd64' >> /etc/portage/package.accept_keywords for amd64 or: echo 'x11-misc/rofi ~x86' >> /etc/portage/package.accept_keywords for i386. To install it, simply issue emerge rofi .","title":"Gentoo"},{"location":"INSTALL/#opensuse","text":"On both openSUSE Leap and openSUSE Tumbleweed rofi can be installed using: sudo zypper install rofi","title":"openSUSE"},{"location":"INSTALL/#freebsd","text":"sudo pkg install rofi","title":"FreeBSD"},{"location":"INSTALL/#macos","text":"On macOS rofi can be installed via MacPorts : sudo port install rofi","title":"macOS"},{"location":"downloads/","text":"Downloads Development For development no tarball is released. Please follow the Installation instructions for obtaining and compiling development version. 1.7.5 tar.gz tar.xz 1.7.4 tar.gz tar.xz 1.7.3 tar.gz tar.xz 1.7.2 tar.gz tar.xz 1.7.1 tar.gz tar.xz 1.7.0 tar.gz tar.xz","title":"Downloads"},{"location":"downloads/#downloads","text":"","title":"Downloads"},{"location":"downloads/#development","text":"For development no tarball is released. Please follow the Installation instructions for obtaining and compiling development version.","title":"Development"},{"location":"downloads/#175","text":"tar.gz tar.xz","title":"1.7.5"},{"location":"downloads/#174","text":"tar.gz tar.xz","title":"1.7.4"},{"location":"downloads/#173","text":"tar.gz tar.xz","title":"1.7.3"},{"location":"downloads/#172","text":"tar.gz tar.xz","title":"1.7.2"},{"location":"downloads/#171","text":"tar.gz tar.xz","title":"1.7.1"},{"location":"downloads/#170","text":"tar.gz tar.xz","title":"1.7.0"},{"location":"1.7.0/rofi-script.5/","text":"ROFI-SCRIPT 5 rofi-script NAME rofi script mode - Rofi format for scriptable modi. DESCRIPTION rofi supports modes that use simple scripts in the background to generate a list and process the result from user actions. This provide a simple interface to make simple extensions to rofi. USAGE To specify a script mode, set a mode with the following syntax: \"{name}:{executable}\" For example: rofi -show fb -modi \"fb:file_browser.sh\" The name should be unique. API 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\" ] then exit 0 fi echo \"reload\" echo \"quit\" This shows two entries, reload and quit. When the quit entry is selected, rofi closes. Environment Rofi sets the following environment variable when executing the script: ROFI_RETV An integer number with the current state: 0 : Initial call of script. 1 : Selected an entry. 2 : Selected a custom entry. 10-28 : Custom keybinding 1-19 ( need to be explicitly enabled by script ). ROFI_INFO 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. Extra 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: prompt : Update the prompt text. message : Update the message text. markup-rows : If 'true' renders markup in the row. urgent : Mark rows as urgent. (for syntax see the urgent option in dmenu mode) active : Mark rows as active. (for syntax see the active option in dmenu mode) 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. no-custom : If set to 'true'; only accept listed entries, ignore custom input. use-hot-keys : If set to true, it enabled the Custom keybindings for script. Warning this breaks the normal rofi flow. 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 entry. For example: echo -en \"aap\\0icon\\x1ffolder\\n\" The following options are supported: icon : Set the icon for that row. meta : Specify invisible search terms. nonselectable : If true the row cannot activated. info : Info that, on selection, gets placed in the ROFI_INFO environment variable. This entry does not get searched. multiple entries can be passed using the \\x1f separator. echo -en \"aap\\0icon\\x1ffolder\\x1finfo\\x1ftest\\n\" Executing external program If you want to launch an external program from the script, you need to make sure it is launched in the background. If not rofi will wait for its output (to display). In bash the best way to do this is using coproc . coproc ( myApp > /dev/null 2>&1 ) 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 github. SEE ALSO rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-theme-selector(1) AUTHOR Qball Cow qball@gmpclient.org Rasmus Steinke rasi@xssn.at Quentin 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.","title":"Script"},{"location":"1.7.0/rofi-script.5/#rofi-script-5-rofi-script","text":"","title":"ROFI-SCRIPT 5 rofi-script"},{"location":"1.7.0/rofi-script.5/#name","text":"rofi script mode - Rofi format for scriptable modi.","title":"NAME"},{"location":"1.7.0/rofi-script.5/#description","text":"rofi supports modes that use simple scripts in the background to generate a list and process the result from user actions. This provide a simple interface to make simple extensions to rofi.","title":"DESCRIPTION"},{"location":"1.7.0/rofi-script.5/#usage","text":"To specify a script mode, set a mode with the following syntax: \"{name}:{executable}\" For example: rofi -show fb -modi \"fb:file_browser.sh\" The name should be unique.","title":"USAGE"},{"location":"1.7.0/rofi-script.5/#api","text":"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\" ] then exit 0 fi echo \"reload\" echo \"quit\" This shows two entries, reload and quit. When the quit entry is selected, rofi closes.","title":"API"},{"location":"1.7.0/rofi-script.5/#environment","text":"Rofi sets the following environment variable when executing the script:","title":"Environment"},{"location":"1.7.0/rofi-script.5/#rofi_retv","text":"An integer number with the current state: 0 : Initial call of script. 1 : Selected an entry. 2 : Selected a custom entry. 10-28 : Custom keybinding 1-19 ( need to be explicitly enabled by script ).","title":"ROFI_RETV"},{"location":"1.7.0/rofi-script.5/#rofi_info","text":"Environment get set when selected entry get set with the property value of the 'info' row option, if set.","title":"ROFI_INFO"},{"location":"1.7.0/rofi-script.5/#passing-mode-options","text":"Extra options, like setting the prompt, can be set by the script. Extra 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: prompt : Update the prompt text. message : Update the message text. markup-rows : If 'true' renders markup in the row. urgent : Mark rows as urgent. (for syntax see the urgent option in dmenu mode) active : Mark rows as active. (for syntax see the active option in dmenu mode) 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. no-custom : If set to 'true'; only accept listed entries, ignore custom input. use-hot-keys : If set to true, it enabled the Custom keybindings for script. Warning this breaks the normal rofi flow.","title":"Passing mode options"},{"location":"1.7.0/rofi-script.5/#parsing-row-options","text":"Extra options for individual rows can be set. The extra option can be specified following the same syntax as mode option, but following the entry. For example: echo -en \"aap\\0icon\\x1ffolder\\n\" The following options are supported: icon : Set the icon for that row. meta : Specify invisible search terms. nonselectable : If true the row cannot activated. info : Info that, on selection, gets placed in the ROFI_INFO environment variable. This entry does not get searched. multiple entries can be passed using the \\x1f separator. echo -en \"aap\\0icon\\x1ffolder\\x1finfo\\x1ftest\\n\"","title":"Parsing row options"},{"location":"1.7.0/rofi-script.5/#executing-external-program","text":"If you want to launch an external program from the script, you need to make sure it is launched in the background. If not rofi will wait for its output (to display). In bash the best way to do this is using coproc . coproc ( myApp > /dev/null 2>&1 )","title":"Executing external program"},{"location":"1.7.0/rofi-script.5/#dash-shell","text":"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 github.","title":"DASH shell"},{"location":"1.7.0/rofi-script.5/#see-also","text":"rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-theme-selector(1)","title":"SEE ALSO"},{"location":"1.7.0/rofi-script.5/#author","text":"Qball Cow qball@gmpclient.org Rasmus Steinke rasi@xssn.at Quentin 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.","title":"AUTHOR"},{"location":"1.7.0/rofi-theme.5/","text":"ROFI-THEME 5 rofi-theme NAME rofi-theme - Rofi theme format files DESCRIPTION The need for a new theme format was motivated by the fact that the way rofi handled widgets has changed. From a very static drawing of lines and text to a nice structured form of packing widgets. This change made it possible to provide a more flexible theme framework. The old theme format and config file are not flexible enough to expose these options in a user-friendly way. Therefore, a new file format has been created, replacing the old one. FORMAT SPECIFICATION Encoding The encoding of the file is utf-8. Both unix ( \\n ) and windows ( \\r\\n ) newlines format are supported. But unix is preferred. Comments C and C++ file comments are supported. Anything after // and before a newline is considered a comment. Everything between /* and */ is a comment. Comments can be nested and the C comments can be inline. The following is valid: // Magic comment. property: /* comment */ value; However, this is not: prop/*comment*/erty: value; White space White space and newlines, like comments, are ignored by the parser. This: property: name; Is identical to: property : name ; File extension The preferred file extension for the new theme format is rasi . This is an abbreviation for r ofi a dvanced s tyle i nformation. Basic Structure Each element has a section with defined properties. Global properties can be defined in section * { } . Sub-section names begin with a hash symbol # . It is advised to define the global properties section on top of the file to make inheritance of properties clearer. /* Global properties section */ * { // list of properties } /* Element theme section. */ {element path} { // list of properties } {elements... } { // list of properties } If there are multiple sections with the same name, they are merged. Duplicate properties are overwritten and the last parsed entry kept. Global properties section A theme can have one or more global properties sections. If there is more than one, they will be merged. The global properties section denotes the defaults for each element. Each property of this section can be referenced with @{identifier} (See Properties section) A global properties section is indicated with a * as element path. Element theme section A theme can have multiple element theme sections. The element path can consist of multiple names separated by whitespace or dots. Each element may contain any number of letters, numbers and - 's. The first element in the element path should always start with a # . Multiple elements can be specified by a , . This is a valid element name: element normal.normal { background-color: blue; } button { background-color: blue; } And is identical to: element normal normal, button { background-color: blue; } Each section inherits the global properties. Properties can be explicitly inherited from their parent with the inherit keyword. In the following example: window { a: 1; b: 2; children: [ mainbox ]; } mainbox { a: inherit; b: 4; c: 8; } The element mainbox will have the following set of properties (if mainbox is a child of window ): a: 1; b: 4; c: 8; If multiple sections are defined with the same name, they are merged by the parser. If multiple properties with the same name are defined in one section, the last encountered property is used. Properties Format The properties in a section consist of: {identifier}: {value}; Both fields are mandatory for a property. The identifier names the specified property. Identifiers can consist of any combination of numbers, letters and '-'. It must not contain any whitespace. The structure of the value defines the type of the property. The current parser does not define or enforce a certain type of a particular identifier . When used, values with the wrong type that cannot be converted are ignored. The current theme format supports different types: a string an integer number a fractional number a boolean value a color image text style line style a distance a padding a border a position a reference an orientation a cursor a list of keywords an environment variable Inherit Some of these types are a combination of other types. String Format: \"[:print:]+\" A string is always surrounded by double quotes ( \" ). Between the quotes there can be any printable character. For example: font: \"Awasome 12\"; The string must be valid UTF-8. Integer Format: [-+]?[:digit:]+ An integer may contain any number. For examples: lines: 12; Real Format: [-+]?[:digit:]+(\\.[:digit:]+)? A real is an integer with an optional fraction. For example: real: 3.4; The following is not valid: .3 , 3. or scientific notation: 3.4e-3 . Boolean Format: (true|false) Boolean value is either true or false . This is case-sensitive. For example: dynamic: false; Image rofi support a limited set of background-image formats. Format: url(\"path to image\"); Format: url(\"path to image\", scale); where scale is: none, both, width, height Format: linear-gradient(stop color,stop1, color, stop2 color, ...); Format: linear-gradient(to direction, stop color,stop1, color, stop2 color, ...); where direction is: top,left,right,bottom. Format: linear-gradient(angle, stop color,stop1, color, stop2 color, ...); Angle in deg,rad,grad (as used in color). Where the path is a string, and stop color is of type color. Color rofi supports the color formats as specified in the CSS standard (1,2,3 and some of CSS 4) Format: #{HEX}{3} (rgb) Format: #{HEX}{4} (rgba) Format: #{HEX}{6} (rrggbb) Format: #{HEX}{8} (rrggbbaa) Format: rgb[a]({INTEGER},{INTEGER},{INTEGER}[, {PERCENTAGE}]) Format: rgb[a]({INTEGER}%,{INTEGER}%,{INTEGER}%[, {PERCENTAGE}]) Format: hsl[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}]) Format: hwb[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}]) Format: cmyk( {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE} ]) Format: {named-color} [ / {PERCENTAGE} ] The white-space format proposed in CSS4 is also supported. The different values are: {HEX} is a hexadecimal number ('0-9a-f' case insensitive). {INTEGER} value can be between 0 and 255 or 0-100 when representing percentage. {ANGLE} is the angle on the color wheel, can be in deg , rad , grad or turn . When no unit is specified, degrees is assumed. {PERCENTAGE} can be between 0-1.0, or 0%-100% {named-color} is one of the following colors: AliceBlue, AntiqueWhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet, Brown, BurlyWood, CadetBlue, Chartreuse, Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, DarkCyan, DarkGoldenRod, DarkGray, DarkGrey, DarkGreen, DarkKhaki, DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, DarkSalmon, DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkSlateGrey, DarkTurquoise, DarkViolet, DeepPink, DeepSkyBlue, DimGray, DimGrey, DodgerBlue, FireBrick, FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, GoldenRod, Gray, Grey, Green, GreenYellow, HoneyDew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, LemonChiffon, LightBlue, LightCoral, LightCyan, LightGoldenRodYellow, LightGray, LightGrey, LightGreen, LightPink, LightSalmon, LightSeaGreen, LightSkyBlue, LightSlateGray, LightSlateGrey, LightSteelBlue, LightYellow, Lime, LimeGreen, Linen, Magenta, Maroon, MediumAquaMarine, MediumBlue, MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, MintCream, MistyRose, Moccasin, NavajoWhite, Navy, OldLace, Olive, OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenRod, PaleGreen, PaleTurquoise, PaleVioletRed, PapayaWhip, PeachPuff, Peru, Pink, Plum, PowderBlue, Purple, RebeccaPurple, Red, RosyBrown, RoyalBlue, SaddleBrown, Salmon, SandyBrown, SeaGreen, SeaShell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray, SlateGrey, Snow, SpringGreen, SteelBlue, Tan, Teal, Thistle, Tomato, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, YellowGreen,transparent For example: background-color: #FF0000; border-color: rgba(0,0,1, 0.5); text-color: SeaGreen; or background-color: transparent; text-color: Black; Text style Format: (bold|italic|underline|strikethrough|none) Text style indicates how the highlighted text is emphasized. None indicates that no emphasis should be applied. bold : make the text thicker then the surrounding text. italic : put the highlighted text in script type (slanted). underline : put a line under the highlighted text. strikethrough : put a line through the highlighted text. Line style Format: (dash|solid) Indicates how a line should be drawn. It currently supports: * dash : a dashed line, where the gap is the same width as the dash * solid : a solid line Distance Format: {Integer}px Format: {Real}em Format: {Real}ch Format: {Real}% Format: {Integer}mm A distance can be specified in 3 different units: px : Screen pixels. em : Relative to text height. ch : Relative to width of a single number. mm : Actual size in millimeters (based on dpi). % : Percentage of the monitor size. Distances used in the horizontal direction use the monitor width. Distances in the vertical direction use the monitor height. For example: padding: 10%; On a full-HD (1920x1080) monitor, it defines a padding of 192 pixels on the left and right side and 108 pixels on the top and bottom. Calculating sizes Rofi supports some maths in calculating sizes. For this it uses the CSS syntax: width: calc( 100% - 37px ); It supports the following operations: + : Add - : Subtract / : Divide * : Multiply % : Multiply min : Minimum of l or rvalue; max : Maximum of l or rvalue; It uses the C precedence ordering. Padding Format: {Integer} Format: {Distance} Format: {Distance} {Distance} Format: {Distance} {Distance} {Distance} Format: {Distance} {Distance} {Distance} {Distance} If no unit is specified, pixels are assumed. The different number of fields in the formats are parsed like: 1 field: all 2 fields: top&bottom left&right 3 fields: top , left&right , bottom 4 fields: top , right , bottom , left Border Format: {Integer} Format: {Distance} Format: {Distance} {Distance} Format: {Distance} {Distance} {Distance} Format: {Distance} {Distance} {Distance} {Distance} Format: {Distance} {Line style} Format: {Distance} {Line style} {Distance} {Line style} Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style} Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style} {Distance} {Line style} Borders are identical to padding, except that each distance field has a line style property. When no unit is specified, pixels are assumed. Position Indicate a place on the window/monitor. Format: (center|east|north|west|south|north east|north west|south west|south east) north west | north | north east -------------|-------------|------------ west | center | east -------------|-------------|------------ south west | south | south east Visibility It is possible to hide widgets: inputbar { enabled: false; } Reference Format: @{PROPERTY NAME} A reference can point to another reference. Currently, the maximum number of redirects is 20. A property always refers to another property. It cannot be used for a subpart of the property. For example, this is not valid: highlight: bold @pink; But this is: * { myhigh: bold #FAA; } window { highlight: @myhigh; } Orientation Format: (horizontal|vertical) Specify the orientation of the widget. Cursor Format: (default|pointer|text) Specify the type of mouse cursor that is set when the mouse pointer is over the widget. List of keywords Format: [ keyword, keyword ] A list starts with a '[' and ends with a ']'. The entries in the list are comma-separated. The keyword in the list refers to an widget name. Environment variable Format: ${:alnum:} This will parse the environment variable as the property value. (that then can be any of the above types). The environment variable should be an alphanumeric string without white-space. * { background-color: ${BG}; } Inherit Format: inherit Inherits the property from its parent widget. mainbox { border-color: inherit; } ELEMENTS PATHS Element paths exists of two parts, the first part refers to the actual widget by name. Some widgets have an extra state. For example: element selected { } Here element selected is the name of the widget, selected is the state of the widget. The difference between dots and spaces is purely cosmetic. These are all the same: element .selected { element.selected { } element selected { } SUPPORTED ELEMENT PATH Name The current widgets available in rofi : window overlay : the overlay widget. mainbox : The mainbox box. inputbar : The input bar box. box : the horizontal @box packing the widgets case-indicator : the case/sort indicator @textbox prompt : the prompt @textbox entry : the main entry @textbox num-rows : Shows the total number of rows. num-filtered-rows : Shows the total number of rows after filtering. listview : The listview. scrollbar : the listview scrollbar element : a box in the listview holding the entries element-icon : the widget in the listview's entry showing the (optional) icon element-index : the widget in the listview's entry keybindable index (1,2,3..0) element-text : the widget in the listview's entry showing the text. mode-switcher : the main horizontal @box packing the buttons. button : the buttons @textbox for each mode message : The container holding the textbox. textbox : the message textbox Note that these path names match the default theme. Themes that provide a custom layout will have different elements, and structure. State State: State of widget Optional flag(s) indicating state of the widget, used for theming. These are appended after the name or class of the widget. Example: button selected.normal { } element selected.urgent { } Currently only the entrybox and scrollbar have states: Entrybox: {visible modifier}.{state} Where visible modifier can be: * normal: no modification * selected: the entry is selected/highlighted by user * alternate: the entry is at an alternating row (uneven row) Where state is: * normal: no modification * urgent: this entry is marked urgent * active: this entry is marked active These can be mixed. Example: nametotextbox selected.active { background-color: #003642; text-color: #008ed4; } Sets all selected textboxes marked active to the given text and background color. Note that a state modifies the original element, it therefore contains all the properties of that element. Scrollbar The scrollbar uses the handle state when drawing the small scrollbar handle. This allows the colors used for drawing the handle to be set independently. SUPPORTED PROPERTIES The following properties are currently supported: all widgets: enabled : enable/disable the widget padding : padding Padding on the inside of the widget margin : padding Margin on the outside of the widget border : border Border around the widget (between padding and margin)/ border-radius : padding Sets a radius on the corners of the borders. background-color : color Background color background-image : image Background image border-color : color Color of the border cursor : cursor Type of mouse cursor that is set when the mouse pointer is hovered over the widget. window: font : string The font used in the window transparency : string Indicating if transparency should be used and what type: real - True transparency. Only works with a compositor. background - Take a screenshot of the background image and use that. screenshot - Take a screenshot of the screen and use that. Path to png file - Use an image. location : position The place of the anchor on the monitor anchor : anchor The anchor position on the window fullscreen : boolean Window is fullscreen. width : distance The width of the window x-offset : distance y-offset : distance The offset of the window to the anchor point, allowing you to push the window left/right/up/down scrollbar: background-color : color handle-width : distance handle-color : color border-color : color box: orientation : orientation Set the direction the elements are packed. spacing : distance Distance between the packed elements. textbox: background-color : color border-color : the color used for the border around the widget. font : the font used by this textbox (string). str : the string to display by this textbox (string). vertical-align : Vertical alignment of the text. A number between 0 (top) and 1 (bottom). horizontal-align : Horizontal alignment of the text. A number between 0 (left) and 1 (right). text-color : the text color to use. highlight : text style {color}. color is optional, multiple highlight styles can be added like: bold underline italic #000000; This option is only available on the element-text widget. width : override the desired width for the textbox. content : Set the displayed text (String). placeholder : Set the displayed text (String) when nothing is entered. placeholder-color : Color of the placeholder text. blink : Enable/Disable blinking on an input textbox (Boolean). markup : Force markup on, beware that only valid pango markup strings are shown. listview: columns : integer Number of columns to show (at least 1) fixed-height : boolean Always show lines rows, even if fewer elements are available. dynamic : boolean True if the size should change when filtering the list, False if it should keep the original height. scrollbar : boolean If the scrollbar should be enabled/disabled. scrollbar-width : distance Width of the scrollbar cycle : boolean When navigating, it should wrap around spacing : distance Spacing between the elements (both vertical and horizontal) lines : integer Number of rows to show in the list view. layout : orientation Indicate how elements are stacked. Horizontal implements the dmenu style. reverse : boolean Reverse the ordering (top down to bottom up). fixed-columns : boolean Do not reduce the number of columns shown when number of visible elements is not enough to fill them all. Each element is a box called element . Each element can contain an element-icon and element-text . listview text highlight: The element-text widget in the listview is the one used to show the text. On this widget set the highlight property (only place this property is used) to change the style of highlighting. The highlight property consist of the text-style property and a color. To disable highlighting: element-text { highlight: None; } To set to red underlined: element-text { highlight: underline red; } Layout The new format allows the layout of the rofi window to be tweaked extensively. For each widget, the themer can specify padding, margin, border, font, and more. It even allows, as an advanced feature, to pack widgets in a custom structure. Basic structure The whole view is made out of boxes that pack other boxes or widgets. The box can be vertical or horizontal. This is loosely inspired by GTK . The current layout of rofi is structured as follows: |------------------------------------------------------------------------------------| | window {BOX:vertical} | | |-------------------------------------------------------------------------------| | | | mainbox {BOX:vertical} | | | | |---------------------------------------------------------------------------| | | | | | inputbar {BOX:horizontal} | | | | | | |---------| |-| |---------------------------------|---| |---| |---| |---| | | | | | | | prompt | |:| | entry |#fr| | / | |#ns| |ci | | | | | | | |---------| |_| |---------------------------------|---| |---| |---| |---| | | | | | |---------------------------------------------------------------------------| | | | | | | | | |---------------------------------------------------------------------------| | | | | | message | | | | | | |-----------------------------------------------------------------------| | | | | | | | textbox | | | | | | | |-----------------------------------------------------------------------| | | | | | |---------------------------------------------------------------------------| | | | | | | | | |-----------------------------------------------------------------------------| | | | | listview | | | | |-----------------------------------------------------------------------------| | | | | | | | |---------------------------------------------------------------------------| | | | | | mode-switcher {BOX:horizontal} | | | | | | |---------------| |---------------| |--------------| |---------------| | | | | | | | Button | | Button | | Button | | Button | | | | | | | |---------------| |---------------| |--------------| |---------------| | | | | | |---------------------------------------------------------------------------| | | | |-------------------------------------------------------------------------------| | |------------------------------------------------------------------------------------| ci is the case-indicator fr is the num-filtered-rows ns is the num-rows Error message structure |-----------------------------------------------------------------------------------| | window {BOX:vertical} | | |------------------------------------------------------------------------------| | | | error-message {BOX:vertical} | | | | |-------------------------------------------------------------------------| | | | | | textbox | | | | | | |-----------------| |-------------------------------------------------| | | | | | | |element-icon | |element-text | | | | | | | |-----------------| |-------------------------------------------------| | | | | | |-------------------------------------------------------------------------| | | | |------------------------------------------------------------------------------| | |-----------------------------------------------------------------------------------| Advanced layout The layout of rofi can be tweaked by packing the 'fixed' widgets in a custom structure. The following widgets are fixed, as they provide core rofi functionality: prompt entry overlay case-indicator message listview mode-switcher num-rows num-filtered-rows The following keywords are defined and can be used to automatically pack a subset of the widgets. These are used in the default theme as depicted in the figure above. mainbox Packs: inputbar, message, listview, mode-switcher inputbar Packs: prompt,entry,case-indicator Any widget name starting with textbox is a textbox widget, others are box widgets and can pack other widgets. There are several special widgets that can be used by prefixing the name of the widget: textbox This is a read-only textbox widget. The displayed string can be set with content . Example: textbox-custom { expand: false; content: \"My Message\"; } Icon This is an icon widget. The displayed icon can be set with filename and size with size . If the property action is set, it acts as a button. action can be set to a keybinding name and completes that action. (see rofi -show keys for a list). If the squared property is set to false the widget height and width are not forced to be equal. Example: icon-paste { expand: false; filename: \"gtk-paste\"; size: 24; vertical-align: 0.5; action: \"kb-primary-paste\"; } button This is a textbox widget that can have a 'clickable' action. The action can be set to: keybinding : accepts a keybinding name and completes that action. (see rofi -show keys for a list). button-paste { expand: false; content: \"My Clickable Message\"; vertical-align: 0.5; action: \"kb-primary-paste\"; } Children To specify children, set the children property (this always happens on the box child, see example below): inputbar { children: [prompt,entry,overlay,case-indicator]; } The theme needs to be updated to match the hierarchy specified. Below is an example of a theme emulating dmenu: * { background-color: Black; text-color: White; border-color: White; font: \"Times New Roman 12\"; } window { anchor: north; location: north; width: 100%; padding: 4px; children: [ horibox ]; } horibox { orientation: horizontal; children: [ prompt, entry, listview ]; } listview { layout: horizontal; spacing: 5px; lines: 10; } entry { expand: false; width: 10em; } element { padding: 0px 2px; } element selected { background-color: SteelBlue; } Padding and margin Just like CSS, rofi uses the box model for each widget. |-------------------------------------------------------------------| | margin | | |-------------------------------------------------------------| | | | border | | | | |---------------------------------------------------------| | | | | | padding | | | | | | |-----------------------------------------------------| | | | | | | | content | | | | | | | |-----------------------------------------------------| | | | | | |---------------------------------------------------------| | | | |-------------------------------------------------------------| | |-------------------------------------------------------------------| Explanation of the different parts: Content - The content of the widget. Padding - Clears an area around the widget. The padding shows the background color of the widget. Border - A border that goes around the padding and content. The border use the border-color of the widget. Margin - Clears an area outside the border. The margin is transparent. The box model allows us to add a border around elements, and to define space between elements. The size of each margin, border, and padding can be set. For the border, a linestyle and radius can be set. Spacing Widgets that can pack more then one child widget (currently box and listview) have the spacing property. This property sets the distance between the packed widgets (both horizontally and vertically). |---------------------------------------| | |--------| s |--------| s |-------| | | | child | p | child | p | child | | | | | a | | a | | | | | | c | | c | | | | | | i | | i | | | | | | n | | n | | | | |--------| g |--------| g |-------| | |---------------------------------------| Advanced box packing More dynamic spacing can be achieved by adding dummy widgets, for example to make one widget centered: |--------------------------------------------| | |-----------| |--------| |-----------| | | | dummy | | child | | dummy | | | | expand: y | | | | expand: y | | | | | | | | | | | | | | | | | | | | | | | | | | | |-----------| |--------| |-----------| | |--------------------------------------------| If both dummy widgets are set to expand, child will be centered. Depending on the expand flag of child the remaining space will be equally divided between both dummy and child widget (expand enabled), or both dummy widgets (expand disabled). DEBUGGING To get debug information from the parser, run rofi like: G_MESSAGES_DEBUG=Parser rofi -show run Syntax errors are shown in a popup and printed out to command line with the above command. To see the elements queried during running, run: G_MESSAGES_DEBUG=Theme rofi -show run To test minor changes, part of the theme can be passed on the command line, for example to set it to full-screen: rofi -theme-str 'window { fullscreen:true;}' -show run To print the current theme, run: rofi -dump-theme Media support Parts of the theme can be conditionally loaded, like the CSS @media option. @media ( min-width: 120 ) { } It supports the following keys as constraint: min-width : load when width is bigger or equal then value. max-width : load when width is smaller then value. min-height : load when height is bigger or equal then value. max-height : load when height is smaller then value. min-aspect-ratio load when aspect ratio is over value. max-aspect-ratio : load when aspect ratio is under value. monitor-id : The monitor id, see rofi -help for id's. @media takes an integer number or a fraction, for integer number px can be added. @media ( min-width: 120 px ) { } Font Parsing Rofi uses pango for font rendering. The font should be specified in a format that pango understands. This normally is the font name followed by the font size. For example: mono 18 Or FontAwesome 22 Multiple file handling The rasi file format offers two methods of including other files. This can be used to modify existing themes, or have multiple variations on a theme. import: Import and parse a second file. theme: Discard theme, and load file as a fresh theme. Syntax: @import \"myfile\" @theme \"mytheme\" The specified file can either by name , filename , full path . If a filename is provided, it will try to resolve it in the following order: ${XDG_CONFIG_HOME}/rofi/themes/ ${XDG_CONFIG_HOME}/rofi/ ${XDG_DATA_HOME}/rofi/themes/ ${INSTALL PREFIX}/share/rofi/themes/ A name is resolved as a filename by appending the .rasi extension. EXAMPLES Several examples are installed together with rofi . These can be found in {datadir}/rofi/themes/ , where {datadir} is the install path of rofi data. When installed using a package manager, this is usually: /usr/share/ . SEE ALSO rofi(1), rofi-script(5), rofi-theme-selector(1)","title":"Themes"},{"location":"1.7.0/rofi-theme.5/#rofi-theme-5-rofi-theme","text":"","title":"ROFI-THEME 5 rofi-theme"},{"location":"1.7.0/rofi-theme.5/#name","text":"rofi-theme - Rofi theme format files","title":"NAME"},{"location":"1.7.0/rofi-theme.5/#description","text":"The need for a new theme format was motivated by the fact that the way rofi handled widgets has changed. From a very static drawing of lines and text to a nice structured form of packing widgets. This change made it possible to provide a more flexible theme framework. The old theme format and config file are not flexible enough to expose these options in a user-friendly way. Therefore, a new file format has been created, replacing the old one.","title":"DESCRIPTION"},{"location":"1.7.0/rofi-theme.5/#format-specification","text":"","title":"FORMAT SPECIFICATION"},{"location":"1.7.0/rofi-theme.5/#encoding","text":"The encoding of the file is utf-8. Both unix ( \\n ) and windows ( \\r\\n ) newlines format are supported. But unix is preferred.","title":"Encoding"},{"location":"1.7.0/rofi-theme.5/#comments","text":"C and C++ file comments are supported. Anything after // and before a newline is considered a comment. Everything between /* and */ is a comment. Comments can be nested and the C comments can be inline. The following is valid: // Magic comment. property: /* comment */ value; However, this is not: prop/*comment*/erty: value;","title":"Comments"},{"location":"1.7.0/rofi-theme.5/#white-space","text":"White space and newlines, like comments, are ignored by the parser. This: property: name; Is identical to: property : name ;","title":"White space"},{"location":"1.7.0/rofi-theme.5/#file-extension","text":"The preferred file extension for the new theme format is rasi . This is an abbreviation for r ofi a dvanced s tyle i nformation.","title":"File extension"},{"location":"1.7.0/rofi-theme.5/#basic-structure","text":"Each element has a section with defined properties. Global properties can be defined in section * { } . Sub-section names begin with a hash symbol # . It is advised to define the global properties section on top of the file to make inheritance of properties clearer. /* Global properties section */ * { // list of properties } /* Element theme section. */ {element path} { // list of properties } {elements... } { // list of properties } If there are multiple sections with the same name, they are merged. Duplicate properties are overwritten and the last parsed entry kept.","title":"Basic Structure"},{"location":"1.7.0/rofi-theme.5/#global-properties-section","text":"A theme can have one or more global properties sections. If there is more than one, they will be merged. The global properties section denotes the defaults for each element. Each property of this section can be referenced with @{identifier} (See Properties section) A global properties section is indicated with a * as element path.","title":"Global properties section"},{"location":"1.7.0/rofi-theme.5/#element-theme-section","text":"A theme can have multiple element theme sections. The element path can consist of multiple names separated by whitespace or dots. Each element may contain any number of letters, numbers and - 's. The first element in the element path should always start with a # . Multiple elements can be specified by a , . This is a valid element name: element normal.normal { background-color: blue; } button { background-color: blue; } And is identical to: element normal normal, button { background-color: blue; } Each section inherits the global properties. Properties can be explicitly inherited from their parent with the inherit keyword. In the following example: window { a: 1; b: 2; children: [ mainbox ]; } mainbox { a: inherit; b: 4; c: 8; } The element mainbox will have the following set of properties (if mainbox is a child of window ): a: 1; b: 4; c: 8; If multiple sections are defined with the same name, they are merged by the parser. If multiple properties with the same name are defined in one section, the last encountered property is used.","title":"Element theme section"},{"location":"1.7.0/rofi-theme.5/#properties-format","text":"The properties in a section consist of: {identifier}: {value}; Both fields are mandatory for a property. The identifier names the specified property. Identifiers can consist of any combination of numbers, letters and '-'. It must not contain any whitespace. The structure of the value defines the type of the property. The current parser does not define or enforce a certain type of a particular identifier . When used, values with the wrong type that cannot be converted are ignored. The current theme format supports different types: a string an integer number a fractional number a boolean value a color image text style line style a distance a padding a border a position a reference an orientation a cursor a list of keywords an environment variable Inherit Some of these types are a combination of other types.","title":"Properties Format"},{"location":"1.7.0/rofi-theme.5/#string","text":"Format: \"[:print:]+\" A string is always surrounded by double quotes ( \" ). Between the quotes there can be any printable character. For example: font: \"Awasome 12\"; The string must be valid UTF-8.","title":"String"},{"location":"1.7.0/rofi-theme.5/#integer","text":"Format: [-+]?[:digit:]+ An integer may contain any number. For examples: lines: 12;","title":"Integer"},{"location":"1.7.0/rofi-theme.5/#real","text":"Format: [-+]?[:digit:]+(\\.[:digit:]+)? A real is an integer with an optional fraction. For example: real: 3.4; The following is not valid: .3 , 3. or scientific notation: 3.4e-3 .","title":"Real"},{"location":"1.7.0/rofi-theme.5/#boolean","text":"Format: (true|false) Boolean value is either true or false . This is case-sensitive. For example: dynamic: false;","title":"Boolean"},{"location":"1.7.0/rofi-theme.5/#image","text":"rofi support a limited set of background-image formats. Format: url(\"path to image\"); Format: url(\"path to image\", scale); where scale is: none, both, width, height Format: linear-gradient(stop color,stop1, color, stop2 color, ...); Format: linear-gradient(to direction, stop color,stop1, color, stop2 color, ...); where direction is: top,left,right,bottom. Format: linear-gradient(angle, stop color,stop1, color, stop2 color, ...); Angle in deg,rad,grad (as used in color). Where the path is a string, and stop color is of type color.","title":"Image"},{"location":"1.7.0/rofi-theme.5/#color","text":"rofi supports the color formats as specified in the CSS standard (1,2,3 and some of CSS 4) Format: #{HEX}{3} (rgb) Format: #{HEX}{4} (rgba) Format: #{HEX}{6} (rrggbb) Format: #{HEX}{8} (rrggbbaa) Format: rgb[a]({INTEGER},{INTEGER},{INTEGER}[, {PERCENTAGE}]) Format: rgb[a]({INTEGER}%,{INTEGER}%,{INTEGER}%[, {PERCENTAGE}]) Format: hsl[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}]) Format: hwb[a]( {ANGLE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE}]) Format: cmyk( {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE}, {PERCENTAGE} [, {PERCENTAGE} ]) Format: {named-color} [ / {PERCENTAGE} ] The white-space format proposed in CSS4 is also supported. The different values are: {HEX} is a hexadecimal number ('0-9a-f' case insensitive). {INTEGER} value can be between 0 and 255 or 0-100 when representing percentage. {ANGLE} is the angle on the color wheel, can be in deg , rad , grad or turn . When no unit is specified, degrees is assumed. {PERCENTAGE} can be between 0-1.0, or 0%-100% {named-color} is one of the following colors: AliceBlue, AntiqueWhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet, Brown, BurlyWood, CadetBlue, Chartreuse, Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, DarkCyan, DarkGoldenRod, DarkGray, DarkGrey, DarkGreen, DarkKhaki, DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, DarkSalmon, DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkSlateGrey, DarkTurquoise, DarkViolet, DeepPink, DeepSkyBlue, DimGray, DimGrey, DodgerBlue, FireBrick, FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, GoldenRod, Gray, Grey, Green, GreenYellow, HoneyDew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, LemonChiffon, LightBlue, LightCoral, LightCyan, LightGoldenRodYellow, LightGray, LightGrey, LightGreen, LightPink, LightSalmon, LightSeaGreen, LightSkyBlue, LightSlateGray, LightSlateGrey, LightSteelBlue, LightYellow, Lime, LimeGreen, Linen, Magenta, Maroon, MediumAquaMarine, MediumBlue, MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, MintCream, MistyRose, Moccasin, NavajoWhite, Navy, OldLace, Olive, OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenRod, PaleGreen, PaleTurquoise, PaleVioletRed, PapayaWhip, PeachPuff, Peru, Pink, Plum, PowderBlue, Purple, RebeccaPurple, Red, RosyBrown, RoyalBlue, SaddleBrown, Salmon, SandyBrown, SeaGreen, SeaShell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray, SlateGrey, Snow, SpringGreen, SteelBlue, Tan, Teal, Thistle, Tomato, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, YellowGreen,transparent For example: background-color: #FF0000; border-color: rgba(0,0,1, 0.5); text-color: SeaGreen; or background-color: transparent; text-color: Black;","title":"Color"},{"location":"1.7.0/rofi-theme.5/#text-style","text":"Format: (bold|italic|underline|strikethrough|none) Text style indicates how the highlighted text is emphasized. None indicates that no emphasis should be applied. bold : make the text thicker then the surrounding text. italic : put the highlighted text in script type (slanted). underline : put a line under the highlighted text. strikethrough : put a line through the highlighted text.","title":"Text style"},{"location":"1.7.0/rofi-theme.5/#line-style","text":"Format: (dash|solid) Indicates how a line should be drawn. It currently supports: * dash : a dashed line, where the gap is the same width as the dash * solid : a solid line","title":"Line style"},{"location":"1.7.0/rofi-theme.5/#distance","text":"Format: {Integer}px Format: {Real}em Format: {Real}ch Format: {Real}% Format: {Integer}mm A distance can be specified in 3 different units: px : Screen pixels. em : Relative to text height. ch : Relative to width of a single number. mm : Actual size in millimeters (based on dpi). % : Percentage of the monitor size. Distances used in the horizontal direction use the monitor width. Distances in the vertical direction use the monitor height. For example: padding: 10%; On a full-HD (1920x1080) monitor, it defines a padding of 192 pixels on the left and right side and 108 pixels on the top and bottom.","title":"Distance"},{"location":"1.7.0/rofi-theme.5/#calculating-sizes","text":"Rofi supports some maths in calculating sizes. For this it uses the CSS syntax: width: calc( 100% - 37px ); It supports the following operations: + : Add - : Subtract / : Divide * : Multiply % : Multiply min : Minimum of l or rvalue; max : Maximum of l or rvalue; It uses the C precedence ordering.","title":"Calculating sizes"},{"location":"1.7.0/rofi-theme.5/#padding","text":"Format: {Integer} Format: {Distance} Format: {Distance} {Distance} Format: {Distance} {Distance} {Distance} Format: {Distance} {Distance} {Distance} {Distance} If no unit is specified, pixels are assumed. The different number of fields in the formats are parsed like: 1 field: all 2 fields: top&bottom left&right 3 fields: top , left&right , bottom 4 fields: top , right , bottom , left","title":"Padding"},{"location":"1.7.0/rofi-theme.5/#border","text":"Format: {Integer} Format: {Distance} Format: {Distance} {Distance} Format: {Distance} {Distance} {Distance} Format: {Distance} {Distance} {Distance} {Distance} Format: {Distance} {Line style} Format: {Distance} {Line style} {Distance} {Line style} Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style} Format: {Distance} {Line style} {Distance} {Line style} {Distance} {Line style} {Distance} {Line style} Borders are identical to padding, except that each distance field has a line style property. When no unit is specified, pixels are assumed.","title":"Border"},{"location":"1.7.0/rofi-theme.5/#position","text":"Indicate a place on the window/monitor. Format: (center|east|north|west|south|north east|north west|south west|south east) north west | north | north east -------------|-------------|------------ west | center | east -------------|-------------|------------ south west | south | south east","title":"Position"},{"location":"1.7.0/rofi-theme.5/#visibility","text":"It is possible to hide widgets: inputbar { enabled: false; }","title":"Visibility"},{"location":"1.7.0/rofi-theme.5/#reference","text":"Format: @{PROPERTY NAME} A reference can point to another reference. Currently, the maximum number of redirects is 20. A property always refers to another property. It cannot be used for a subpart of the property. For example, this is not valid: highlight: bold @pink; But this is: * { myhigh: bold #FAA; } window { highlight: @myhigh; }","title":"Reference"},{"location":"1.7.0/rofi-theme.5/#orientation","text":"Format: (horizontal|vertical) Specify the orientation of the widget.","title":"Orientation"},{"location":"1.7.0/rofi-theme.5/#cursor","text":"Format: (default|pointer|text) Specify the type of mouse cursor that is set when the mouse pointer is over the widget.","title":"Cursor"},{"location":"1.7.0/rofi-theme.5/#list-of-keywords","text":"Format: [ keyword, keyword ] A list starts with a '[' and ends with a ']'. The entries in the list are comma-separated. The keyword in the list refers to an widget name.","title":"List of keywords"},{"location":"1.7.0/rofi-theme.5/#environment-variable","text":"Format: ${:alnum:} This will parse the environment variable as the property value. (that then can be any of the above types). The environment variable should be an alphanumeric string without white-space. * { background-color: ${BG}; }","title":"Environment variable"},{"location":"1.7.0/rofi-theme.5/#inherit","text":"Format: inherit Inherits the property from its parent widget. mainbox { border-color: inherit; }","title":"Inherit"},{"location":"1.7.0/rofi-theme.5/#elements-paths","text":"Element paths exists of two parts, the first part refers to the actual widget by name. Some widgets have an extra state. For example: element selected { } Here element selected is the name of the widget, selected is the state of the widget. The difference between dots and spaces is purely cosmetic. These are all the same: element .selected { element.selected { } element selected { }","title":"ELEMENTS PATHS"},{"location":"1.7.0/rofi-theme.5/#supported-element-path","text":"","title":"SUPPORTED ELEMENT PATH"},{"location":"1.7.0/rofi-theme.5/#name_1","text":"The current widgets available in rofi : window overlay : the overlay widget. mainbox : The mainbox box. inputbar : The input bar box. box : the horizontal @box packing the widgets case-indicator : the case/sort indicator @textbox prompt : the prompt @textbox entry : the main entry @textbox num-rows : Shows the total number of rows. num-filtered-rows : Shows the total number of rows after filtering. listview : The listview. scrollbar : the listview scrollbar element : a box in the listview holding the entries element-icon : the widget in the listview's entry showing the (optional) icon element-index : the widget in the listview's entry keybindable index (1,2,3..0) element-text : the widget in the listview's entry showing the text. mode-switcher : the main horizontal @box packing the buttons. button : the buttons @textbox for each mode message : The container holding the textbox. textbox : the message textbox Note that these path names match the default theme. Themes that provide a custom layout will have different elements, and structure.","title":"Name"},{"location":"1.7.0/rofi-theme.5/#state","text":"State: State of widget Optional flag(s) indicating state of the widget, used for theming. These are appended after the name or class of the widget.","title":"State"},{"location":"1.7.0/rofi-theme.5/#example","text":"button selected.normal { } element selected.urgent { } Currently only the entrybox and scrollbar have states:","title":"Example:"},{"location":"1.7.0/rofi-theme.5/#entrybox","text":"{visible modifier}.{state} Where visible modifier can be: * normal: no modification * selected: the entry is selected/highlighted by user * alternate: the entry is at an alternating row (uneven row) Where state is: * normal: no modification * urgent: this entry is marked urgent * active: this entry is marked active These can be mixed. Example: nametotextbox selected.active { background-color: #003642; text-color: #008ed4; } Sets all selected textboxes marked active to the given text and background color. Note that a state modifies the original element, it therefore contains all the properties of that element.","title":"Entrybox:"},{"location":"1.7.0/rofi-theme.5/#scrollbar","text":"The scrollbar uses the handle state when drawing the small scrollbar handle. This allows the colors used for drawing the handle to be set independently.","title":"Scrollbar"},{"location":"1.7.0/rofi-theme.5/#supported-properties","text":"The following properties are currently supported:","title":"SUPPORTED PROPERTIES"},{"location":"1.7.0/rofi-theme.5/#all-widgets","text":"enabled : enable/disable the widget padding : padding Padding on the inside of the widget margin : padding Margin on the outside of the widget border : border Border around the widget (between padding and margin)/ border-radius : padding Sets a radius on the corners of the borders. background-color : color Background color background-image : image Background image border-color : color Color of the border cursor : cursor Type of mouse cursor that is set when the mouse pointer is hovered over the widget.","title":"all widgets:"},{"location":"1.7.0/rofi-theme.5/#window","text":"font : string The font used in the window transparency : string Indicating if transparency should be used and what type: real - True transparency. Only works with a compositor. background - Take a screenshot of the background image and use that. screenshot - Take a screenshot of the screen and use that. Path to png file - Use an image. location : position The place of the anchor on the monitor anchor : anchor The anchor position on the window fullscreen : boolean Window is fullscreen. width : distance The width of the window x-offset : distance y-offset : distance The offset of the window to the anchor point, allowing you to push the window left/right/up/down","title":"window:"},{"location":"1.7.0/rofi-theme.5/#scrollbar_1","text":"background-color : color handle-width : distance handle-color : color border-color : color","title":"scrollbar:"},{"location":"1.7.0/rofi-theme.5/#box","text":"orientation : orientation Set the direction the elements are packed. spacing : distance Distance between the packed elements.","title":"box:"},{"location":"1.7.0/rofi-theme.5/#textbox","text":"background-color : color border-color : the color used for the border around the widget. font : the font used by this textbox (string). str : the string to display by this textbox (string). vertical-align : Vertical alignment of the text. A number between 0 (top) and 1 (bottom). horizontal-align : Horizontal alignment of the text. A number between 0 (left) and 1 (right). text-color : the text color to use. highlight : text style {color}. color is optional, multiple highlight styles can be added like: bold underline italic #000000; This option is only available on the element-text widget. width : override the desired width for the textbox. content : Set the displayed text (String). placeholder : Set the displayed text (String) when nothing is entered. placeholder-color : Color of the placeholder text. blink : Enable/Disable blinking on an input textbox (Boolean). markup : Force markup on, beware that only valid pango markup strings are shown.","title":"textbox:"},{"location":"1.7.0/rofi-theme.5/#listview","text":"columns : integer Number of columns to show (at least 1) fixed-height : boolean Always show lines rows, even if fewer elements are available. dynamic : boolean True if the size should change when filtering the list, False if it should keep the original height. scrollbar : boolean If the scrollbar should be enabled/disabled. scrollbar-width : distance Width of the scrollbar cycle : boolean When navigating, it should wrap around spacing : distance Spacing between the elements (both vertical and horizontal) lines : integer Number of rows to show in the list view. layout : orientation Indicate how elements are stacked. Horizontal implements the dmenu style. reverse : boolean Reverse the ordering (top down to bottom up). fixed-columns : boolean Do not reduce the number of columns shown when number of visible elements is not enough to fill them all. Each element is a box called element . Each element can contain an element-icon and element-text .","title":"listview:"},{"location":"1.7.0/rofi-theme.5/#listview-text-highlight","text":"The element-text widget in the listview is the one used to show the text. On this widget set the highlight property (only place this property is used) to change the style of highlighting. The highlight property consist of the text-style property and a color. To disable highlighting: element-text { highlight: None; } To set to red underlined: element-text { highlight: underline red; }","title":"listview text highlight:"},{"location":"1.7.0/rofi-theme.5/#layout","text":"The new format allows the layout of the rofi window to be tweaked extensively. For each widget, the themer can specify padding, margin, border, font, and more. It even allows, as an advanced feature, to pack widgets in a custom structure.","title":"Layout"},{"location":"1.7.0/rofi-theme.5/#basic-structure_1","text":"The whole view is made out of boxes that pack other boxes or widgets. The box can be vertical or horizontal. This is loosely inspired by GTK . The current layout of rofi is structured as follows: |------------------------------------------------------------------------------------| | window {BOX:vertical} | | |-------------------------------------------------------------------------------| | | | mainbox {BOX:vertical} | | | | |---------------------------------------------------------------------------| | | | | | inputbar {BOX:horizontal} | | | | | | |---------| |-| |---------------------------------|---| |---| |---| |---| | | | | | | | prompt | |:| | entry |#fr| | / | |#ns| |ci | | | | | | | |---------| |_| |---------------------------------|---| |---| |---| |---| | | | | | |---------------------------------------------------------------------------| | | | | | | | | |---------------------------------------------------------------------------| | | | | | message | | | | | | |-----------------------------------------------------------------------| | | | | | | | textbox | | | | | | | |-----------------------------------------------------------------------| | | | | | |---------------------------------------------------------------------------| | | | | | | | | |-----------------------------------------------------------------------------| | | | | listview | | | | |-----------------------------------------------------------------------------| | | | | | | | |---------------------------------------------------------------------------| | | | | | mode-switcher {BOX:horizontal} | | | | | | |---------------| |---------------| |--------------| |---------------| | | | | | | | Button | | Button | | Button | | Button | | | | | | | |---------------| |---------------| |--------------| |---------------| | | | | | |---------------------------------------------------------------------------| | | | |-------------------------------------------------------------------------------| | |------------------------------------------------------------------------------------| ci is the case-indicator fr is the num-filtered-rows ns is the num-rows","title":"Basic structure"},{"location":"1.7.0/rofi-theme.5/#error-message-structure","text":"|-----------------------------------------------------------------------------------| | window {BOX:vertical} | | |------------------------------------------------------------------------------| | | | error-message {BOX:vertical} | | | | |-------------------------------------------------------------------------| | | | | | textbox | | | | | | |-----------------| |-------------------------------------------------| | | | | | | |element-icon | |element-text | | | | | | | |-----------------| |-------------------------------------------------| | | | | | |-------------------------------------------------------------------------| | | | |------------------------------------------------------------------------------| | |-----------------------------------------------------------------------------------|","title":"Error message structure"},{"location":"1.7.0/rofi-theme.5/#advanced-layout","text":"The layout of rofi can be tweaked by packing the 'fixed' widgets in a custom structure. The following widgets are fixed, as they provide core rofi functionality: prompt entry overlay case-indicator message listview mode-switcher num-rows num-filtered-rows The following keywords are defined and can be used to automatically pack a subset of the widgets. These are used in the default theme as depicted in the figure above. mainbox Packs: inputbar, message, listview, mode-switcher inputbar Packs: prompt,entry,case-indicator Any widget name starting with textbox is a textbox widget, others are box widgets and can pack other widgets. There are several special widgets that can be used by prefixing the name of the widget:","title":"Advanced layout"},{"location":"1.7.0/rofi-theme.5/#textbox_1","text":"This is a read-only textbox widget. The displayed string can be set with content . Example: textbox-custom { expand: false; content: \"My Message\"; }","title":"textbox"},{"location":"1.7.0/rofi-theme.5/#icon","text":"This is an icon widget. The displayed icon can be set with filename and size with size . If the property action is set, it acts as a button. action can be set to a keybinding name and completes that action. (see rofi -show keys for a list). If the squared property is set to false the widget height and width are not forced to be equal. Example: icon-paste { expand: false; filename: \"gtk-paste\"; size: 24; vertical-align: 0.5; action: \"kb-primary-paste\"; }","title":"Icon"},{"location":"1.7.0/rofi-theme.5/#button","text":"This is a textbox widget that can have a 'clickable' action. The action can be set to: keybinding : accepts a keybinding name and completes that action. (see rofi -show keys for a list). button-paste { expand: false; content: \"My Clickable Message\"; vertical-align: 0.5; action: \"kb-primary-paste\"; }","title":"button"},{"location":"1.7.0/rofi-theme.5/#children","text":"To specify children, set the children property (this always happens on the box child, see example below): inputbar { children: [prompt,entry,overlay,case-indicator]; } The theme needs to be updated to match the hierarchy specified. Below is an example of a theme emulating dmenu: * { background-color: Black; text-color: White; border-color: White; font: \"Times New Roman 12\"; } window { anchor: north; location: north; width: 100%; padding: 4px; children: [ horibox ]; } horibox { orientation: horizontal; children: [ prompt, entry, listview ]; } listview { layout: horizontal; spacing: 5px; lines: 10; } entry { expand: false; width: 10em; } element { padding: 0px 2px; } element selected { background-color: SteelBlue; }","title":"Children"},{"location":"1.7.0/rofi-theme.5/#padding-and-margin","text":"Just like CSS, rofi uses the box model for each widget. |-------------------------------------------------------------------| | margin | | |-------------------------------------------------------------| | | | border | | | | |---------------------------------------------------------| | | | | | padding | | | | | | |-----------------------------------------------------| | | | | | | | content | | | | | | | |-----------------------------------------------------| | | | | | |---------------------------------------------------------| | | | |-------------------------------------------------------------| | |-------------------------------------------------------------------| Explanation of the different parts: Content - The content of the widget. Padding - Clears an area around the widget. The padding shows the background color of the widget. Border - A border that goes around the padding and content. The border use the border-color of the widget. Margin - Clears an area outside the border. The margin is transparent. The box model allows us to add a border around elements, and to define space between elements. The size of each margin, border, and padding can be set. For the border, a linestyle and radius can be set.","title":"Padding and margin"},{"location":"1.7.0/rofi-theme.5/#spacing","text":"Widgets that can pack more then one child widget (currently box and listview) have the spacing property. This property sets the distance between the packed widgets (both horizontally and vertically). |---------------------------------------| | |--------| s |--------| s |-------| | | | child | p | child | p | child | | | | | a | | a | | | | | | c | | c | | | | | | i | | i | | | | | | n | | n | | | | |--------| g |--------| g |-------| | |---------------------------------------|","title":"Spacing"},{"location":"1.7.0/rofi-theme.5/#advanced-box-packing","text":"More dynamic spacing can be achieved by adding dummy widgets, for example to make one widget centered: |--------------------------------------------| | |-----------| |--------| |-----------| | | | dummy | | child | | dummy | | | | expand: y | | | | expand: y | | | | | | | | | | | | | | | | | | | | | | | | | | | |-----------| |--------| |-----------| | |--------------------------------------------| If both dummy widgets are set to expand, child will be centered. Depending on the expand flag of child the remaining space will be equally divided between both dummy and child widget (expand enabled), or both dummy widgets (expand disabled).","title":"Advanced box packing"},{"location":"1.7.0/rofi-theme.5/#debugging","text":"To get debug information from the parser, run rofi like: G_MESSAGES_DEBUG=Parser rofi -show run Syntax errors are shown in a popup and printed out to command line with the above command. To see the elements queried during running, run: G_MESSAGES_DEBUG=Theme rofi -show run To test minor changes, part of the theme can be passed on the command line, for example to set it to full-screen: rofi -theme-str 'window { fullscreen:true;}' -show run To print the current theme, run: rofi -dump-theme","title":"DEBUGGING"},{"location":"1.7.0/rofi-theme.5/#media-support","text":"Parts of the theme can be conditionally loaded, like the CSS @media option. @media ( min-width: 120 ) { } It supports the following keys as constraint: min-width : load when width is bigger or equal then value. max-width : load when width is smaller then value. min-height : load when height is bigger or equal then value. max-height : load when height is smaller then value. min-aspect-ratio load when aspect ratio is over value. max-aspect-ratio : load when aspect ratio is under value. monitor-id : The monitor id, see rofi -help for id's. @media takes an integer number or a fraction, for integer number px can be added. @media ( min-width: 120 px ) { }","title":"Media support"},{"location":"1.7.0/rofi-theme.5/#font-parsing","text":"Rofi uses pango for font rendering. The font should be specified in a format that pango understands. This normally is the font name followed by the font size. For example: mono 18 Or FontAwesome 22","title":"Font Parsing"},{"location":"1.7.0/rofi-theme.5/#multiple-file-handling","text":"The rasi file format offers two methods of including other files. This can be used to modify existing themes, or have multiple variations on a theme. import: Import and parse a second file. theme: Discard theme, and load file as a fresh theme. Syntax: @import \"myfile\" @theme \"mytheme\" The specified file can either by name , filename , full path . If a filename is provided, it will try to resolve it in the following order: ${XDG_CONFIG_HOME}/rofi/themes/ ${XDG_CONFIG_HOME}/rofi/ ${XDG_DATA_HOME}/rofi/themes/ ${INSTALL PREFIX}/share/rofi/themes/ A name is resolved as a filename by appending the .rasi extension.","title":"Multiple file handling"},{"location":"1.7.0/rofi-theme.5/#examples","text":"Several examples are installed together with rofi . These can be found in {datadir}/rofi/themes/ , where {datadir} is the install path of rofi data. When installed using a package manager, this is usually: /usr/share/ .","title":"EXAMPLES"},{"location":"1.7.0/rofi-theme.5/#see-also","text":"rofi(1), rofi-script(5), rofi-theme-selector(1)","title":"SEE ALSO"},{"location":"1.7.0/rofi.1/","text":"ROFI 1 rofi NAME rofi - A window switcher, application launcher, ssh dialog, dmenu replacement and more SYNOPSIS rofi [ -show mode ]|[ -dmenu ]|[ -e msg ] [ CONFIGURATION ] DESCRIPTION rofi is an X11 pop-up window switcher, run dialog, dmenu replacement, and more. It focuses on being fast to use and have minimal distraction. It supports keyboard and mouse navigation, type to filter, tokenized search and more. USAGE rofi 's main functionality is to assist in your workflow, allowing you to quickly switch between windows, start applications or log into a remote machine via ssh . There are different modi for different types of actions. rofi can also function as (drop-in) replacement for dmenu(1) . Running rofi To launch rofi directly in a certain mode, specify a mode with rofi -show . To show the run dialog: rofi -show run Emulating dmenu rofi can emulate dmenu(1) (a dynamic menu for X11) when launched with the -dmenu flag. The website for dmenu can be found here . 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). Display Error message rofi error dialog can also be called from the command line. rofi -e \"my message\" Markup support can be enabled, see CONFIGURATION options. CONFIGURATION There are currently three methods of setting configuration options (evaluated in order below): System configuration file (for example /etc/rofi.rasi ). It first checks XDG_CONFIG_DIRS , and then SYSCONFDIR (that is passed at compile time). It loads the first config file it finds, it does not merge multiple system configuration files. Rasi theme file: The new theme format can be used to set configuration values. Command-line options: Arguments passed to rofi . To get a template config file, run: rofi -dump-config > config.rasi This will contain (commented) all current configuration options, modified options are uncommented. The configuration system supports the following types: string integer (signed and unsigned) char boolean lists For the syntax of these options, see the rofi-theme(5) manpage. For use on the command line, Boolean options have a non-default command-line syntax. Example to enable option X: -X To disable option X: -no-X Below is a list of the most important options: General -help The help option shows the full list of command-line options and the current set values. These include dynamic (run-time generated) options. -version Show the rofi version and exit. -dump-config Dump the current active configuration, in rasi format, to stdout and exit. Information about the rasi format can be found in the rofi-theme(5) manpage. -dump-theme Dump the current active theme, in rasi format, to stdout and exit. -rasi-validate filename Try to parse the file and return 0 when successful, non-zero when failed. -threads num Specify the number of threads rofi should use: 0: Autodetect the number of supported hardware threads. 1: Disable threading 2..n: Specify the maximum number of threads to use in the thread pool. Default: Autodetect -display display The X server to contact. Default is $DISPLAY . -dmenu Run rofi in dmenu mode. This allows for interactive scripts. In dmenu mode, rofi reads from STDIN, and output to STDOUT. A simple example, displaying three pre-defined options: echo -e \"Option #1\\nOption #2\\nOption #3\" | rofi -dmenu Or get the options from a script: ~/my_script.sh | rofi -dmenu -show mode Open rofi in a certain mode. Available modes are window , run , drun , ssh , combi . The special argument keys can be used to open a searchable list of supported key bindings (see KEY BINDINGS ) To show the run-dialog: rofi -show run If -show is the last option passed to rofi, the first enabled modi is shown. -modi mode1,mode2 Specify an ordered, comma-separated list of modes to enable. Enabled modes can be changed at runtime. Default key is Ctrl+Tab . If no modes are specified, all configured modes will be enabled. To only show the run and ssh launcher: rofi -modi \"run,ssh\" -show run Custom modes can be added using the internal script mode. Each such mode has two parameters: : + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Included Themes

+

Below is a list of themes shipped with rofi. +Use rofi-theme-selector to select and use one of these themes.

+

Default theme

+

default

+

Adapta-Nokto

+

Adapta-Nokto

+

android_notification

+

android_notification

+

Arc-Dark

+

Arc-Dark

+

Arc

+

Arc

+

arthur

+

arthur

+

blue

+

blue

+

c64

+

c64

+

DarkBlue

+

DarkBlue

+

dmenu

+

dmenu

+

docu

+

docu

+

fancy2

+

fancy2

+

fancy

+

fancy

+

fullscreen-preview

+

fullscreen-preview

+

glue_pro_blue

+

glue_pro_blue

+

gruvbox-dark-hard

+

gruvbox-dark-hard

+

gruvbox-dark

+

gruvbox-dark

+

gruvbox-dark-soft

+

gruvbox-dark-soft

+

gruvbox-light-hard

+

gruvbox-light-hard

+

gruvbox-light

+

gruvbox-light

+

gruvbox-light-soft

+

gruvbox-light-soft

+

iggy

+

iggy

+

Indego

+

Indego

+

lb

+

lb

+

material

+

material

+

Monokai

+

Monokai

+

paper-float

+

paper-float

+

Paper

+

Paper

+

purple

+

purple

+

sidebar

+

sidebar

+

sidebar-v2

+

sidebar-v2

+

solarized_alternate

+

solarized_alternate

+

solarized

+

solarized

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file