pax_global_header00006660000000000000000000000064126176145300014517gustar00rootroot0000000000000052 comment=6f023e8c9e547da3df5fac19874fc19dd9777a59 rofi-0.15.11/000077500000000000000000000000001261761453000126235ustar00rootroot00000000000000rofi-0.15.11/.gitignore000066400000000000000000000005321261761453000146130ustar00rootroot00000000000000*.swp *.*~ build/ missing install-sh configure config.h.in Makefile.in aclocal.m4 autom4te.cache/ compile depcomp *.o *.gcov *.gcda *.gcno # I want to ignore log files *.log # Core files should never be checked in core # ignore patches too, the code is either checked in or branch. *.patch* doc/*.html doc/*.1 *.unc-backup~ *.unc-backup.md5~ rofi-0.15.11/.travis.yml000066400000000000000000000010421261761453000147310ustar00rootroot00000000000000sudo: false language: c addons: apt: packages: - libxinerama-dev - autoconf - automake - make - libxft-dev - libx11-dev - libpango1.0-dev - libcairo2-dev - libstartup-notification0-dev - xvfb - xdotool - discount compiler: - gcc before_install: - autoreconf -i script: - ./configure --enable-gcov - make - make test # to re-enable if xdotool is allowed. - make test-x - make distcheck rofi-0.15.11/AUTHORS000066400000000000000000000006011261761453000136700ustar00rootroot00000000000000Benjamin Cremer Bruno Braga Buglloc Daniel Hahler Dave Davenport Deiwin Sarjas Edwin Pujols Eric Engeström Gabriel Holodak Georgios Bitzes Greg Fitzgerald Guy Hughes Hexchain Tong Jason Pleau Klemens Schölhorn Michael Vetter N. Izumi Peter Cannici Rasmus Steinke Roomcays Simon Hanna Thomas Adam Thorsten Wißmann Tilman Blumenbach Tom Hinton daemoni koppa qedi seanpringle vimeitor rofi-0.15.11/COPYING000066400000000000000000000021751261761453000136630ustar00rootroot00000000000000MIT/X11 License Modified 2013-2015 Qball Cow Copyright (c) 2012 Sean Pringle 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. rofi-0.15.11/Changelog000066400000000000000000000126321261761453000144410ustar00rootroot000000000000000.15.11: New features: - (Experimental) Desktop file support Improvement: - Add xdg-terminal to rofi-sensible-terminal Bug fixes: - manpage fixes (#261) - Crash in error mesg on invalid config - Fix urgent and active being activated at same time - Fix crasher on empty list 0.15.10: New feature: - Support for Startup Notification - Standalone mode in dmenu - ssh: known_hosts parsing - Full screen support - Glob style matching - Cairo drawing - Fast ascii filtering (thx to Tom Hinton) - Combi bang support - normal window mode for dmenu - Startup notification support - Current desktop window mode Improvements: - Keep same line selected - Cleanup menu code by re-using Switcher - Fix drawing on resize - Fix rofi -h output - allow disabling of tokenizing - Dragging scrollbar - Allow none type on separator - Dmenu support markup in fields Bug fixes: - dmenu use switcher system - release keyboard on focus out event, regrab it on focus in event - Support `\0` separator 0.15.8: New feature: - Scrollbar. - More custom keybindings. Improvements: - dmenu compatibility. - Don't refilter on all keypresses. - Hide Docks and desktops from the window list. (remove i3bar hack) Bug fixes: - Fix Desktop numbering. - Mis-alignment of arrow down box with message (#189) - Fix issue with mouse interaction needing keyboard press to complete. - Fix -no-custom still allows escape to quit. - Fix compiler warnings. - Fix dmenu mode. (#200) - Break CMD AI to have dmenu compatibility. - Fix processing of signals. 0.15.7: Bug fixes: - Auto-wrap text in message dialog. - Fix ellipsiziing in entry box. - Fix crash on empty list with custom input (#175). - SSH: Ignore comments in Host line (#178). - Fix issues with BSD (#180) New feature: - Markup support error message. - Implement -no-custom as alternative to -only-select (#176). - Fuzzy match option. (#133) Improvements: - Make more keys user-configurable. (#66) 0.15.5: Bug fixes: - Reduce time waiting for keyboard grab (#153) - Also grab Key Release on exit. (#167) - Fix failing font size estimation code. New feature: - [DMENU] Allow to select line matching pattern from cmdline.(#165) - [DMENU] Allow to set filter from cmdline. (#164) - [DMENU] Allow output to be formatted (string, filter, index, index 1 based) - [DMENU] Only match input lines mode. - [DMENU] Custom keybinding for return value.(#154,#156) - [DMENU] Allow additional message line. (#166) Improvements: - (Start) adding keybinding support (#131) - Cleanup warnings from clang checkers. - Fix keybindings on Russian layout (#169) Open bugs: - Urgency hint not always working (#162) 0.15.4: New feature: - Number mode for dmenu. allows user to get index back instead of content. - Combi mode. Combine multiple views into one. - Highlight current window. - Highlight urgent and active row in window view. - DMenu allow rows to be highlighted. (single, multiple, ranges) - New color specification based on I3. (Can be enabled by settings) (#147) - /etc/hosts support for ssh mode. (#137) Bug fixes: - On a single item in list disable auto-select. - Fix cursor position (#140) - Resolving manpage. (#142) - Fix pasting cursor one off. (#150) - Fix grave key -> ctrl+grave (#151) Improvements: - Better handle input methods.. Now international keyboard layout works as expected: `e ->è - Be more verbose about starting in daemon mode. - Print a user-understandable error when launching in daemon mode without a key bound. - Add Ctrl(Shift)Tab to switch modi's. - Auto size number of columns based on available columns. - Better way to determine font height. - Fix font vertical centering. - One-off when pasting text. - Improve rendering of boxes (fixed height and margins) - Fix modi switcher boxes size+layout. - Reduce work on redraws (do not always calculate new size/position), set text, etc. - OO-ify the switchers. - Remove unneeded filtered array. Cleanup: - Do not lug argc,argv around everywhere. 0.15.2: Removed features: - Remove (broken) hmode - Old style key binding and mode launcher. - Old TIMING code. New features: - Word movement in entry box. (#126) - PID file to avoid duplicate Rofi. - Generic keybinding and launching for modi. (#128) - Auto select mode (previously called zeltak mode) Bug fixes: - Shift left/right movement between modi (#125) - Document updates (#123,#116,#124,etc.) - DMenu mode based on executable name with full path (#119) - Fix missing keystrokes. - On broken UTF-8 show everything up to the broken character. (#121) Others: - Significant code refactoring. - Rewriting of config parser, Commandline Parser uses structure from Xresource parser. Avoiding duplication and making it easier to maintain. Performance improvements: - Fix blocking on grabbing keyboard. 0.15.1: New features: - Improved transparency - Changelog - Case sensitivity support, with indicator. (Edwin Pujols) - Mouse scroll wheel support - Alternate Row colors - Run-list command for adding entries to run-dialog - Dmenu: preselect line. Bug fixes: - Manpage fixes - SSH viewer, support lists of hostnames (Tblue) - SSH improve parsing of odly indented host files - Do not loose keypresses when system under load - Cleanups, small fixes. (Edwin Pujols, blueyed ) Performance improvements: - Lazy refilter for large lists rofi-0.15.11/Examples/000077500000000000000000000000001261761453000144015ustar00rootroot00000000000000rofi-0.15.11/Examples/i3_switch_workspaces.sh000077500000000000000000000006201261761453000210730ustar00rootroot00000000000000#!/bin/bash if [ -z $@ ] then function gen_workspaces() { i3-msg -t get_workspaces | tr ',' '\n' | grep "name" | sed 's/"name":"\(.*\)"/\1/g' | sort -n } echo empty; gen_workspaces else WORKSPACE=$@ if [ x"empty" = x"${WORKSPACE}" ] then i3_empty_workspace.sh >/dev/null elif [ -n "${WORKSPACE}" ] then i3-msg workspace "${WORKSPACE}" >/dev/null fi fi rofi-0.15.11/Examples/rofi-file-browser.sh000077500000000000000000000014231261761453000202750ustar00rootroot00000000000000#!/usr/bin/env bash EDITOR=xdg-open CUR_DIR=$PWD PREV_LOC_FILE=~/.rofi_fb_prevloc # Read last location, otherwise we default to PWD. if [ -f "${PREV_LOC_FILE}" ] then CUR_DIR=$(cat "${PREV_LOC_FILE}") fi # Handle argument. if [ -n "$@" ] then CUR_DIR="${CUR_DIR}/$@" fi # If argument is no directory. if [ ! -d "${CUR_DIR}" ] then if [ -x "${CUR_DIR}" ] then coproc ( "${CUR_DIR}" & > /dev/null 2>&1 ) exec 1>&- exit; elif [ -f "${CUR_DIR}" ] then coproc ( ${EDITOR} "${CUR_DIR}" & > /dev/null 2>&1 ) exit; fi exit; fi # process current dir. if [ -n "${CUR_DIR}" ] then CUR_DIR=$(readlink -e "${CUR_DIR}") echo "${CUR_DIR}" > "${PREV_LOC_FILE}" pushd "${CUR_DIR}" >/dev/null fi echo ".." ls rofi-0.15.11/INSTALL.md000066400000000000000000000050401261761453000142520ustar00rootroot00000000000000# Installation guide ## DEPENDENCY ### For building: * C compiler that supports the c99 standard. (gcc or clang) * make * autoconf * automake (1.11.3 or up) * pkg-config * Developer packages of the external libraries ### External libraries * libxinerama * libpango * libpangocairo * libcairo * libcairo-xlib * libglib2.0 * libx11 * libstartup-notification-1.0 On debian based systems, the developer packages are in the form of: `-dev` on rpm based '-devel'. ### Optional: * For i3 support, you need at least i3 version 4.5 or up. Make sure that 'i3/ipc.h' is included. If it fails please check config.log. ## Install from a release Check dependencies and configure build system: ``` ./configure ``` Build Rofi: ``` make ``` The actual install, execute as root (if needed): ``` make install ``` ## Install a checkout from git Generate build system: ``` autoreconf -i ``` Create a build directory: ``` mkdir build ``` Enter build directory: ``` cd build ``` Check dependencies and configure build system: ``` ../configure ``` Build rofi: ``` make ``` The actual install, execute as root (if needed): ``` make install ``` ## Options for configure When you run the configure step there are several you can configure. (To see the full list type `./configure --help` ). The most useful one to set the installation prefix: ``` ./configure --prefix= ``` f.e. ``` ./configure --prefix=/usr/ ``` ### Install locally or to install locally: ``` ./configure --prefix=${HOME}/.local/ ``` ### I3 workaround If i3 is installed in a non-standard prefix, point it to the right location using: ``` CFLAGS="-I/weird/i3/path/include/" ../configure CFLAGS="-I/weird/i3/path/include/" make ``` ## Options for make When you run make you can tweak the build process a little. ### Verbose output Show the commands called: ``` make V=1 ``` ### Debug build Compile with debug symbols and no optimization ``` make CFLAGS="-O0 -g3" clean rofi ``` ### 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. ``` gdb rofi core ``` ## Install distribution ### Debian or Ubuntu ``` apt-get install rofi ``` ### Fedora rofi from [russianfedora repository](http://ru.fedoracommunity.org/repository) and also Copr (Cool Other Package Repo) https://copr.fedoraproject.org/coprs/region51/rofi/ rofi-0.15.11/Makefile.am000066400000000000000000000102601261761453000146560ustar00rootroot00000000000000# Specify automake version. AUTOMAKE_OPTIONS = 1.11.3 ## # Rofi the program ## bin_PROGRAMS=rofi dist_bin_SCRIPTS=script/rofi-sensible-terminal LIBS=\ @x11_LIBS@\ @xinerama_LIBS@\ @libsn_LIBS@\ @pango_LIBS@\ @cairo_LIBS@ AM_CFLAGS=\ @EXTRA_CFLAGS@\ @x11_CFLAGS@\ @xinerama_CFLAGS@\ @pango_CFLAGS@\ @libsn_CFLAGS@\ @cairo_CFLAGS@\ -DMANPAGE_PATH="\"$(mandir)/\""\ -I$(top_srcdir)/include/\ -I$(top_srcdir)/config/\ -I$(top_builddir)/\ -Werror=missing-prototypes rofi_SOURCES=\ source/rofi.c\ source/keyb.c\ config/config.c\ source/helper.c\ source/textbox.c\ source/history.c\ source/scrollbar.c\ source/i3-support.c\ source/xrmoptions.c\ source/x11-helper.c\ source/dialogs/run.c\ source/dialogs/ssh.c\ source/dialogs/drun.c\ source/dialogs/dmenu.c\ source/dialogs/combi.c\ source/dialogs/window.c\ source/dialogs/script.c\ include/rofi.h\ include/keyb.h\ include/helper.h\ include/history.h\ include/textbox.h\ include/scrollbar.h\ include/xrmoptions.h\ include/i3-support.h\ include/x11-helper.h\ include/dialogs/ssh.h\ include/dialogs/run.h\ include/dialogs/drun.h\ include/dialogs/dmenu.h\ include/dialogs/combi.h\ include/dialogs/script.h\ include/dialogs/window.h\ include/dialogs/dialogs.h ## # Manpage ## man1_MANS=\ doc/rofi.1\ doc/rofi-sensible-terminal.1 ## # Readme.md ## markdown_SC_FILES=\ README.md # want the html to show up in release. md_verbose = $(md_verbose_@AM_V@) md_verbose_ = $(md_verbose_@AM_DEFAULT_V@) md_verbose_0 = @echo " MD" $@; markdown_FILES=\ README.html README.html: README.md $(md_verbose) markdown $< > $@ ## # config directory ## ${top_builddir}/config/config.c: ${top_srcdir}/config/config.def.c cp ${top_srcdir}/config/config.def.c $@ ## # Extra DIST ## EXTRA_DIST=\ $(man1_MANS)\ $(markdown_FILES)\ $(markdown_SC_FILES)\ Examples/i3_switch_workspaces.sh\ ${top_srcdir}/config/config.def.c\ INSTALL.md\ AUTHORS\ Changelog ## # Indent ## update-manpage: ${top_srcdir}/doc/rofi-manpage.markdown ronn --roff --pipe $^ > ${top_srcdir}/doc/rofi.1 ## # Rofi test program ## noinst_PROGRAMS=rofi_test textbox_test helper_test rofi_test_SOURCES=\ source/history.c\ config/config.c\ include/rofi.h\ include/history.h\ test/history-test.c textbox_test_SOURCES=\ source/textbox.c\ config/config.c\ source/keyb.c\ source/x11-helper.c\ source/xrmoptions.c\ source/helper.c\ include/keyb.h\ include/rofi.h\ include/textbox.h\ include/x11-helper.h\ include/xrmoptions.h\ include/helper.h\ test/textbox-test.c helper_test_SOURCES=\ config/config.c\ include/rofi.h\ source/helper.c\ include/helper.h\ include/xrmoptions.h\ source/xrmoptions.c\ test/helper-test.c .PHONY: test test: ${bin_PROGRAMS} ./rofi_test ./helper_test .PHONY: test-x test-x: ${bin_PROGRAMS} echo "Test 1" $(top_srcdir)/test/run_test.sh 123 $(top_builddir)/textbox_test $(top_builddir) echo "Test 2" $(top_srcdir)/test/run_test.sh 200 $(top_srcdir)/test/run_errormsg_test.sh $(top_builddir) echo "Test 3" $(top_srcdir)/test/run_test.sh 201 $(top_srcdir)/test/run_switchdialog_test.sh $(top_builddir) echo "Test 4" $(top_srcdir)/test/run_test.sh 202 $(top_srcdir)/test/run_dmenu_test.sh $(top_builddir) echo "Test 5" $(top_srcdir)/test/run_test.sh 203 $(top_srcdir)/test/run_dmenu_custom_test.sh $(top_builddir) echo "Test 6" $(top_srcdir)/test/run_test.sh 204 $(top_srcdir)/test/run_run_test.sh $(top_builddir) echo "Test 7" $(top_srcdir)/test/run_test.sh 205 $(top_srcdir)/test/run_script_test.sh $(top_builddir) echo "Issue 256" $(top_srcdir)/test/run_test.sh 206 $(top_srcdir)/test/run_issue_256.sh $(top_builddir) echo "End tests" .PHONY: indent indent: ${rofi_SOURCES} ${top_srcdir}/config/config.def.c ${helper_test_SOURCES} ${textbox_test_SOURCES} ${rofi_test_SOURCES} uncrustify -c ${top_srcdir}/data/uncrustify.cfg --replace $^ .PHONY: cppcheck cppcheck: ${rofi_SOURCES} cppcheck --std=c99 --platform=unix64 --enable=all -Uerror_dialog -I ${top_srcdir}/include/ $^ .PHONY: ohcount ohcount: ${rofi_SOURCES} ohcount -i ${top_srcdir}/source/ rofi-0.15.11/README.md000066400000000000000000000162461261761453000141130ustar00rootroot00000000000000# A window switcher, run dialog and dmenu replacement A popup window switcher roughly based on [superswitcher](http://code.google.com/p/superswitcher/), requiring only xlib and pango. This version started off as a clone of simpleswitcher, the version from [Sean Pringle](http://github.com/seanpringle/simpleswitcher). All credit for this great tool should go to him. Rofi developed extra features, like a run-dialog, ssh-launcher and can act as a drop-in dmenu replacement, making it a very versatile tool. Using Rofi is a lot like dmenu, but extended for an improved work flow. It main features are: * Full (configurable) keyboard navigation. * Type to filter - Tokenized: Type any word in any order to filter. - Case insensitive * UTF-8 enabled. - UTF-8 aware string collating. - intl. keyboard support (`e -> è) * Pango font rendering. * RTL language support. * Window Switcher. - I3 support. - EWMH compatible WM. * Run dialog. * SSH launcher. * History based ordering last 25 choices are ordered on top based on use. (optional) * Levenshtein distance ordering of matches. (optional) * Drop in dmenu replacement. - With many added improvements. * Can be easily extended using scripts. The 4 Main functions of rofi are: ## Window Switcher ![Window List](https://davedavenport.github.io/rofi/images/rofi/window-list.png) The window switcher shows the following informations in columns: 1. Desktop number (optional, not shown in I3 mode) 2. Window class. 3. Window title. If compiled with I3 support, it should autodetect if I3 window manager is running and switch into I3 compatibility mode. This will disable Desktop numbers and hide the i3-bar, also it sends an IPC message to I3 to change focus. ## Run dialog ![run dialog](https://davedavenport.github.io/rofi/images/rofi/run-dialog.png) The run dialog allows the user to quickly search and launch a program. It offers the following features: - Shift-Return to run the selected program in a terminal. - Favorites list, frequently used programs are sorted on top. ## 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. ## 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) ). **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`). # 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. If use with neither of those options, rofi will launch in daemon-mode, waiting for a key (configured beforehand) to launch. ## Single-shot Show a run dialog with some font / color options: `rofi -show run -font "snap 10" -fg "#505050" -bg "#000000" -hlfg "#ffb964" -hlbg "#000000" -o 85` 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 ``` In both cases, rofi will output the user's selection to STDOUT. ## Daemon mode Let rofi sit in the background, waiting for the user to press `F12` to open the window run dialog: `rofi -key-run F12` ## 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 -switchers argument. | |`Shift-Left` | Switch to the previous modi. The list can be customized with the -switchers argument. | |`Ctrl-Tab` | Switch to the next modi. The list can be customized with the -switchers argument. | |`Ctrl-Shift-Tab` | Switch to the previous modi. The list can be customized with the -switchers argument. | |`Ctrl-space` | Set selected item as input text. | |`Shift-Del` | Delete entry from history. | |`Ctrl-grave` | Toggle case sensitivity. | # Configuration There are currently three methods of setting configuration options: * Compile time: edit config.c. This method is strongly discouraged. * Xresources: A method of storing key values in the Xserver. See [here](https://en.wikipedia.org/wiki/X_resources) for more information. This is the recommended way of configuring **rofi**. Remember to load your changes with `xrdb -load ~/.Xresources` * Commandline options: Arguments passed to **rofi**. The Xresources options and the commandline options are aliased. So to set option X you would set: `rofi.X: value` 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 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 Please see the [installation guide](https://davedavenport.github.io/rofi/p08-INSTALL.html) for instruction on how to install *rofi*. rofi-0.15.11/config/000077500000000000000000000000001261761453000140705ustar00rootroot00000000000000rofi-0.15.11/config/config.def.c000066400000000000000000000134561261761453000162470ustar00rootroot00000000000000/** * rofi * * MIT/X11 License * Modified 2013-2015 Qball Cow * * 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 #include #include "rofi.h" Settings config = { /** List of enabled switchers. */ /** -switchers */ .switchers = "window,run,ssh", /** Set the default window opacity. */ /** This option only works when running a composite manager. */ /** -o */ .window_opacity = 100, /** Border width around the window. */ .menu_bw = 1, /** The width of the switcher. (0100 in % > 100 in pixels) */ .menu_width = 50, /** Maximum number of options to show. */ .menu_lines = 15, /** Number of columns */ .menu_columns = 1, /** Font */ .menu_font = "mono 12", /** Row colors */ // Enable new color .color_enabled = FALSE, .color_normal = "#fdf6e3,#002b36,#eee8d5,#586e75,#eee8d5", .color_urgent = "#fdf6e3,#dc322f,#eee8d5,#dc322f,#fdf6e3", .color_active = "#fdf6e3,#268bd2,#eee8d5,#268bd2,#fdf6e3", .color_window = "#fdf6e3,#002b36", /** Background color */ .menu_bg = "#FDF6E3", /** Border color. */ .menu_bc = "#002B36", /** Foreground color */ .menu_fg = "#002B36", /** Text color used for urgent windows */ .menu_fg_urgent = "#DC322F", /** Text color used for active window */ .menu_fg_active = "#268BD2", .menu_bg_urgent = "#FDF6E3", .menu_bg_active = "#FDF6E3", /** Background color alternate row */ .menu_bg_alt = NULL, //"#EEE8D5", /** Foreground color (selected) */ .menu_hlfg = "#EEE8D5", .menu_hlfg_urgent = "#FDF6E3", .menu_hlfg_active = "#FDF6E3", /** Background color (selected) */ .menu_hlbg = "#586E75", .menu_hlbg_urgent = "#DC322F", .menu_hlbg_active = "#268BD2", /** Terminal to use. (for ssh and open in terminal) */ .terminal_emulator = "rofi-sensible-terminal", .ssh_client = "ssh", /** Command when executing ssh. */ .ssh_command = "{terminal} -e {ssh-client} {host}", /** Command when running */ .run_command = "{cmd}", /** Command used to list executable commands. empty -> internal */ .run_list_command = "", /** Command executed when running application in terminal */ .run_shell_command = "{terminal} -e {cmd}", /** * Location of the window. * Enumeration indicating location or gravity of window. * * WL_NORTH_WEST WL_NORTH WL_NORTH_EAST * * WL_EAST WL_CENTER WL_EAST * * WL_SOUTH_WEST WL_SOUTH WL_SOUTH_EAST * */ .location = WL_CENTER, /** Padding between elements */ .padding = 5, /** Y offset */ .y_offset = 0, /** X offset */ .x_offset = 0, /** Always should config.menu_lines lines, even if less lines are available */ .fixed_num_lines = FALSE, /** Do not use history */ .disable_history = FALSE, /** Use levenshtein sorting when matching */ .levenshtein_sort = FALSE, /** Case sensitivity of the search */ .case_sensitive = FALSE, /** Separator to use for dmenu mode */ .separator = '\n', /** Height of an element in #chars */ .element_height = 1, /** Sidebar mode, show the switchers */ .sidebar_mode = FALSE, /** Lazy mode setting */ .lazy_filter_limit = 15000, /** auto select */ .auto_select = FALSE, /** Parse /etc/hosts file in ssh view. */ .parse_hosts = FALSE, /** Parse ~/.ssh/known_hosts file in ssh view. */ .parse_known_hosts = TRUE, /** Modi to combine into one view. */ .combi_modi = "window,run", /** Fuzzy matching. */ .fuzzy = FALSE, .glob = FALSE, .tokenize = TRUE, /** Monitor */ .monitor = -1, /** set line margin */ .line_margin = 2, /** Set filter */ .filter = NULL, /** Separator style: dash/solid */ .separator_style = "dash", /** Hide scrollbar */ .hide_scrollbar = FALSE, .markup_rows = FALSE, .fullscreen = FALSE, .fake_transparency = FALSE, .dpi = -1, }; rofi-0.15.11/configure.ac000066400000000000000000000034601261761453000151140ustar00rootroot00000000000000AC_INIT([rofi], [0.15.11], [https://github.com/DaveDavenport/rofi/]) AC_CONFIG_SRCDIR([source/rofi.c]) AC_CONFIG_HEADER([config.h]) ## # Setup automake to be silent and in foreign mode. ## AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects dist-xz]) AM_SILENT_RULES([yes]) ## # Check for compiler ## AC_PROG_CC([clang gcc cc]) AC_PROG_CC_C99 AM_PROG_CC_C_O AC_USE_SYSTEM_EXTENSIONS dnl --------------------------------------------------------------------- dnl Disable window mode dnl --------------------------------------------------------------------- AC_ARG_ENABLE([windowmode], AC_HELP_STRING([--disable-windowmode],[Disable window mode])) AS_IF([ test "x$enable_windowmode" != "xno"], [AC_DEFINE([WINDOW_MODE],[1],[Enable the window mode])]) ## # I3 check ## AC_ARG_ENABLE(i3support, [AS_HELP_STRING([--disable-i3support], [Disable check for i3 support])]) AS_IF([test "x$enable_i3support" != xno && test "x$enable_windowmode" != "xno"],[AC_CHECK_HEADERS([i3/ipc.h], [i3_header=yes; break;])]) ## # Check dependencies ## PKG_PROG_PKG_CONFIG PKG_CHECK_MODULES([x11], [x11]) PKG_CHECK_MODULES([xinerama], [xinerama]) PKG_CHECK_MODULES([pango], [pango pangocairo]) PKG_CHECK_MODULES([cairo], [cairo cairo-xlib]) PKG_CHECK_MODULES([libsn], [libstartup-notification-1.0]) AC_SUBST([EXTRA_CFLAGS], ["-Wall -Wextra -Wparentheses -Winline -pedantic"]) AC_CONFIG_FILES([Makefile ]) AC_OUTPUT dnl ----------------------------------------------- dnl Some output to easily spot if I3 is enabled. dnl ----------------------------------------------- echo "" echo "-------------------------------------" if test x$i3_header = xyes; then echo "I3 support: Enabled" else echo "I3 support: Disabled" fi echo "-------------------------------------" echo "Now type 'make' to build" echo "" rofi-0.15.11/data/000077500000000000000000000000001261761453000135345ustar00rootroot00000000000000rofi-0.15.11/data/uncrustify.cfg000066400000000000000000000076371261761453000164450ustar00rootroot00000000000000# # My favorite format # code_width = 140 nl_max = 2 ls_func_split_full = True indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs input_tab_size = 8 # original tab size output_tab_size = 4 # new tab size indent_columns = output_tab_size indent_label = 2 # pos: absolute col, neg: relative column indent_align_string = False # align broken strings indent_brace = 0 nl_enum_brace = add # "enum {" vs "enum \n {" nl_union_brace = add # "union {" vs "union \n {" nl_struct_brace = add # "struct {" vs "struct \n {" nl_do_brace = remove # "do {" vs "do \n {" nl_if_brace = remove # "if () {" vs "if () \n {" nl_for_brace = remove # "for () {" vs "for () \n {" nl_else_brace = remove # "else {" vs "else \n {" nl_while_brace = remove # "while () {" vs "while () \n {" nl_switch_brace = add # "switch () {" vs "switch () \n {" # nl_func_var_def_blk = 1 # nl_before_case = 1 nl_fcall_brace = add # "foo() {" vs "foo()\n{" nl_fdef_brace = add # "int foo() {" vs "int foo()\n{" # nl_after_return = TRUE nl_brace_while = remove nl_brace_else = add nl_squeeze_ifdef = FALSE mod_paren_on_return = remove # "return 1;" vs "return (1);" mod_full_brace_if = add # "if (a) a--;" vs "if (a) { a--; }" mod_full_brace_for = add # "for () a--;" vs "for () { a--; }" mod_full_brace_do = add # "do a--; while ();" vs "do { a--; } while ();" mod_full_brace_while = add # "while (a) a--;" vs "while (a) { a--; }" sp_before_semi = remove sp_paren_paren = add # space between (( and )) sp_return_paren = add # "return (1);" vs "return(1);" sp_sizeof_paren = add # "sizeof (int)" vs "sizeof(int)" sp_before_sparen = add # "if (" vs "if(" sp_after_sparen = force # "if () {" vs "if (){" sp_after_cast = add # "(int) a" vs "(int)a" sp_inside_braces = add # "{ 1 }" vs "{1}" sp_inside_braces_struct = force # "{ 1 }" vs "{1}" sp_inside_braces_enum = force # "{ 1 }" vs "{1}" sp_inside_paren = add sp_inside_fparen = add sp_inside_sparen = add #sp_type_func = ignore sp_assign = force sp_arith = force sp_bool = force sp_compare = force sp_assign = force sp_after_comma = force sp_func_def_paren = add # "int foo (){" vs "int foo(){" sp_func_call_paren = add # "foo (" vs "foo(" sp_func_proto_paren = add # "int foo ();" vs "int foo();" align_with_tabs = FALSE # use tabs to align align_on_tabstop = FALSE # align on tabstops align_enum_equ_span = 4 align_nl_cont = TRUE align_var_def_span = 2 align_var_def_inline = TRUE align_var_def_star_style = 1 align_var_def_colon = TRUE align_assign_span = 1 align_struct_init_span = 3 align_var_struct_span = 3 align_right_cmt_span = 3 align_pp_define_span = 3 align_pp_define_gap = 4 align_number_left = TRUE align_typedef_span = 5 align_typedef_gap = 3 # cmt_star_cont = TRUE eat_blanks_before_close_brace = TRUE eat_blanks_after_open_brace = TRUE rofi-0.15.11/doc/000077500000000000000000000000001261761453000133705ustar00rootroot00000000000000rofi-0.15.11/doc/README000066400000000000000000000001651261761453000142520ustar00rootroot00000000000000Update manpage using ronn [https://github.com/rtomayko/ronn] ronn --roff --pipe rofi-manpage.markdown > rofi.1 rofi-0.15.11/doc/create_screenshot.sh000077500000000000000000000006431261761453000174320ustar00rootroot00000000000000#!/usr/bin/env bash function shout() { echo -en "Normal Row\nAlternateRow\nNormal Row active\nAlternateRow Active\nNormal Row urgent\nAlternateRow urgent" echo -en "\nSelected Row" echo -en "\n1\n2\n3\n4\n5" } sleep 5 ( shout | rofi -no-hide-scrollbar -columns 1 -width 1200 -location 0 -u 2,3 -a 4,5 -dmenu -p "Prompt:" -padding 20 -line-margin 10 -selected-row 6 ) & P=$! sleep 5 scrot sleep 1 killall rofi wait $P rofi-0.15.11/doc/rofi-manpage.markdown000066400000000000000000000453551261761453000175150ustar00rootroot00000000000000# ROFI 1 rofi ## NAME **rofi** - A window switcher, run launcher, ssh dialog and dmenu replacement ## SYNOPSIS **rofi** [ -width *pct_scr* ] [ -lines *lines* ] [ -columns *columns* ] [ -font *pangofont* ] [ -fg *color* ] [ -fg-urgent *color* ] [ -fg-active *color* ] [ -bg-urgent *color* ] [ -bg-active *color* ] [ -bg *color* ] [ -bgalt *color* ] [ -hlfg *color* ] [ -hlbg *color* ] [ -key-**mode** *combo* ] [ -terminal *terminal* ] [ -location *position* ] [ -fixed-num-lines ] [ -padding *padding* ] [ -opacity *opacity%* ] [ -display *display* ] [ -bc *color* ] [ -bw *width* ] [ -dmenu [ -p *prompt* ] [ -sep *separator* ] [ -l *selected line* ] [ -mesg ] [ -select ] ] [ -filter *filter* ] [ -ssh-client *client* ] [ -ssh-command *command* ] [ -disable-history ] [ -levenshtein-sort ] [ -case-sensitive ] [ -show *mode* ] [ -modi *mode1,mode2* ] [ -eh *element height* ] [ -lazy-filter-limit *limit* ] [ -e *message*] [ -a *row* ] [ -u *row* ] [ -pid *path* ] [ -now ] [ -rnow ] [ -snow ] [ -version ] [ -help] [ -dump-xresources ] [ -auto-select ] [ -parse-hosts ] [ -no-parse-known-hosts ] [ -combi-modi *mode1,mode2* ] [ -normal-window ] [ -fake-transparency ] [ -quiet ] [ -glob ] [ -tokenize ] ## DESCRIPTION **rofi** is an X11 popup 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** can be used in three ways, single-shot; executes once and directly exits when done, as a daemon listening to specific key-combination or emulating dmenu. ### Single-shot mode To launch **rofi** directly in a certain mode, specify a mode with `rofi -show `. To show the run dialog: rofi -show run ### Daemon mode To launch **rofi** in daemon mode don't specify any mode, instead keys can be bound to launch a certain mode. To show run-mode by pressing `F2` start **rofi** like this: rofi -key-run F2 Keybindings can also be specified in the `Xresources` file. ### Emulating dmenu **rofi** can emulate `dmenu` (a dynamic menu for X) when launched with the `-dmenu` flag. The official website for `dmenu` can be found [here](http://tools.suckless.org/dmenu/). ## OPTIONS There are currently three methods of setting configuration options: * Compile time: edit config.c. This method is strongly discouraged. * Xresources: A method of storing key values in the Xserver. See [here](https://en.wikipedia.org/wiki/X_resources) for more information. This is the recommended way of configuring **rofi**. * Command-line options: Arguments passed to **rofi**. The Xresources file expects options starting with `rofi.` followed by it's name. An Example to set the number of lines: rofi.lines: 10 Command line options override settings from Xresources file. The same option set as argument: prefixed with a '-': rofi -lines 10 To get a list of available options, formatted as Xresources entries run: rofi -dump-xresources The configuration system supports the following types: * String * Integer (signed and unsigned) * Char * Boolean Boolean options have a non-default command-line syntax. Example to enable option X: -X to disable it: -no-X Below is a list of the most important options: ### General `-key-{mode}` **KEY** Set the key combination to display a {mode} in daemon mode. rofi -key-run F12 rofi -key-ssh control+shift+s rofi -key-window mod1+Tab `-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 3 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 Pressing `shift-enter` sends the selected entry to STDOUT and moves to the next entry. `-show` *mode* Open **rofi** in a certain mode. Available modes are `window`, `run`, `ssh` To show the run-dialog: rofi -show run `-modi` *mode1,mode1* Specify a 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 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 mode has two parameters: :