Giter Site home page Giter Site logo

davatorium / rofi Goto Github PK

View Code? Open in Web Editor NEW
12.9K 94.0 608.0 29.72 MB

Rofi: A window switcher, application launcher and dmenu replacement

Home Page: https://davatorium.github.io/rofi/

License: Other

Shell 0.62% C 89.34% Makefile 1.47% M4 1.53% Lex 2.67% Yacc 3.09% Meson 1.30%
rofi dmenu dmenu-replacement application-launcher window-switcher c i3 x11 linux

rofi's Introduction

Please match the documentation and scripts to the version of rofi used

Also see the locally installed documentation (manpages).

Rofi

A window switcher, Application launcher and dmenu replacement.

vid-2021-10-29-165650.mp4

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.

What is rofi not?

Rofi is not:

  • 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 or plugins, many exists.
  • Just a dmenu replacement. The dmenu functionality is a nice 'extra' to rofi, not its main purpose.

Table of Contents

Features

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-, prefix-, 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
      • Work arounds for i3,bspwm
    • Application launcher

    • Desktop file application launcher

    • SSH launcher mode

    • File browser

    • 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 or fzf like sorting of matches (optional)

  • Drop-in dmenu replacement

    • Many added improvements
  • Easily extensible using scripts and plugins

  • Advanced Theming

Modes

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

Below is a list of the different modes:

  • run: launch applications from $PATH, with option to launch in terminal.

  • drun: launch applications based on desktop files. It tries to be compliant to the XDG standard.

  • window: Switch between windows on an EWMH compatible window manager.

  • ssh: Connect to a remote host via ssh.

  • filebrowser: A basic file-browser for opening files.

  • keys: list internal keybindings.

  • script: Write (limited) custom mode using simple scripts.

  • combi: Combine multiple modes into one.

Rofi is known to work on Linux and BSD.

Manpage

For more up to date information, please see the manpages. The other sections and links might have outdated information as they have relatively less maintainance than the manpages. So, if you come across any issues please consult manpages, discussion and issue tracker before filing new issue.

Installation

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

Quickstart

Usage

This section just gives a brief overview of the various options. To get the full set of options see the manpages section above

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

Or get the options from a script:

    ~/my_script.sh | rofi -dmenu

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

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

Configuration

Generate a default configuration file

mkdir -p ~/.config/rofi
rofi -dump-config > ~/.config/rofi/config.rasi

This creates a file called config.rasi in the ~/.config/rofi/ folder. You can modify this file to set configuration settings and modify themes. config.rasi is the file rofi looks to by default.

Please see the configuration guide for a summary of configuration options. More detailed options are provided in the manpages.

Themes

Please see the themes manpages for a detailed description.

The latest bundled themes can be found here.

Screenshots

Rezlooks:

screenshot

Arthur:

screenshot2

Default theme:

default

Wiki

❗ **The Wiki is currently unmaintained and might contain outdated data **

Go to wiki .

Contents

Discussion places

The GitHub Discussions is the preferred location for discussions.

Stargazers over time

Stargazers over time

rofi's People

Contributors

a1346054 avatar amosbird avatar ashyisme avatar blueyed avatar carnager avatar dannycolin avatar davedavenport avatar fdmarcin avatar gbitzes avatar ianremmler avatar jasperla avatar jirutka avatar johnbeard avatar jpleau avatar jubalh avatar larkery avatar lbonn avatar martijnktue avatar nick87720z avatar nomoo avatar refacto avatar sardemff7 avatar seanpringle avatar seletskiy avatar shade-of-noon avatar t-wissmann avatar tblue avatar toncherami avatar ve5li avatar vimeitor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rofi's Issues

auto select and switch when unique match

Hya

i think it would be cool and create a faster workflow if when there was only one completion option (IE a unique match) the app would auto switch without pressing enter.
IE if i have only 1 firefox window press f-TAB will auto switch to FF without the need for enter

Segfault when simpleswitcher exits.

