1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -05:00
rofi/README.md

224 lines
8.8 KiB
Markdown
Raw Normal View History

2015-12-31 15:33:20 -05:00
[![Build Status](https://travis-ci.org/DaveDavenport/rofi.svg?branch=master)](https://travis-ci.org/DaveDavenport/rofi)
[![codecov.io](https://codecov.io/github/DaveDavenport/rofi/coverage.svg?branch=master)](https://codecov.io/github/DaveDavenport/rofi?branch=master)
2016-05-30 15:15:50 -04:00
[![Issues](https://img.shields.io/github/issues/DaveDavenport/rofi.svg)](https://github.com/DaveDavenport/rofi/issues)
[![Forks](https://img.shields.io/github/forks/DaveDavenport/rofi.svg)](https://github.com/DaveDavenport/rofi/network)
[![Stars](https://img.shields.io/github/stars/DaveDavenport/rofi.svg)](https://github.com/DaveDavenport/rofi/stargazers)
2016-05-30 15:24:12 -04:00
[![Downloads](https://img.shields.io/github/downloads/DaveDavenport/rofi/total.svg)](https://github.com/DaveDavenport/rofi/releases)
2015-12-31 15:33:20 -05:00
2015-05-05 05:33:54 -04:00
# A window switcher, run dialog and dmenu replacement
2014-08-28 15:36:53 -04:00
2016-07-04 11:29:58 -04:00
**Rofi** started as clone of simpleswitcher, written by [Sean Pringle](http://github.com/seanpringle/simpleswitcher) a
popup window switcher roughly based on [superswitcher](http://code.google.com/p/superswitcher/).
Simpleswitcher laid the foundations and therefor 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 a run-dialog, 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.
2015-01-20 17:34:53 -05:00
2015-05-04 09:37:54 -04:00
It main features are:
2015-05-26 10:50:41 -04:00
* Full (configurable) keyboard navigation.
2015-05-04 09:37:54 -04:00
* Type to filter
- Tokenized: Type any word in any order to filter.
2016-07-04 11:29:58 -04:00
- (toggable) Case insensitive.
- Supports regex and glob matching.
2015-05-04 09:37:54 -04:00
* UTF-8 enabled.
- UTF-8 aware string collating.
- intl. keyboard support (`e -> è)
* RTL language support.
2016-07-04 11:29:58 -04:00
* Cairo drawing and Pango font rendering.
* Build in modes:
- Window switcher mode.
- EWMH compatible WM.
- Run mode.
- Desktop File Run mode.
- SSH launcher mode.
- Combi mode, allow several modes to be merged into one list.
2015-05-04 09:37:54 -04:00
* History based ordering last 25 choices are ordered on top based on use. (optional)
* Levenshtein distance ordering of matches. (optional)
* Drop in dmenu replacement.
2015-05-26 10:50:41 -04:00
- With many added improvements.
2015-05-04 09:37:54 -04:00
* Can be easily extended using scripts.
2016-07-04 11:29:58 -04:00
* Themeing.
**Rofi** has several buildin modes implementing common use-cases and can be exteneded by scripts (either called from
**Rofi** or calling **Rofi**).
2015-05-04 09:37:54 -04:00
2016-07-04 11:29:58 -04:00
Below the different modes are listed:
2015-05-04 09:37:54 -04:00
## Window Switcher
![Window List](https://davedavenport.github.io/rofi/images/rofi/window-list.png)
2016-07-04 11:29:58 -04:00
The window switcher shows the following informations in columns (can be customized):
2015-05-04 09:37:54 -04:00
2016-07-04 11:29:58 -04:00
1. Desktop number
2015-05-04 09:37:54 -04:00
2. Window class.
3. Window title.
2016-07-04 11:29:58 -04:00
## Run mode
2015-05-04 09:37:54 -04:00
2016-07-04 11:29:58 -04:00
![run mode](https://davedavenport.github.io/rofi/images/rofi/run-dialog.png)
2015-05-04 09:37:54 -04:00
2016-07-04 11:29:58 -04:00
The run mode allows the user to quickly search and launch a program.
2015-05-04 09:37:54 -04:00
It offers the following features:
- Shift-Return to run the selected program in a terminal.
- Favorites list, frequently used programs are sorted on top.
2016-07-04 03:29:43 -04:00
2016-07-04 11:29:58 -04:00
## DRun mode
2016-07-04 03:29:43 -04:00
2016-07-04 11:29:58 -04:00
The desktop run mode allows the user to quickly search and launch an application from the *freedesktop.org* Desktop
2016-07-04 03:29:43 -04:00
Entries. E.g. what is used by Desktop Environment to fill their launcher. It offers the following features:
- Favorites list, frequently used programs are sorted on top.
- Auto starting terminal applications in a terminal.
2015-12-07 02:56:47 -05:00
2015-05-04 09:37:54 -04:00
## SSH launcher
![SSH Launcher](https://davedavenport.github.io/rofi/images/rofi/ssh-dialog.png)
Quickly ssh into remote machines
- Parses ~/.ssh/config to find hosts.
2016-07-04 11:29:58 -04:00
## Script mode
Loads external scripts to add modes to **Rofi**, for example a file-browser.
## COMBI mode
Combine multiple modes in one view. This is especially usefull 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.
2015-05-04 09:37:54 -04:00
## dmenu replacement
![DMENU replacement (running teiler)](https://davedavenport.github.io/rofi/images/rofi/dmenu-replacement.png)
Drop in dmenu replacement. (Screenshot shows rofi used by
[teiler](https://github.com/carnager/teiler) ).
2016-07-04 11:29:58 -04:00
**Rofi** features several improvements over dmenu to improve usability. There is the option to add
2015-05-26 10:50:41 -04:00
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`).
2015-05-04 09:37:54 -04:00
# 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.
2016-07-04 11:29:58 -04:00
For example to show a run dialog:
2015-05-04 09:37:54 -04:00
2016-07-04 11:29:58 -04:00
`rofi -show run`
2015-05-04 09:37:54 -04:00
Show a ssh dialog:
`rofi -show ssh`
## dmenu
If passed the `-dmenu` option, or ran as `dmenu` (ie, /usr/bin/dmenu is symlinked to /usr/bin/rofi),
rofi will use the data passed from STDIN.
```
~/scripts/my_script.sh | rofi -dmenu
echo -e "Option #1\nOption #2\nOption #3" | rofi -dmenu
```
2015-05-04 09:37:54 -04:00
In both cases, rofi will output the user's selection to STDOUT.
## Switching Between Modi
Type `Shift-Right` to switch from Window list mode to Run mode and back.
## Keybindings
| Key | Action |
|:----------------------------|:-------------------------------------------------------------------|
|`Ctrl-v, Insert` | Paste clipboard |
|`Ctrl-Shift-v, Shift-Insert` | Paste primary selection |
|`Ctrl-u` | Clear the line |
|`Ctrl-a` | Beginning of line |
|`Ctrl-e` | End of line |
|`Ctrl-f, Right` | Forward one character |
|`Alt-f` | Forward one word |
|`Ctrl-b, Left` | Back one character |
|`Alt-b` | Back one word |
|`Ctrl-d, Delete` | Delete character |
|`Ctrl-Alt-d` | Delete word |
|`Ctrl-h, 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 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. |
2015-05-04 09:37:54 -04:00
|`Ctrl-space` | Set selected item as input text. |
|`Shift-Del` | Delete entry from history. |
2015-12-07 02:56:47 -05:00
|`grave` | Toggle case sensitivity. |
2015-12-13 05:50:59 -05:00
|`Alt-grave` | Toggle levenshtein sort. |
2015-12-09 02:29:18 -05:00
|`Alt-Shift-S` | Take a screenshot and store this in the Pictures directory. |
2015-05-04 09:37:54 -04:00
2016-07-04 11:29:58 -04:00
For the full list of keybindings see: `rofi -show keys` or `rofi -help`.
2015-05-04 09:37:54 -04:00
# Configuration
There are currently three methods of setting configuration options:
2016-07-04 11:29:58 -04:00
* Local configuration. Normally, depending on XDG, in `~/.local/rofi/config`. This uses the Xresources format.
2015-05-04 09:37:54 -04:00
* Xresources: A method of storing key values in the Xserver. See
[here](https://en.wikipedia.org/wiki/X_resources) for more information.
2016-07-04 11:29:58 -04:00
This is the recommended way of configuring **Rofi**. Remember to load your changes with `xrdb -load ~/.Xresources`
* Commandline options: Arguments passed to **Rofi**.
2015-05-04 09:37:54 -04:00
The Xresources options and the commandline options are aliased. So to set option X you would set:
2016-07-04 11:29:58 -04:00
rofi.X: value
2015-05-04 09:37:54 -04:00
In the Xresources file, and to (override) this via the commandline you would pass the same key
prefixed with a '-':
rofi -X value
To get a list of available options, formatted as Xresources entries run:
rofi -dump-Xresources
2016-07-04 11:29:58 -04:00
or in a more readable format
rofi -help
2015-05-04 09:37:54 -04:00
The configuration system supports the following types:
* String
* Integer (signed and unsigned)
* Char
* Boolean
The boolean option has a non-default commandline syntax, to enable option X you do:
rofi -X
to disable it:
rofi -no-X
# Installation
2016-07-04 11:29:58 -04:00
Please see the [installation guide](https://davedavenport.github.io/rofi/p08-INSTALL.html) for instruction on how to
install **Rofi**.