1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-03 04:23:42 -05:00
Rofi: A window switcher, application launcher and dmenu replacement
Find a file
Jeff 83c2e467d5
Add support for additional field on script entries meta (#1052)
* Add test for hidden meta data in script mode

The purpose of this is to provide support for "hidden" fields on a
script item that work for search but don't get displayed.  This is
mostly to provide something similar to the optional display (but still
matchable) fields in drun like "categories" or "keywords".  This also
enables the choice to display unicode icons but still allow for
searching for the keywords without needing to print them.

* Ignore the output file from test runs

* Add support for the "meta" field on script entries

This fields provides a matchable but unprinted string for entries in a
script mode list match.  This means you can use one thing but provide
multiple options that can match that item without polluting the list
view or make confusing output.

* Add new test to test suite file
2020-02-01 13:49:11 +01:00
.github Add Issue and PR Templates (#1043) 2019-12-14 14:03:09 +01:00
config [DRun] Add desktop cache 2020-01-26 12:47:04 +01:00
data Add png version of logo. 2016-10-31 21:40:46 +01:00
doc Update manpage with drun-cache. 2020-01-26 15:48:17 +01:00
Examples [Scripts] Do some fixes. 2019-02-02 12:35:37 +01:00
include Add support for additional field on script entries meta (#1052) 2020-02-01 13:49:11 +01:00
lexer Issue893: Add support for @media in the theme format. (#1015) 2019-09-20 15:05:36 +02:00
m4 Add lex version check. 2017-04-04 18:59:35 +02:00
pkgconfig Make -plugin-path commandline flag be read before loading plugins 2017-10-16 18:25:16 +02:00
releasenotes Fix typo in unit separator character. 2019-06-16 19:40:06 +02:00
resources First testing to use GResource to load default theme. 2017-10-31 18:00:24 +01:00
script [Script] terminal 2019-04-20 18:54:28 +02:00
source Add support for additional field on script entries meta (#1052) 2020-02-01 13:49:11 +01:00
subprojects Changelog: Small update. 2019-05-14 11:26:08 +02:00
test Add support for additional field on script entries meta (#1052) 2020-02-01 13:49:11 +01:00
themes [Themes] Add 'fancy' theme. 2019-05-14 11:35:30 +02:00
.gitignore Add support for additional field on script entries meta (#1052) 2020-02-01 13:49:11 +01:00
.gitlab-ci.yml Add texinfo. 2017-09-24 20:47:44 +02:00
.gitmodules changed ligbwater's url from git to https 2017-12-04 19:51:15 +01:00
.travis.yml travis: Download Meson ourselves 2018-07-10 18:49:54 +02:00
AUTHORS Update authors list. 2017-09-26 17:08:42 +02:00
Changelog Setup dev. version. 2019-06-26 21:34:39 +02:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md (#608) 2017-06-17 13:20:34 +02:00
configure.ac Remove deprecated option from configure. 2019-10-29 13:33:04 +01:00
COPYING Update copyright dates. 2020-01-01 12:23:12 +01:00
INSTALL.md INSTALL: Add missing Meson instructions 2019-05-10 20:06:46 +02:00
libgwater-xcb-nolibtool.mk gitmodules: Move to subprojects/ 2017-05-04 21:50:07 +02:00
Makefile.am [Themes] Add 'fancy' theme. 2019-05-14 11:35:30 +02:00
meson.build Setup dev. version. 2019-06-26 21:34:39 +02:00
meson_options.txt [Timings] Move into new debug system. (#961) 2019-05-11 20:57:18 +02:00
README.md Fix more links from DaveDavenport -> davatorium 2019-05-14 11:52:21 +02:00

Codacy Badge Build Status codecov.io Issues Forks Stars Downloads Coverity Forum

A window switcher, Application launcher and dmenu replacement

Rofi started as a clone of simpleswitcher, written by Sean Pringle - a popup window switcher roughly based on superswitcher. Simpleswitcher laid the foundations, and therefore Sean Pringle deserves most of the credit for this tool. Rofi (renamed, as it lost the simple property) has been extended with extra features, like an application launcher and ssh-launcher, and can act as a drop-in dmenu replacement, making it a very versatile tool.

Rofi, like dmenu, will provide the user with a textual list of options where one or more can be selected. This can either be running an application, selecting a window, or options provided by an external script.

Its main features are:

  • Fully configurable keyboard navigation
  • Type to filter
    • Tokenized: type any word in any order to filter
    • Case insensitive (togglable)
    • Support for fuzzy-, regex-, and glob matching
  • UTF-8 enabled
    • UTF-8-aware string collating
    • International keyboard support (`e -> è)
  • RTL language support
  • Cairo drawing and Pango font rendering
  • Built-in modes:
    • Window switcher mode
      • EWMH compatible WM
    • Application launcher
    • Desktop file application launcher
    • SSH launcher mode
    • Combi mode, allowing several modes to be merged into one list
  • History-based ordering — last 25 choices are ordered on top based on use (optional)
  • Levenshtein distance ordering of matches (optional)
  • Drop-in dmenu replacement
    • Many added improvements
  • Easily extensible using scripts
  • Theming

Rofi has several built-in modes implementing common use cases and can be extended by scripts (either called from Rofi or calling Rofi).

Below is a list of the different modes:

Window Switcher

Window List

The window switcher shows the following informations in columns (can be customized):

  1. Desktop name
  2. Window class
  3. Window title

Window mode features:

  • Closing applications with Shift-Delete
  • Custom command with Shift-Return

Application launcher

run mode

The run mode allows users to quickly search for and launch a program.

Run mode features:

  • Shift-Return to run the selected program in a terminal
  • Favorites list, with frequently used programs sorted on top
  • Custom entries, like aliases, added by executing a command

Desktop File Application launcher

The desktop run mode allows users to quickly search and launch an application from the freedesktop.org Desktop Entries. These are used by most Desktop Environments to populate launchers and menus. Drun mode features:

  • Favorites list, with frequently used programs sorted on top
  • Auto starting terminal applications in a terminal

SSH launcher

SSH Launcher

Quickly ssh into remote machines. Parses ~/.ssh/config to find hosts.

Script mode

Loads external scripts to add modes to Rofi, for example a file-browser.

rofi  -show fb -modi fb:../Examples/rofi-file-browser.sh

COMBI mode

Combine multiple modes in one view. This is especially useful when merging the window and run mode into one view. Allowing to quickly switch to an application, either by switching to it when it is already running or starting it.

Example to combine Desktop run and the window switcher:

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

dmenu replacement

DMENU replacement (running teiler)

Drop in dmenu replacement. (Screenshot shows rofi used by teiler ).

Rofi features several improvements over dmenu to improve usability. There is the option to add an extra message bar (-mesg), pre-entering of text (-filter), or selecting entries based on a pattern (-select). Also highlighting (-u and -a) options and modi to force user to select one provided option (-only-match). In addition to this, rofi's dmenu mode can select multiple lines and write them to stdout.

Usage

If used with -show [mode], rofi will immediately open in the specified [mode].

If used with -dmenu, rofi will use data from STDIN to let the user select an option.

For example, to show a run dialog:

rofi -show run

To show a ssh dialog:

rofi -show ssh

dmenu

If rofi is passed the -dmenu option, or run as dmenu (ie, /usr/bin/dmenu is symlinked to /usr/bin/rofi), it will use the data passed from STDIN.

~/scripts/my_script.sh | rofi -dmenu
echo -e "Option #1\nOption #2\nOption #3" | rofi -dmenu

In both cases, rofi will output the user's selection to STDOUT.

Switching Between Modi

Type Shift-/Left/Right to switch between active modi.

Key bindings

Key Action
Ctrl-v, Insert Paste from clipboard
Ctrl-Shift-v, Shift-Insert Paste primary selection
Ctrl-w Clear the line
Ctrl-u Delete till the start of line
Ctrl-a Move to beginning of line
Ctrl-e Move to end of line
Ctrl-f, Right Move forward one character
Alt-f, Ctrl-Right Move forward one word
Ctrl-b, Left Move back one character
Alt-b, Ctrl-Left Move back one word
Ctrl-d, Delete Delete character
Ctrl-Alt-d Delete word
Ctrl-h, Backspace, Shift-Backspace Backspace (delete previous character)
Ctrl-Alt-h Delete previous word
Ctrl-j,Ctrl-m,Enter Accept entry
Ctrl-n,Down Select next entry
Ctrl-p,Up Select previous entry
Page Up Go to the previous page
Page Down Go to the next page
Ctrl-Page Up Go to the previous column
Ctrl-Page Down Go to the next column
Ctrl-Enter Use entered text as a command (in ssh/run modi)
Shift-Enter Launch the application in a 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 modi. The list can be customized with the -modi option.
Shift-Left Switch to the previous modi. The list can be customized with the -modi option.
Ctrl-Tab Switch to the next modi. The list can be customized with the -modi option.
Ctrl-Shift-Tab Switch to the previous modi. The list can be customized with the -modi option.
Ctrl-space Set selected item as input text.
Shift-Del Delete entry from history.
grave Toggle case sensitivity.
Alt-grave Toggle levenshtein sort.
Alt-Shift-S Take a screenshot and store it in the Pictures directory.

For the full list of key bindings, see: rofi -show keys or rofi -help.

Configuration

There are currently three methods of setting configuration options:

  • Local configuration. Normally, depending on XDG, in ~/.config/rofi/config. This uses the Xresources format.
  • Xresources: A method of storing key values in the Xserver. See here for more information.
  • Command line options: Arguments are passed to Rofi.

A distribution can ship defaults in /etc/rofi.conf.

The Xresources options and the command line options are aliased. To define option X set:

`rofi.X: value`

In the Xresources file. To set/override this from command line pass the same key prefixed with '-':

`rofi -X value`

To get a list of available options formatted as Xresources entries, run:

`rofi -dump-Xresources`

or in a more readable format:

`rofi -help`

The configuration system supports the following types:

  • String
  • Integer (signed and unsigned)
  • Char
  • Boolean

The Boolean option has a non-default command line syntax, to enable option X you do:

`rofi -X`

to disable it:

`rofi -no-X`

Manpage

For more detailed information, please see the manpage, the wiki, or the forum.

Installation

Please see the installation guide for instructions on how to install Rofi.

What is rofi not?

Rofi is not:

  • A preview application. In other words, it will not show a (small) preview of images, movies or other files.
  • A UI toolkit.
  • A library to be used in other applications.
  • An application that can support every possible use-case. It tries to be generic enough to be usable by everybody. Specific functionality can be added using scripts.
  • Just a dmenu replacement. The dmenu functionality is a nice 'extra' to rofi, not its main purpose.