I get a segfault every time simpleswitcher exits running simpleswitcher -rnow with the following backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff715468b in malloc_consolidate () from /usr/lib/libc.so.6
#0  0x00007ffff715468b in malloc_consolidate () from /usr/lib/libc.so.6
#1  0x00007ffff71551d1 in _int_free () from /usr/lib/libc.so.6
#2  0x00007ffff7ad336b in _XFreeDisplayStructure () from /usr/lib/libX11.so.6
#3  0x00007ffff7ac1a2f in XCloseDisplay () from /usr/lib/libX11.so.6
#4  0x0000000000407427 in main (argc=2, argv=0x7fffffffe888)
    at source/simpleswitcher.c:1533

Removing XCloseIM from textbox_free seems to fix the issue.
I'm not familiar with Xlib-programming but according to the manual XCloseDisplay will free all resources associated to the display.

marking/"tagging" windows for quick switch

I have this idea to make switching faster by a bit (every ms counts :))

suppose we could mark/tag windows based on title/role/class etc..

then in the switcher part we could just switch to tagged windows by going Ss>Tag

IE i would have FF, chrome, gmpc, terminal X4, ssh etc open
and would tag FF as 'f'' and ssh as 's'

then just SS>f or SS >f TAB and voilla your in Firefox

thx!

Z

Add pgup/pgdown support

Now that simpleswitcher supports scrolling, pgup/pgdown support seem to be a logical thing to add. :)

floating point exception

On git head as of posting this regardless of the options/mode i'm in when I start rofi the results are always blank, soon as I hit any key it exits with the following error.

zsh: floating point exception  rofi -rnow

`autoreconf --install` fails

$ autoreconf --install
configure.ac:15: installing './compile'
configure.ac:9: installing './install-sh'
configure.ac:9: installing './missing'
automake: warnings are treated as errors
Makefile.am:57: warning: '%'-style pattern rules are a GNU make extension
Makefile.am: installing './depcomp'
autoreconf: automake failed with exit status: 1

It looks like automake doesn't like the '%'-style pattern rules in Makefile.am:57:

%.html: %.md
    $(md_verbose) markdown $< > $@

Mark mode does not appear to work

I have tried simpleswitcher -mnow, which does nothing (no popup).

I have also noticed that simpleswitcher -foobar does the same (nothing), it binds the default shortcuts.
Alt-F5 / Mod1-F5 (the default for mark mode) is not bound.

make and make install state that I3 mode is enabled.

possible delimiter setting

rofi has some pretext before each of it's command modes.

run
ssh

I would rather see

run:
ssh:

:

Could we have a option to where adding some text like a : to the end be configurable, or just add the colon in?

Also maybe change > to window:

terminal window title for ssh

If you are using rofi for connect to SSH host in window title only word SSH. Is it possible to add the host name in the window title?

horizontal mode

Provide a option to run in a horizontal mode, where it behaves more like dmenu. This would also require a -top and -bottom option that would either place it at the top or bottom of your screen.

Disable auto completion (history)

When I want to use rofi to control the volume via mpc, if mpc volume 100 is in my history, I have to delete that entry in order to run mpc volume 10. It would be convenient with an option to disable history auto completion. (implying no dropdown list with historical entries, and input interpreted exactly as is)

add support for bangs

Hya

would like to request support for bangs, that is symbols that would launch menus/modes. for example @ in SS launcher mode would open teiler (the ss version)

also in example one could use a Internet bang to search in FF/chrome via surfraw. for example SS>@>g gmpc would launch a google search for gmpc

thx alot

Z

Make config.c less troublesome

config/config.c is changed on git updates. It would be nice to rename it config.def.c and allow users to put there location changes in config.c. config.c should not be tracked by git (add to .gitiignore) so it will never accidentally be changed by a git pull.

Advertise the website

The website is currently hard to remember.

  1. Add a link on sarine.nl
  2. Edit the description of this repository, add the url to the site. Theres a special spot github uses for website urls.

Sort by revelance regardless of history

I disabled history, but that also made irrelevant hits list first. For example, when writing panel, rofi would list ControlPanel first. It would be nice if you could first show the hits that start with the letters the user has written, before sorting alphabetically. So that in this case panel would go before ControlPanel.

Another way I can think of which could solve my problem: when -disable-history, you could still sort by relevance. Sort of like letting history work behind the scenes, but not showing the history in the list.

ssh run command doesn't pass -e

The can configure my terminal to st and it works fine for the normal run dialog, but it looks like it breaks ssh mode. SSH mode doesn't pass -e to the terminal emulator like the code in run dialog.

alternative for tab key

It would be nice if I could use ctrl-j and ctrl-k to move up and down the list of matches instead of tab.

Use only `Alt+Tab` (without pressing Enter), like in kde

It would be nice to use only Alt+Tab (without pressing Enter) to change the focus.

The proposed method would change the focus when Alt is not longer pressed. Once the menu is displayed, Alt+Tab can be used to go to the item in the menu (observe that actually only Tab is pressed again since Alt is continuously pressed). And Alt+Shift+Tab for the previous item. In order to cancel, ESC can be used (while pressing Alt). This is the default behavior in kde, for example.

I believe it is faster and uses less hand movements.

be consistent with names over number values

Xresources uses number values for configuration options like rofi.hmode and rofi.location. config.c uses words which are easier to remember. Either document the numbers or make it more consistent.

Allow JSON input via stdin

right now simpleswitcher expects a file for JSON input which makes dynamic scripts impossible. Allowing input via stdin/as an argument would solve this.

rename hmode

The name hmode doesn't make a not of sense unless it was a boolean value. I think wmode made more sense.

You could also change hmode to be true for horizontal mode and false for vertical.

provide a config.h file

Provide a config.h like dmenu has for configuring default options, before the compile phase. Example below of the one that comes with dmenu. I think it's only included in their git repository right now.

/* See LICENSE file for copyright and license details. */
/* vim: expandtab
 */
/* Default settings; can be overrided by command line. */

static Bool topbar = True;                  /* -b  option; if False, dmenu appears at bottom */
static const char *font = NULL;             /* -fn option; default X11 font or font set      */
static const char *prompt = NULL;           /* -p  option; prompt to the elft of input field */
static const char *normbgcolor = "#222222"; /* -nb option; normal background                 */
static const char *normfgcolor = "#bbbbbb"; /* -nf option; normal foreground                 */
static const char *selbgcolor  = "#005577"; /* -sb option; selected background               */
static const char *selfgcolor  = "#eeeeee"; /* -sf option; selected foreground               */
static const char *outbgcolor  = "#00ffff";
static const char *outfgcolor  = "#000000";
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
static unsigned int lines = 0;

custom menus

It would be great if like in dmenu the user could create custom menus. I think a json blob would work great for this.

An example may be

{"prompt": "", "commands": { "play": "mpc play", "stop": "mpc stop", "start", "mpc start"}}

Then assuming we named it mpc.json we could run it like so. simpleswitcher -rnow -menu /path/to/mpc.json

Does not switch to desktop in awesome

I have tried using simpleswitcher on awesome, but it does not change to the target desktop (if it's different from the current one). This works with the original version.

I have seen that there's some special/different code in the original simpleswitcher (https://github.com/seanpringle/simpleswitcher) for this:
https://github.com/seanpringle/simpleswitcher/blob/master/simpleswitcher.c#L909

The original version also has the desktop/workspace/tag in front of the list entries, which I consider to be useful.

What is the state of your fork?
Have you considered to join forces with @seanpringle?

configurable prompt

Provide a option -prompt and allow the user to change the default prompt $ to whatever they want. I was using this in dmenu previously.

i3 crash when selecting `i3bar`

SS makes i3 crash when selecting i3bar for output LVDS1 (or whatever your screen is).

I'm guessing this entry is the switcher itself, and the fix would be to filter it out of the list, but I don't have time to try and take care of it.

match on all Xprop fields (role etc)

Would be cool is simple switcher could also have a smart matching to also include all other windows properties (vix Xprop). so for example running a urxvt term with a role of (ssh) would accept both urxvt and ssh to switch to it

thx!

Z

.menu_bg not being used from config

Was trying to tweak my colors a bit tonight and noticed adjusting .menu_bg in config/config.c doesn't do anything. If I run rofi -bg "#333333" -rnow it works fine that way. Far as I can tell this only happens with .menu_bg.

ssh terminal support

With the syntax that used to launch the terminal with ssh; you can't use many terminal emulators. If you use xfce4-terminal or terminator, for example; the terminal doesn't pop up.

I looked a bit into the source and I think it has something to do with:

return execlp ( config.terminal_emulator, config.terminal_emulator, "-e", "ssh", host, NULL );

Shouldn't the host be in the same argument as the "ssh"?
I would compile it myself to try it, but I can't right now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.