Merge remote-tracking branch 'upstream/next' into wayland

This commit is contained in:
lbonn 2022-04-17 11:19:36 +02:00
commit 1e8c22b4a0
97 changed files with 3362 additions and 2421 deletions

View file

@ -36,14 +36,14 @@ runs:
uses: ./.github/actions/doxycheck
with:
logfile: builddir/doxygen.log
- id: meson-dist-check
- id: autoconf-dist-check
shell: bash
run: |
tar xf builddir/rofi-*.tar.gz
cd rofi-*/
meson setup . build
ninja -C build
ninja -C build test
./configure
make
make check
- id: upload
uses: actions/upload-artifact@v2
with:

View file

@ -26,6 +26,9 @@ runs:
- id: build
run: ninja -C builddir
shell: bash
- id: dist
run: ninja -C builddir dist
shell: bash
- id: test
run: ninja -C builddir test
shell: bash

View file

@ -10,6 +10,7 @@ runs:
python-version: '3.x'
- id: apt
run: |
sudo apt-get update
sudo apt-get install -y \
discount \
doxygen \

1
.mailmap Normal file
View file

@ -0,0 +1 @@
Morgane Glidic <sardemff7+git@sardemff7.net>

View file

@ -44,7 +44,7 @@ N. Izumi
Paulo Flabiano Smorigo
Peter Cannici
qedi
Quentin Glidic
Morgane Glidic
Rasmus Steinke
RaZ0rr-Two
Roomcays

View file

@ -48,7 +48,7 @@ If a value is the default value, the entry will be commented.
For example:
```css
configuration {
/* modi: "window,run,ssh,drun";*/
/* modes: "window,run,ssh,drun";*/
/* font: "mono 12";*/
/* location: 0;*/
/* yoffset: 0;*/
@ -163,12 +163,12 @@ A list starts with a '[' and ends with a ']'. The entries in the list are comma-
The entry in the list single ASCII words.
```css
combi-modi: [window,drun];
combi-modes: [window,drun];
```
For older versions you have :
```css
combi-modi: "window,drun";
combi-modes: "window,drun";
```
# Get a list of all possible options

View file

@ -1,5 +1,5 @@
MIT/X11 License
Modified 2013-2020 Qball Cow <qball@gmpclient.org>
Modified 2013-2022 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

View file

@ -7,6 +7,7 @@ then
fi
echo -en "\x00no-custom\x1ffalse\n"
echo -en "\x00data\x1fmonkey do, monkey did\n"
echo -en "\x00use-hot-keys\x1ftrue\n"
echo -en "${ROFI_RETV}\x00icon\x1ffirefox\x1finfo\x1ftest\n"
@ -14,3 +15,7 @@ if [ -n "${ROFI_INFO}" ]
then
echo "my info: ${ROFI_INFO} "
fi
if [ -n "${ROFI_DATA}" ]
then
echo "my data: ${ROFI_DATA} "
fi

View file

@ -80,15 +80,15 @@ SOURCES=\
source/xrmoptions.c\
source/xcb.c\
source/css-colors.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\
source/dialogs/help-keys.c\
source/dialogs/filebrowser.c\
source/modes/run.c\
source/modes/ssh.c\
source/modes/drun.c\
source/modes/dmenu.c\
source/modes/combi.c\
source/modes/window.c\
source/modes/script.c\
source/modes/help-keys.c\
source/modes/filebrowser.c\
include/display.h\
include/xcb.h\
include/xcb-internal.h\
@ -116,17 +116,17 @@ SOURCES=\
include/widgets/listview.h\
include/widgets/scrollbar.h\
include/xrmoptions.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\
include/dialogs/help-keys.h\
include/dialogs/filebrowser.h\
include/dialogs/dmenuscriptshared.h\
include/modes/ssh.h\
include/modes/run.h\
include/modes/drun.h\
include/modes/dmenu.h\
include/modes/combi.h\
include/modes/script.h\
include/modes/window.h\
include/modes/modes.h\
include/modes/help-keys.h\
include/modes/filebrowser.h\
include/modes/dmenuscriptshared.h\
resources/resources.c\
resources/resources.h
@ -177,12 +177,14 @@ dist_man1_MANS=\
dist_man5_MANS=\
doc/rofi-theme.5\
doc/rofi-debugging.5\
doc/rofi-keys.5\
doc/rofi-dmenu.5\
doc/rofi-script.5
EXTRA_DIST += \
doc/rofi-theme.5.markdown \
doc/rofi-debugging.5.markdown \
doc/rofi-script.5.markdown \
doc/rofi-keys.5.markdown \
doc/rofi-dmenu.5.markdown \
@ -249,10 +251,11 @@ EXTRA_DIST+=\
# Indent
##
update-manpage: $(top_srcdir)/doc/rofi-theme-selector.1.markdown $(top_srcdir)/doc/rofi.1.markdown $(top_srcdir)/doc/rofi-theme.5.markdown $(top_srcdir)/doc/rofi-script.5.markdown ${top_srcdir}/doc/rofi-sensible-terminal.1.markdown ${top_srcdir}/doc/rofi-keys.5.markdown ${top_srcdir}/doc/rofi-dmenu.5.markdown
update-manpage: $(top_srcdir)/doc/rofi-theme-selector.1.markdown $(top_srcdir)/doc/rofi.1.markdown $(top_srcdir)/doc/rofi-theme.5.markdown $(top_srcdir)/doc/rofi-script.5.markdown ${top_srcdir}/doc/rofi-sensible-terminal.1.markdown ${top_srcdir}/doc/rofi-keys.5.markdown ${top_srcdir}/doc/rofi-dmenu.5.markdown $(top_srcdir)/doc/rofi-debugging.5.markdown
go-md2man -in $(top_srcdir)/doc/rofi.1.markdown -out $(top_srcdir)/doc/rofi.1
go-md2man -in $(top_srcdir)/doc/rofi-theme-selector.1.markdown -out $(top_srcdir)/doc/rofi-theme-selector.1
go-md2man -in $(top_srcdir)/doc/rofi-theme.5.markdown -out $(top_srcdir)/doc/rofi-theme.5
go-md2man -in $(top_srcdir)/doc/rofi-debugging.5.markdown -out $(top_srcdir)/doc/rofi-debugging.5
go-md2man -in $(top_srcdir)/doc/rofi-keys.5.markdown -out $(top_srcdir)/doc/rofi-keys.5
go-md2man -in $(top_srcdir)/doc/rofi-script.5.markdown -out $(top_srcdir)/doc/rofi-script.5
go-md2man -in $(top_srcdir)/doc/rofi-dmenu.5.markdown -out $(top_srcdir)/doc/rofi-dmenu.5
@ -534,7 +537,7 @@ mode_test_LDADD=$(textbox_test_LDADD) $(check_LIBS)
mode_test_SOURCES=\
config/config.c\
test/mode-test.c\
source/dialogs/help-keys.c\
source/modes/help-keys.c\
source/helper.c\
source/theme.c\
source/css-colors.c\

View file

@ -42,7 +42,7 @@ Rofi is not:
# Table of Contents
- [Features](#features)
- [Modi](#modi)
- [Modes](#modes)
- [Manpages](#manpage)
- [Installation](#installation)
- [Quickstart](#quickstart)
@ -81,12 +81,12 @@ Its main features are:
* Easily extensible using scripts and plugins
* Advanced Theming
# Modi
# Modes
**Rofi** has several built-in modi implementing common use cases and can be extended by scripts (either called from
**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 modi:
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.
@ -95,7 +95,7 @@ Below is a list of the different modi:
* **file-browser**: A basic file-browser for opening files.
* **keys**: list internal keybindings.
* **script**: Write (limited) custom mode using simple scripts.
* **combi**: Combine multiple modi into one.
* **combi**: Combine multiple modes into one.
**Rofi** is known to work on Linux and BSD.
@ -130,13 +130,16 @@ To force the use of the xcb backend (if enabled during build), the `-x11` option
# 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](https://github.com/davatorium/rofi/discussions) and [issue traker](https://github.com/davatorium/rofi/issues?q=) before filing new issue.
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](https://github.com/davatorium/rofi/discussions) and [issue tracker](https://github.com/davatorium/rofi/issues?q=) before filing new issue.
* Manpages:
* [rofi](doc/rofi.1.markdown)
* [rofi-theme](doc/rofi-theme.5.markdown)
* [rofi-debugging](doc/rofi-debugging.5.markdown)
* [rofi-script](doc/rofi-script.5.markdown)
* [rofi-theme-selector](doc/rofi-theme-selector.1.markdown)
* [rofi-keys](doc/rofi-keys.5.markdown)
* [rofi-dmenu](doc/rofi-dmenu.5.markdown)
# Installation
@ -165,14 +168,14 @@ 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
rofi -modes "run,ssh" -show run
The modi to combine in combi mode.
For syntax to `-combi-modi`, see `-modi`.
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-modi "window,run,ssh" -modi combi
rofi -show combi -combi-modes "window,run,ssh" -modes combi
## Configuration
@ -216,7 +219,6 @@ Default theme:
#### Contents
* [Debugging](https://github.com/davatorium/rofi/wiki/Debugging-Rofi)
* [User scripts](https://github.com/davatorium/rofi/wiki/User-scripts)
* [Examples](https://github.com/davatorium/rofi/wiki#examples)
* [dmenu Specs](https://github.com/davatorium/rofi/wiki/dmenu_specs)

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2017 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -26,47 +26,47 @@
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include "rofi-types.h"
#include "settings.h"
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
Settings config = {
/** List of enabled modi. */
/** -modi */
/** List of enabled modes. */
/** -modes */
#ifdef WINDOW_MODE
#ifdef ENABLE_WAYLAND
// change the default if we build with wayland support
// window mode will still be available if running on X11
.modi = "run,ssh",
.modes = "drun,run,ssh",
#else
.modi = "window,run,ssh",
.modes = "window,drun,run,ssh",
#endif
#else
.modi = "run,ssh",
.modes = "drun,run,ssh",
#endif
/** Font */
.menu_font = "mono 12",
.menu_font = "mono 12",
/** Whether to load and show icons */
.show_icons = FALSE,
.show_icons = FALSE,
/** Terminal to use. (for ssh and open in terminal) */
.terminal_emulator = "rofi-sensible-terminal",
.ssh_client = "ssh",
.ssh_client = "ssh",
/** Command when executing ssh. */
.ssh_command = "{terminal} -e {ssh-client} {host} [-p {port}]",
.ssh_command = "{terminal} -e {ssh-client} {host} [-p {port}]",
/** Command when running */
.run_command = "{cmd}",
.run_command = "{cmd}",
/** Command used to list executable commands. empty -> internal */
.run_list_command = "",
.run_list_command = "",
/** Command executed when running application in terminal */
.run_shell_command = "{terminal} -e {cmd}",
.run_shell_command = "{terminal} -e {cmd}",
/** Command executed on accep-entry-custom for window modus */
.window_command = "wmctrl -i -R {window}",
.window_command = "wmctrl -i -R {window}",
/** No default icon theme, we search Adwaita and gnome as fallback */
.icon_theme = NULL,
.icon_theme = NULL,
/**
* Location of the window.
* Enumeration indicating location or gravity of window.
@ -78,85 +78,85 @@ Settings config = {
* WL_SOUTH_WEST WL_SOUTH WL_SOUTH_EAST
*
*/
.location = WL_CENTER,
.location = WL_CENTER,
/** Y offset */
.y_offset = 0,
.y_offset = 0,
/** X offset */
.x_offset = 0,
.x_offset = 0,
/** Always show config.menu_lines lines, even if less lines are available */
.fixed_num_lines = TRUE,
.fixed_num_lines = TRUE,
/** Do not use history */
.disable_history = FALSE,
.disable_history = FALSE,
/** Programs ignored for history */
.ignored_prefixes = "",
.ignored_prefixes = "",
/** Sort the displayed list */
.sort = FALSE,
.sort = FALSE,
/** Use levenshtein sorting when matching */
.sorting_method = "normal",
.sorting_method = "normal",
/** Case sensitivity of the search */
.case_sensitive = FALSE,
.case_sensitive = FALSE,
/** Cycle through in the element list */
.cycle = TRUE,
.cycle = TRUE,
/** Height of an element in #chars */
.element_height = 1,
/** Sidebar mode, show the modi */
.sidebar_mode = FALSE,
.element_height = 1,
/** Sidebar mode, show the modes */
.sidebar_mode = FALSE,
/** auto select */
.auto_select = FALSE,
.auto_select = FALSE,
/** Parse /etc/hosts file in ssh view. */
.parse_hosts = FALSE,
.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",
.tokenize = TRUE,
.matching = "normal",
.matching_method = MM_NORMAL,
.parse_known_hosts = TRUE,
/** Modes to combine into one view. */
.combi_modes = "window,run",
.tokenize = TRUE,
.matching = "normal",
.matching_method = MM_NORMAL,
/** Desktop entries to match in drun */
.drun_match_fields = "name,generic,exec,categories,keywords",
.drun_match_fields = "name,generic,exec,categories,keywords",
/** Only show entries in this category */
.drun_categories = NULL,
.drun_categories = NULL,
/** Desktop entry show actions */
.drun_show_actions = FALSE,
.drun_show_actions = FALSE,
/** Desktop format display */
.drun_display_format = "{name} [<span weight='light' size='small'><i>({generic})</i></span>]",
.drun_display_format =
"{name} [<span weight='light' size='small'><i>({generic})</i></span>]",
/** Desktop Link launch command */
.drun_url_launcher = "xdg-open",
.drun_url_launcher = "xdg-open",
/** Window fields to match in window mode*/
.window_match_fields = "all",
.window_match_fields = "all",
/** Monitor */
.monitor = "-5",
.monitor = "-5",
/** Set filter */
.filter = NULL,
.dpi = -1,
.threads = 0,
.scroll_method = 0,
.window_format = "{w} {c} {t}",
.click_to_exit = TRUE,
.theme = NULL,
.plugin_path = PLUGIN_PATH,
.max_history_size = 25,
.combi_hide_mode_prefix = FALSE,
.combi_display_format = "{mode} {text}",
.filter = NULL,
.dpi = -1,
.threads = 0,
.scroll_method = 0,
.window_format = "{w} {c} {t}",
.click_to_exit = TRUE,
.theme = NULL,
.plugin_path = PLUGIN_PATH,
.max_history_size = 25,
.combi_hide_mode_prefix = FALSE,
.combi_display_format = "{mode} {text}",
.matching_negate_char = '-',
.matching_negate_char = '-',
.cache_dir = NULL,
.window_thumbnail = FALSE,
.cache_dir = NULL,
.window_thumbnail = FALSE,
/** drun cache */
.drun_use_desktop_cache = FALSE,
.drun_use_desktop_cache = FALSE,
.drun_reload_desktop_cache = FALSE,
/** Benchmarks */
.benchmark_ui = FALSE,
.benchmark_ui = FALSE,
/** normalize match */
.normalize_match = FALSE,
.normalize_match = FALSE,
/** steal focus */
.steal_focus = FALSE,
.steal_focus = FALSE,
/** fallback icon */
.application_fallback_icon = NULL
};
.application_fallback_icon = NULL};

View file

@ -1,4 +1,4 @@
AC_INIT([rofi], [1.7.3], [https://github.com/davatorium/rofi/],[],[https://reddit.com/r/qtools/])
AC_INIT([rofi], [1.7.3-dev], [https://github.com/davatorium/rofi/],[],[https://reddit.com/r/qtools/])
AC_CONFIG_SRCDIR([source/rofi.c])
AC_CONFIG_HEADER([config.h])
@ -94,10 +94,10 @@ AS_IF([test "x${enable_asan}" = "xyes" ], [
dnl --------------------------------------------------------------------
dnl DRun dialog
dnl DRun Mode
dnl --------------------------------------------------------------------
AC_ARG_ENABLE([drun], AS_HELP_STRING([--disable-drun],[Disable desktop file run dialog]))
AS_IF([test "x${enable_drun}" != "xno"], [AC_DEFINE([ENABLE_DRUN], [1], [Enable desktop file run dialog])])
AC_ARG_ENABLE([drun], AS_HELP_STRING([--disable-drun],[Disable desktop file run mode]))
AS_IF([test "x${enable_drun}" != "xno"], [AC_DEFINE([ENABLE_DRUN], [1], [Enable desktop file run mode])])
dnl ---------------------------------------------------------------------
dnl Disable window mode
@ -176,14 +176,14 @@ AC_OUTPUT
echo ""
echo "-------------------------------------"
if test x$enable_drun != xno; then
echo "Desktop File drun dialog Enabled"
echo "Desktop File drun Enabled"
else
echo "Desktop File drun dialog Disabled"
echo "Desktop File drun Disabled"
fi
if test x$enable_windowmode != xno; then
echo "Window Switcher dialog Enabled"
echo "Window switcher mode Enabled"
else
echo "Window Switcher dialog Disabled"
echo "Window switcher Mode Disabled"
fi
if test x$enable_asan = xyes; then
echo "Asan address sanitize Enabled"

View file

@ -8,7 +8,7 @@ configuration {
action: "kb-cancel";
}
// File browser modi.
// File browser mode.
filebrowser {
sorting-method: "name";
directories-first: true;

View file

@ -6,6 +6,7 @@ if gomd2man.found()
'rofi-theme-selector.1.markdown',
'rofi-theme.5.markdown',
'rofi-dmenu.5.markdown',
'rofi-debugging.5.markdown',
'rofi-keys.5.markdown',
'rofi-script.5.markdown',
'rofi-sensible-terminal.1.markdown'

View file

@ -1,15 +0,0 @@
! ------------------------------------------------------------------------------
! ROFI Color theme
! User: qball
! Copyright: Dave Davenport
! ------------------------------------------------------------------------------
! "Color scheme for normal row" Set from: File
rofi.color-normal: argb:00000000, #dbdfbc, argb:00000000, #dbdfbc, #02143f
! "Color scheme for urgent row" Set from: File
rofi.color-urgent: argb:00000000, #ff81ff, argb:00000000, #ff817f, #02143f
! "Color scheme for active row" Set from: File
rofi.color-active: argb:00000000, #8ac4ff, argb:00000000, #8ac4ff, #02143f
! "Color scheme window" Set from: File
rofi.color-window: argb:dd000021, #dbdfbc, #dbdfbc
! "Separator style (none, dash, solid)" Set from: XResources
rofi.separator-style: solid

View file

@ -1,154 +0,0 @@
/**
* rofi -dump-theme output.
**/
* {
red: rgba ( 220, 50, 47, 100 % );
selected-active-foreground: rgba ( 2, 20, 63, 100 % );
lightfg: rgba ( 88, 104, 117, 100 % );
separatorcolor: rgba ( 219, 223, 188, 100 % );
urgent-foreground: rgba ( 255, 129, 255, 100 % );
alternate-urgent-background: rgba ( 0, 0, 0, 0 % );
lightbg: rgba ( 238, 232, 213, 100 % );
spacing: 2;
border-color: rgba ( 219, 223, 188, 100 % );
normal-background: rgba ( 0, 0, 0, 0 % );
background-color: rgba ( 0, 0, 0, 0 % );
alternate-active-background: rgba ( 0, 0, 0, 0 % );
active-foreground: rgba ( 138, 196, 255, 100 % );
blue: rgba ( 38, 139, 210, 100 % );
urgent-background: rgba ( 0, 0, 0, 0 % );
alternate-normal-foreground: var(foreground);
selected-active-background: rgba ( 138, 196, 255, 100 % );
background: rgba ( 0, 0, 33, 87 % );
selected-normal-foreground: rgba ( 2, 20, 63, 100 % );
active-background: rgba ( 0, 0, 0, 0 % );
alternate-active-foreground: var(active-foreground);
alternate-normal-background: rgba ( 0, 0, 0, 0 % );
foreground: rgba ( 219, 223, 188, 100 % );
selected-urgent-background: rgba ( 255, 129, 127, 100 % );
selected-urgent-foreground: rgba ( 2, 20, 63, 100 % );
normal-foreground: var(foreground);
alternate-urgent-foreground: var(urgent-foreground);
selected-normal-background: rgba ( 219, 223, 188, 100 % );
}
element {
padding: 1px ;
spacing: 5px ;
border: 0;
}
element normal.normal {
background-color: var(normal-background);
text-color: var(normal-foreground);
}
element normal.urgent {
background-color: var(urgent-background);
text-color: var(urgent-foreground);
}
element normal.active {
background-color: var(active-background);
text-color: var(active-foreground);
}
element selected.normal {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
element selected.urgent {
background-color: var(selected-urgent-background);
text-color: var(selected-urgent-foreground);
}
element selected.active {
background-color: var(selected-active-background);
text-color: var(selected-active-foreground);
}
element alternate.normal {
background-color: var(alternate-normal-background);
text-color: var(alternate-normal-foreground);
}
element alternate.urgent {
background-color: var(alternate-urgent-background);
text-color: var(alternate-urgent-foreground);
}
element alternate.active {
background-color: var(alternate-active-background);
text-color: var(alternate-active-foreground);
}
element-text {
background-color: rgba ( 0, 0, 0, 0 % );
text-color: inherit;
}
element-icon {
background-color: rgba ( 0, 0, 0, 0 % );
size: 1.2000ch ;
text-color: inherit;
}
window {
padding: 5;
background-color: var(background);
border: 1;
}
mainbox {
padding: 0;
border: 0;
}
message {
padding: 1px ;
border-color: var(separatorcolor);
border: 2px 0px 0px ;
}
textbox {
text-color: var(foreground);
}
listview {
padding: 2px 0px 0px ;
scrollbar: true;
border-color: var(separatorcolor);
spacing: 2px ;
fixed-height: 0;
border: 2px 0px 0px ;
}
scrollbar {
width: 4px ;
padding: 0;
handle-width: 8px ;
border: 0;
handle-color: var(normal-foreground);
}
sidebar {
border-color: var(separatorcolor);
border: 2px dash 0px 0px ;
}
button {
spacing: 0;
text-color: var(normal-foreground);
}
button selected {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
inputbar {
padding: 1px ;
spacing: 0px ;
text-color: var(normal-foreground);
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
}
case-indicator {
spacing: 0;
text-color: var(normal-foreground);
}
entry {
spacing: 0;
text-color: var(normal-foreground);
}
prompt {
spacing: 0;
text-color: var(normal-foreground);
}
textbox-prompt-colon {
margin: 0px 0.3000em 0.0000em 0.0000em ;
expand: false;
str: ":";
text-color: inherit;
}
mode-switcher {
border: 2px 0px 0px ;
}

234
doc/rofi-debugging.5 Normal file
View file

@ -0,0 +1,234 @@
.nh
.TH ROFI DEBUGGING 5 rofi debugging
.SH NAME
.PP
Debugging rofi.
.PP
When reporting an issue with rofi crashing, or misbehaving. It helps to do some small test
to help pin-point the problem.
.PP
First try disabling your custom configuration: \fB\fC-no-config\fR
.PP
This disables the parsing of the configuration files. This runs rofi in \fIstock\fP mode.
.PP
If you run custom C plugins, you can disable the plugins using: \fB\fC-no-plugins\fR
.SH Get the relevant information for an issue
.PP
Please pastebin the output of the following commands:
.PP
.RS
.nf
rofi -help
rofi -dump-config
rofi -dump-theme
.fi
.RE
.PP
\fB\fCrofi -help\fR provides us with the configuration files parsed, the exact version, monitor layout
and more useful information.
.PP
The \fB\fCrofi -dump-config\fR and \fB\fCrofi -dump-theme\fR output gives us \fB\fCrofi\fR
interpretation of your configuration and theme.
.PP
Please check the output for identifiable information and remove this.
.SH Timing traces
.PP
To get a timing trace, enable the \fBTimings\fP debug domain.
.PP
.RS
.nf
G_MESSAGES_DEBUG=Timings rofi -show drun
.fi
.RE
.PP
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.
.PP
Example trace:
.PP
.RS
.nf
(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
.fi
.RE
.SH Debug domains
.PP
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:
.RS
.IP \(bu 2
all: Show debug information from all domains.
.IP \(bu 2
X11Helper: The X11 Helper functions.
.IP \(bu 2
View: The main window view functions.
.IP \(bu 2
Widgets.Box: The Box widget.
.IP \(bu 2
Modes.DMenu: The dmenu mode.
.IP \(bu 2
Modes.Run: The run mode.
.IP \(bu 2
Modes.DRun: The desktop file run mode.
.IP \(bu 2
Modes.Window: The window mode.
.IP \(bu 2
Modes.Script: The script mode.
.IP \(bu 2
Modes.Combi: The script mode.
.IP \(bu 2
Modes.Ssh: The ssh mode.
.IP \(bu 2
Rofi: The main application.
.IP \(bu 2
Timings: Get timing output.
.IP \(bu 2
Theme: Theme engine debug output. (warning lots of output).
.IP \(bu 2
Widgets.Icon: The Icon widget.
.IP \(bu 2
Widgets.Box: The box widget.
.IP \(bu 2
Widgets.Container: The container widget.
.IP \(bu 2
Widgets.Window: The window widget.
.IP \(bu 2
Helpers.IconFetcher: Information about icon lookup.
.RE
.PP
For full list see \fB\fCman rofi\fR\&.
.PP
Example: \fB\fCG_MESSAGES_DEBUG=Dialogs.DRun rofi -show drun\fR To get specific output from the Desktop file run dialog.
.SH Creating a backtrace.
.PP
First make sure you compile \fBrofi\fP with debug symbols:
.PP
.RS
.nf
make CFLAGS="-O0 -g3" clean rofi
.fi
.RE
.PP
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.
.PP
.RS
.nf
gdb rofi core
.fi
.RE
.PP
Then type inside gdb:
.PP
.RS
.nf
thread apply all bt
.fi
.RE
.PP
The output trace is useful when reporting crashes.
.PP
Some distribution have \fB\fCsystemd-coredump\fR, this way you can easily get a backtrace via \fB\fCcoredumpctl\fR\&.
.SH SEE ALSO
.PP
\fBrofi-sensible-terminal(1)\fP, \fBdmenu(1)\fP, \fBrofi-debugging(5)\fP, \fBrofi-theme(5)\fP, \fBrofi-script(5)\fP, \fBrofi-keys(5)\fP,\fBrofi-theme-selector(1)\fP
.SH AUTHOR
.RS
.IP \(bu 2
Qball Cow qball@blame.services
\[la]mailto:qball@blame.services\[ra]
.RE

View file

@ -0,0 +1,167 @@
# 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:
```bash
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.
```bash
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.
## Creating a backtrace.
First make sure you compile **rofi** with debug symbols:
```bash
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.
```bash
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
* Qball Cow <qball@blame.services>

View file

@ -1,7 +1,8 @@
.TH ROFI\-DMENU 5 rofi\-dmenu
.nh
.TH ROFI-DMENU 5 rofi-dmenu
.SH NAME
.PP
\fBrofi dmenu mode\fP \- Rofi dmenu emulation
\fBrofi dmenu mode\fP - Rofi dmenu emulation
.SH DESCRIPTION
.PP
@ -14,8 +15,8 @@ The website for \fB\fCdmenu\fR can be found here
.PP
\fBrofi\fP does not aim to be 100% compatible with \fB\fCdmenu\fR\&. There are simply too many flavors of \fB\fCdmenu\fR\&.
The idea is that the basic usage command\-line flags are obeyed, theme\-related flags are not.
Besides, \fBrofi\fP offers some extended features (like multi\-select, highlighting, message bar, extra key bindings).
The idea is that the basic usage command-line flags are obeyed, theme-related flags are not.
Besides, \fBrofi\fP offers some extended features (like multi-select, highlighting, message bar, extra key bindings).
.SH BASIC CONCEPT
.PP
@ -28,27 +29,27 @@ By default separation of rows is done on new lines, making it easy to pipe the o
.SH USAGE
.PP
By launching \fBrofi\fP with the \fB\fC\-dmenu\fR flag it will go into dmenu emulation mode.
By launching \fBrofi\fP with the \fB\fC-dmenu\fR flag it will go into dmenu emulation mode.
.PP
.RS
.nf
ls | rofi \-dmenu
ls | rofi -dmenu
.fi
.RE
.SS DMENU DROP\-IN REPLACEMENT
.SS DMENU DROP-IN REPLACEMENT
.PP
If \fB\fCargv[0]\fR (calling command) is dmenu, \fBrofi\fP will start in dmenu mode.
This way, it can be used as a drop\-in replacement for dmenu. Just copy or symlink \fBrofi\fP to dmenu in \fB\fC$PATH\fR\&.
This way, it can be used as a drop-in replacement for dmenu. Just copy or symlink \fBrofi\fP to dmenu in \fB\fC$PATH\fR\&.
.PP
.RS
.nf
ln \-s /usr/bin/rofi /usr/bin/dmenu
ln -s /usr/bin/rofi /usr/bin/dmenu
.fi
.RE
@ -56,15 +57,15 @@ ln \-s /usr/bin/rofi /usr/bin/dmenu
.SS DMENU VS SCRIPT MODE
.PP
Script mode is used to extend \fBrofi\fP, dmenu mode is used to extend a script.
The two do share much of the same input format. Please see the \fBrofi\-script(5)\fP manpage for more information.
The two do share much of the same input format. Please see the \fBrofi-script(5)\fP manpage for more information.
.SS DMENU SPECIFIC COMMANDLINE FLAGS
.PP
A lot of these options can also be modified by the script using special input. See the \fBrofi\-script(5)\fP manpage
A lot of these options can also be modified by the script using special input. See the \fBrofi-script(5)\fP manpage
for more information about this syntax.
.PP
\fB\fC\-sep\fR \fIseparator\fP
\fB\fC-sep\fR \fIseparator\fP
.PP
Separator for \fB\fCdmenu\fR\&. Example: To show a list of 'a' to 'e' with '|' as a separator:
@ -73,13 +74,13 @@ Separator for \fB\fCdmenu\fR\&. Example: To show a list of 'a' to 'e' with '|' a
.RS
.nf
echo "a|b|c|d|e" | rofi \-sep '|' \-dmenu
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
.fi
.RE
.PP
\fB\fC\-p\fR \fIprompt\fP
\fB\fC-p\fR \fIprompt\fP
.PP
Specify the prompt to show in \fB\fCdmenu\fR mode. For example, select 'monkey', a,b,c,d, or e.
@ -88,7 +89,7 @@ Specify the prompt to show in \fB\fCdmenu\fR mode. For example, select 'monkey',
.RS
.nf
echo "a|b|c|d|e" | rofi \-sep '|' \-dmenu \-p "monkey"
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey"
.fi
.RE
@ -97,7 +98,7 @@ echo "a|b|c|d|e" | rofi \-sep '|' \-dmenu \-p "monkey"
Default: \fIdmenu\fP
.PP
\fB\fC\-l\fR \fInumber of lines to show\fP
\fB\fC-l\fR \fInumber of lines to show\fP
.PP
Maximum number of lines the menu may show before scrolling.
@ -106,7 +107,7 @@ Maximum number of lines the menu may show before scrolling.
.RS
.nf
rofi \-dmenu \-l 25
rofi -dmenu -l 25
.fi
.RE
@ -115,39 +116,39 @@ rofi \-dmenu \-l 25
Default: \fI15\fP
.PP
\fB\fC\-i\fR
\fB\fC-i\fR
.PP
Makes \fB\fCdmenu\fR searches case\-insensitive
Makes \fB\fCdmenu\fR searches case-insensitive
.PP
\fB\fC\-a\fR \fIX\fP
\fB\fC-a\fR \fIX\fP
.PP
Active row, mark \fIX\fP as active. Where \fIX\fP 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:
Active row, mark \fIX\fP as active. Where \fIX\fP 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:
.RS
.IP \(bu 2
A single row: '5'
.IP \(bu 2
A range of (last 3) rows: '\-3:'
A range of (last 3) rows: '-3:'
.IP \(bu 2
4 rows starting from row 7: '7:11' (or in legacy notation: '7\-10')
4 rows starting from row 7: '7:11' (or in legacy notation: '7-10')
.IP \(bu 2
A set of rows: '2,0,\-9'
A set of rows: '2,0,-9'
.IP \(bu 2
Or any combination: '5,\-3:,7:11,2,0,\-9'
Or any combination: '5,-3:,7:11,2,0,-9'
.RE
.PP
\fB\fC\-u\fR \fIX\fP
\fB\fC-u\fR \fIX\fP
.PP
Urgent row, mark \fIX\fP as urgent. See \fB\fC\-a\fR option for details.
Urgent row, mark \fIX\fP as urgent. See \fB\fC-a\fR option for details.
.PP
\fB\fC\-only\-match\fR
\fB\fC-only-match\fR
.PP
Only return a selected item, do not allow custom entry.
@ -155,14 +156,14 @@ This mode always returns an entry. It will not return if no matching entry is
selected.
.PP
\fB\fC\-no\-custom\fR
\fB\fC-no-custom\fR
.PP
Only return a selected item, do not allow custom entry.
This mode returns directly when no entries given.
.PP
\fB\fC\-format\fR \fIformat\fP
\fB\fC-format\fR \fIformat\fP
.PP
Allows the output of dmenu to be customized (N is the total number of input entries):
@ -171,9 +172,9 @@ Allows the output of dmenu to be customized (N is the total number of input entr
.IP \(bu 2
\&'s' selected string
.IP \(bu 2
\&'i' index (0 \-\& (N\-\&1))
\&'i' index (0 - (N-1))
.IP \(bu 2
\&'d' index (1 \-\& N)
\&'d' index (1 - N)
.IP \(bu 2
\&'q' quote string
.IP \(bu 2
@ -189,13 +190,13 @@ Allows the output of dmenu to be customized (N is the total number of input entr
Default: 's'
.PP
\fB\fC\-select\fR \fIstring\fP
\fB\fC-select\fR \fIstring\fP
.PP
Select first line that matches the given string
.PP
\fB\fC\-mesg\fR \fIstring\fP
\fB\fC-mesg\fR \fIstring\fP
.PP
Add a message line below the filter entry box. Supports Pango markup.
@ -203,27 +204,27 @@ For more information on supported markup, see here
\[la]https://docs.gtk.org/Pango/pango_markup.html\[ra]
.PP
\fB\fC\-dump\fR
\fB\fC-dump\fR
.PP
Dump the filtered list to stdout and quit.
This can be used to get the list as \fBrofi\fP would filter it.
Use together with \fB\fC\-filter\fR command.
Use together with \fB\fC-filter\fR command.
.PP
\fB\fC\-input\fR \fIfile\fP
\fB\fC-input\fR \fIfile\fP
.PP
Reads from \fIfile\fP instead of stdin.
.PP
\fB\fC\-password\fR
\fB\fC-password\fR
.PP
Hide the input text. This should not be considered secure!
.PP
\fB\fC\-markup\-rows\fR
\fB\fC-markup-rows\fR
.PP
Tell \fBrofi\fP that DMenu input is Pango markup encoded, and should be rendered.
@ -231,23 +232,23 @@ See here
\[la]https://developer.gnome.org/pygtk/stable/pango-markup-language.html\[ra] for details about Pango markup.
.PP
\fB\fC\-multi\-select\fR
\fB\fC-multi-select\fR
.PP
Allow multiple lines to be selected. Adds a small selection indicator to the left of each entry.
.PP
\fB\fC\-sync\fR
\fB\fC-sync\fR
.PP
Force \fBrofi\fP mode to first read all data from stdin before showing the selection window. This is original dmenu behavior.
.PP
Note: the default asynchronous mode will also be automatically disabled if used with conflicting options,
such as \fB\fC\-dump\fR, \fB\fC\-only\-match\fR or \fB\fC\-auto\-select\fR\&.
such as \fB\fC-dump\fR, \fB\fC-only-match\fR or \fB\fC-auto-select\fR\&.
.PP
\fB\fC\-async\-pre\-read\fR \fInumber\fP
\fB\fC-async-pre-read\fR \fInumber\fP
.PP
Reads the first \fInumber\fP entries blocking, then switches to async mode.
@ -257,23 +258,38 @@ This makes it feel more 'snappy'.
\fIdefault\fP: 25
.PP
\fB\fC\-window\-title\fR \fItitle\fP
\fB\fC-window-title\fR \fItitle\fP
.PP
Set name used for the window title. Will be shown as Rofi \- \fItitle\fP
Set name used for the window title. Will be shown as Rofi - \fItitle\fP
.PP
\fB\fC\-w\fR \fIwindowid\fP
\fB\fC-w\fR \fIwindowid\fP
.PP
Position \fBrofi\fP over the window with the given X11 window ID.
.PP
\fB\fC\-keep\-right\fR
\fB\fC-keep-right\fR
.PP
Set ellipsize mode to start. So, the end of the string is visible.
.PP
\fB\fC-display-columns\fR
.PP
A comma seperated list of columns to show.
.PP
\fB\fC-display-column-separator\fR
.PP
The column separator. This is a regex.
.PP
\fIdefault\fP: '\\t'
.SH RETURN VALUE
.RS
.IP \(bu 2
@ -281,30 +297,30 @@ Set ellipsize mode to start. So, the end of the string is visible.
.IP \(bu 2
\fB1\fP: User cancelled the selection.
.IP \(bu 2
\fB10\-28\fP: Row accepted by custom keybinding.
\fB10-28\fP: Row accepted by custom keybinding.
.RE
.SH SEE ALSO
.PP
rofi(1), rofi\-sensible\-terminal(1), dmenu(1), rofi\-theme(5), rofi\-script(5), rofi\-theme\-selector(1)
rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-script(5), rofi-theme-selector(1)
.SH AUTHOR
.PP
Qball Cow
\[la]qball@gmpclient.org\[ra]
Qball Cow qball@gmpclient.org
\[la]mailto:qball@gmpclient.org\[ra]
.PP
Rasmus Steinke
\[la]rasi@xssn.at\[ra]
Rasmus Steinke rasi@xssn.at
\[la]mailto:rasi@xssn.at\[ra]
.PP
Quentin Glidic
\[la]sardemff7+rofi@sardemff7.net\[ra]
Morgane Glidic sardemff7+rofi@sardemff7.net
\[la]mailto:sardemff7+rofi@sardemff7.net\[ra]
.PP
Original code based on work by: Sean Pringle
\[la]sean.pringle@gmail.com\[ra]
Original code based on work by: Sean Pringle sean.pringle@gmail.com
\[la]mailto:sean.pringle@gmail.com\[ra]
.PP
For a full list of authors, check the AUTHORS file.

View file

@ -177,6 +177,16 @@ Position **rofi** over the window with the given X11 window ID.
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'
## RETURN VALUE
@ -195,7 +205,7 @@ Qball Cow <qball@gmpclient.org>
Rasmus Steinke <rasi@xssn.at>
Quentin Glidic <sardemff7+rofi@sardemff7.net>
Morgane Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com>

View file

@ -1,7 +1,8 @@
.TH ROFI\-KEYS 5 rofi\-keys
.nh
.TH ROFI-KEYS 5 rofi-keys
.SH NAME
.PP
\fBrofi keys\fP \- Rofi Key and Mouse bindings
\fBrofi keys\fP - Rofi Key and Mouse bindings
.SH DESCRIPTION
.PP
@ -9,13 +10,13 @@
.SH Setting binding
.PP
Bindings can be done on the commandline (\-{bindingname}):
Bindings can be done on the commandline (-{bindingname}):
.PP
.RS
.nf
rofi \-show run \-kb\-accept\-entry 'Control+Shift+space'
rofi -show run -kb-accept-entry 'Control+Shift+space'
.fi
.RE
@ -28,7 +29,7 @@ or via the configuration file:
.nf
configuration {
kb\-accept\-entry: "Control+Shift+space";
kb-accept-entry: "Control+Shift+space";
}
.fi
@ -42,7 +43,7 @@ The key can be set by its name (see above) or its keycode:
.nf
configuration {
kb\-accept\-entry: "Control+Shift+[65]";
kb-accept-entry: "Control+Shift+[65]";
}
.fi
@ -59,7 +60,7 @@ Multiple keys can be specified for an action as a comma separated list:
.nf
configuration {
kb\-accept\-entry: "Control+Shift+space,Return";
kb-accept-entry: "Control+Shift+space,Return";
}
.fi
@ -74,552 +75,566 @@ prepend the binding with \fB\fC!\fR:
.nf
configuration {
kb\-accept\-entry: "!Control+Shift+space,Return";
kb-accept-entry: "!Control+Shift+space,Return";
}
.fi
.RE
.SH Keyboard Bindings
.SS \fBkb\-primary\-paste\fP:
.SS \fBkb-primary-paste\fP:
.PP
Paste primary selection
.PP
\fBDefault\fP: Control+V,Shift+Insert
\fBDefault\fP: Control+V,Shift+Insert
.SS \fBkb\-secondary\-paste\fP
.SS \fBkb-secondary-paste\fP
.PP
Paste clipboard
.PP
\fBDefault\fP: Control+v,Insert
\fBDefault\fP: Control+v,Insert
.SS \fBkb\-clear\-line\fP
.SS \fBkb-clear-line\fP
.PP
Clear input line
.PP
\fBDefault\fP: Control+w
\fBDefault\fP: Control+w
.SS \fBkb\-move\-front\fP
.SS \fBkb-move-front\fP
.PP
Beginning of line
.PP
\fBDefault\fP: Control+a
\fBDefault\fP: Control+a
.SS \fBkb\-move\-end\fP
.SS \fBkb-move-end\fP
.PP
End of line
.PP
\fBDefault\fP: Control+e
\fBDefault\fP: Control+e
.SS \fBkb\-move\-word\-back\fP
.SS \fBkb-move-word-back\fP
.PP
Move back one word
.PP
\fBDefault\fP: Alt+b,Control+Left
\fBDefault\fP: Alt+b,Control+Left
.SS \fBkb\-move\-word\-forward\fP
.SS \fBkb-move-word-forward\fP
.PP
Move forward one word
.PP
\fBDefault\fP: Alt+f,Control+Right
\fBDefault\fP: Alt+f,Control+Right
.SS \fBkb\-move\-char\-back\fP
.SS \fBkb-move-char-back\fP
.PP
Move back one char
.PP
\fBDefault\fP: Left,Control+b
\fBDefault\fP: Left,Control+b
.SS \fBkb\-move\-char\-forward\fP
.SS \fBkb-move-char-forward\fP
.PP
Move forward one char
.PP
\fBDefault\fP: Right,Control+f
\fBDefault\fP: Right,Control+f
.SS \fBkb\-remove\-word\-back\fP
.SS \fBkb-remove-word-back\fP
.PP
Delete previous word
.PP
\fBDefault\fP: Control+Alt+h,Control+BackSpace
\fBDefault\fP: Control+Alt+h,Control+BackSpace
.SS \fBkb\-remove\-word\-forward\fP
.SS \fBkb-remove-word-forward\fP
.PP
Delete next word
.PP
\fBDefault\fP: Control+Alt+d
\fBDefault\fP: Control+Alt+d
.SS \fBkb\-remove\-char\-forward\fP
.SS \fBkb-remove-char-forward\fP
.PP
Delete next char
.PP
\fBDefault\fP: Delete,Control+d
\fBDefault\fP: Delete,Control+d
.SS \fBkb\-remove\-char\-back\fP
.SS \fBkb-remove-char-back\fP
.PP
Delete previous char
.PP
\fBDefault\fP: BackSpace,Shift+BackSpace,Control+h
\fBDefault\fP: BackSpace,Shift+BackSpace,Control+h
.SS \fBkb\-remove\-to\-eol\fP
.SS \fBkb-remove-to-eol\fP
.PP
Delete till the end of line
.PP
\fBDefault\fP: Control+k
\fBDefault\fP: Control+k
.SS \fBkb\-remove\-to\-sol\fP
.SS \fBkb-remove-to-sol\fP
.PP
Delete till the start of line
.PP
\fBDefault\fP: Control+u
\fBDefault\fP: Control+u
.SS \fBkb\-accept\-entry\fP
.SS \fBkb-accept-entry\fP
.PP
Accept entry
.PP
\fBDefault\fP: Control+j,Control+m,Return,KP\_Enter
\fBDefault\fP: Control+j,Control+m,Return,KP_Enter
.SS \fBkb\-accept\-custom\fP
.SS \fBkb-accept-custom\fP
.PP
Use entered text as command (in ssh/run modi)
Use entered text as command (in ssh/run modes)
.PP
\fBDefault\fP: Control+Return
\fBDefault\fP: Control+Return
.SS \fBkb\-accept\-custom\-alt\fP
.SS \fBkb-accept-custom-alt\fP
.PP
Use entered text as command (in ssh/run modi)
Use entered text as command (in ssh/run modes)
.PP
\fBDefault\fP: Control+Shift+Return
\fBDefault\fP: Control+Shift+Return
.SS \fBkb\-accept\-alt\fP
.SS \fBkb-accept-alt\fP
.PP
Use alternate accept command.
.PP
\fBDefault\fP: Shift+Return
\fBDefault\fP: Shift+Return
.SS \fBkb\-delete\-entry\fP
.SS \fBkb-delete-entry\fP
.PP
Delete entry from history
.PP
\fBDefault\fP: Shift+Delete
\fBDefault\fP: Shift+Delete
.SS \fBkb\-mode\-next\fP
.SS \fBkb-mode-next\fP
.PP
Switch to the next mode.
.PP
\fBDefault\fP: Shift+Right,Control+Tab
\fBDefault\fP: Shift+Right,Control+Tab
.SS \fBkb\-mode\-previous\fP
.SS \fBkb-mode-previous\fP
.PP
Switch to the previous mode.
.PP
\fBDefault\fP: Shift+Left,Control+ISO\_Left\_Tab
\fBDefault\fP: Shift+Left,Control+ISO_Left_Tab
.SS \fBkb\-mode\-complete\fP
.SS \fBkb-mode-complete\fP
.PP
Start completion for mode.
.PP
\fBDefault\fP: Control+l
\fBDefault\fP: Control+l
.SS \fBkb\-row\-left\fP
.SS \fBkb-row-left\fP
.PP
Go to the previous column
.PP
\fBDefault\fP: Control+Page\_Up
\fBDefault\fP: Control+Page_Up
.SS \fBkb\-row\-right\fP
.SS \fBkb-row-right\fP
.PP
Go to the next column
.PP
\fBDefault\fP: Control+Page\_Down
\fBDefault\fP: Control+Page_Down
.SS \fBkb\-row\-up\fP
.SS \fBkb-row-up\fP
.PP
Select previous entry
.PP
\fBDefault\fP: Up,Control+p,ISO\_Left\_Tab
\fBDefault\fP: Up,Control+p
.SS \fBkb\-row\-down\fP
.SS \fBkb-row-down\fP
.PP
Select next entry
.PP
\fBDefault\fP: Down,Control+n
\fBDefault\fP: Down,Control+n
.SS \fBkb\-row\-tab\fP
.SS \fBkb-row-tab\fP
.PP
Go to next row, if one left, accept it, if no left next mode.
.PP
\fBDefault\fP: Tab
\fBDefault\fP:
.SS \fBkb\-page\-prev\fP
.SS \fBkb-element-next\fP
.PP
Go to next row.
.PP
\fBDefault\fP: Tab
.SS \fBkb-element-prev\fP
.PP
Go to previous row.
.PP
\fBDefault\fP: ISO_Left_Tab
.SS \fBkb-page-prev\fP
.PP
Go to the previous page
.PP
\fBDefault\fP: Page\_Up
\fBDefault\fP: Page_Up
.SS \fBkb\-page\-next\fP
.SS \fBkb-page-next\fP
.PP
Go to the next page
.PP
\fBDefault\fP: Page\_Down
\fBDefault\fP: Page_Down
.SS \fBkb\-row\-first\fP
.SS \fBkb-row-first\fP
.PP
Go to the first entry
.PP
\fBDefault\fP: Home,KP\_Home
\fBDefault\fP: Home,KP_Home
.SS \fBkb\-row\-last\fP
.SS \fBkb-row-last\fP
.PP
Go to the last entry
.PP
\fBDefault\fP: End,KP\_End
\fBDefault\fP: End,KP_End
.SS \fBkb\-row\-select\fP
.SS \fBkb-row-select\fP
.PP
Set selected item as input text
.PP
\fBDefault\fP: Control+space
\fBDefault\fP: Control+space
.SS \fBkb\-screenshot\fP
.SS \fBkb-screenshot\fP
.PP
Take a screenshot of the rofi window
.PP
\fBDefault\fP: Alt+S
\fBDefault\fP: Alt+S
.SS \fBkb\-ellipsize\fP
.SS \fBkb-ellipsize\fP
.PP
Toggle between ellipsize modes for displayed data
.PP
\fBDefault\fP: Alt+period
\fBDefault\fP: Alt+period
.SS \fBkb\-toggle\-case\-sensitivity\fP
.SS \fBkb-toggle-case-sensitivity\fP
.PP
Toggle case sensitivity
.PP
\fBDefault\fP: grave,dead\_grave
\fBDefault\fP: grave,dead_grave
.SS \fBkb\-toggle\-sort\fP
.SS \fBkb-toggle-sort\fP
.PP
Toggle sort
.PP
\fBDefault\fP: Alt+grave
\fBDefault\fP: Alt+grave
.SS \fBkb\-cancel\fP
.SS \fBkb-cancel\fP
.PP
Quit rofi
.PP
\fBDefault\fP: Escape,Control+g,Control+bracketleft
\fBDefault\fP: Escape,Control+g,Control+bracketleft
.SS \fBkb\-custom\-1\fP
.SS \fBkb-custom-1\fP
.PP
Custom keybinding 1
.PP
\fBDefault\fP: Alt+1
\fBDefault\fP: Alt+1
.SS \fBkb\-custom\-2\fP
.SS \fBkb-custom-2\fP
.PP
Custom keybinding 2
.PP
\fBDefault\fP: Alt+2
\fBDefault\fP: Alt+2
.SS \fBkb\-custom\-3\fP
.SS \fBkb-custom-3\fP
.PP
Custom keybinding 3
.PP
\fBDefault\fP: Alt+3
\fBDefault\fP: Alt+3
.SS \fBkb\-custom\-4\fP
.SS \fBkb-custom-4\fP
.PP
Custom keybinding 4
.PP
\fBDefault\fP: Alt+4
\fBDefault\fP: Alt+4
.SS \fBkb\-custom\-5\fP
.SS \fBkb-custom-5\fP
.PP
Custom Keybinding 5
.PP
\fBDefault\fP: Alt+5
\fBDefault\fP: Alt+5
.SS \fBkb\-custom\-6\fP
.SS \fBkb-custom-6\fP
.PP
Custom keybinding 6
.PP
\fBDefault\fP: Alt+6
\fBDefault\fP: Alt+6
.SS \fBkb\-custom\-7\fP
.SS \fBkb-custom-7\fP
.PP
Custom Keybinding 7
.PP
\fBDefault\fP: Alt+7
\fBDefault\fP: Alt+7
.SS \fBkb\-custom\-8\fP
.SS \fBkb-custom-8\fP
.PP
Custom keybinding 8
.PP
\fBDefault\fP: Alt+8
\fBDefault\fP: Alt+8
.SS \fBkb\-custom\-9\fP
.SS \fBkb-custom-9\fP
.PP
Custom keybinding 9
.PP
\fBDefault\fP: Alt+9
\fBDefault\fP: Alt+9
.SS \fBkb\-custom\-10\fP
.SS \fBkb-custom-10\fP
.PP
Custom keybinding 10
.PP
\fBDefault\fP: Alt+0
\fBDefault\fP: Alt+0
.SS \fBkb\-custom\-11\fP
.SS \fBkb-custom-11\fP
.PP
Custom keybinding 11
.PP
\fBDefault\fP: Alt+exclam
\fBDefault\fP: Alt+exclam
.SS \fBkb\-custom\-12\fP
.SS \fBkb-custom-12\fP
.PP
Custom keybinding 12
.PP
\fBDefault\fP: Alt+at
\fBDefault\fP: Alt+at
.SS \fBkb\-custom\-13\fP
.SS \fBkb-custom-13\fP
.PP
Custom keybinding 13
.PP
\fBDefault\fP: Alt+numbersign
\fBDefault\fP: Alt+numbersign
.SS \fBkb\-custom\-14\fP
.SS \fBkb-custom-14\fP
.PP
Custom keybinding 14
.PP
\fBDefault\fP: Alt+dollar
\fBDefault\fP: Alt+dollar
.SS \fBkb\-custom\-15\fP
.SS \fBkb-custom-15\fP
.PP
Custom keybinding 15
.PP
\fBDefault\fP: Alt+percent
\fBDefault\fP: Alt+percent
.SS \fBkb\-custom\-16\fP
.SS \fBkb-custom-16\fP
.PP
Custom keybinding 16
.PP
\fBDefault\fP: Alt+dead\_circumflex
\fBDefault\fP: Alt+dead_circumflex
.SS \fBkb\-custom\-17\fP
.SS \fBkb-custom-17\fP
.PP
Custom keybinding 17
.PP
\fBDefault\fP: Alt+ampersand
\fBDefault\fP: Alt+ampersand
.SS \fBkb\-custom\-18\fP
.SS \fBkb-custom-18\fP
.PP
Custom keybinding 18
.PP
\fBDefault\fP: Alt+asterisk
\fBDefault\fP: Alt+asterisk
.SS \fBkb\-custom\-19\fP
.SS \fBkb-custom-19\fP
.PP
Custom Keybinding 19
.PP
\fBDefault\fP: Alt+parenleft
\fBDefault\fP: Alt+parenleft
.SS \fBkb\-select\-1\fP
.SS \fBkb-select-1\fP
.PP
Select row 1
.PP
\fBDefault\fP: Super+1
\fBDefault\fP: Super+1
.SS \fBkb\-select\-2\fP
.SS \fBkb-select-2\fP
.PP
Select row 2
.PP
\fBDefault\fP: Super+2
\fBDefault\fP: Super+2
.SS \fBkb\-select\-3\fP
.SS \fBkb-select-3\fP
.PP
Select row 3
.PP
\fBDefault\fP: Super+3
\fBDefault\fP: Super+3
.SS \fBkb\-select\-4\fP
.SS \fBkb-select-4\fP
.PP
Select row 4
.PP
\fBDefault\fP: Super+4
\fBDefault\fP: Super+4
.SS \fBkb\-select\-5\fP
.SS \fBkb-select-5\fP
.PP
Select row 5
.PP
\fBDefault\fP: Super+5
\fBDefault\fP: Super+5
.SS \fBkb\-select\-6\fP
.SS \fBkb-select-6\fP
.PP
Select row 6
.PP
\fBDefault\fP: Super+6
\fBDefault\fP: Super+6
.SS \fBkb\-select\-7\fP
.SS \fBkb-select-7\fP
.PP
Select row 7
.PP
\fBDefault\fP: Super+7
\fBDefault\fP: Super+7
.SS \fBkb\-select\-8\fP
.SS \fBkb-select-8\fP
.PP
Select row 8
.PP
\fBDefault\fP: Super+8
\fBDefault\fP: Super+8
.SS \fBkb\-select\-9\fP
.SS \fBkb-select-9\fP
.PP
Select row 9
.PP
\fBDefault\fP: Super+9
\fBDefault\fP: Super+9
.SS \fBkb\-select\-10\fP
.SS \fBkb-select-10\fP
.PP
Select row 10
.PP
\fBDefault\fP: Super+0
\fBDefault\fP: Super+0
.SH Mouse Bindings
.SS \fBml\-row\-left\fP
.SS \fBml-row-left\fP
.PP
Go to the previous column
.PP
\fBDefault\fP: ScrollLeft
\fBDefault\fP: ScrollLeft
.SS \fBml\-row\-right\fP
.SS \fBml-row-right\fP
.PP
Go to the next column
.PP
\fBDefault\fP: ScrollRight
\fBDefault\fP: ScrollRight
.SS \fBml\-row\-up\fP
.SS \fBml-row-up\fP
.PP
Select previous entry
.PP
\fBDefault\fP: ScrollUp
\fBDefault\fP: ScrollUp
.SS \fBml\-row\-down\fP
.SS \fBml-row-down\fP
.PP
Select next entry
.PP
\fBDefault\fP: ScrollDown
\fBDefault\fP: ScrollDown
.SS \fBme\-select\-entry\fP
.SS \fBme-select-entry\fP
.PP
Select hovered row
.PP
\fBDefault\fP: MousePrimary
\fBDefault\fP: MousePrimary
.SS \fBme\-accept\-entry\fP
.SS \fBme-accept-entry\fP
.PP
Accept hovered row
.PP
\fBDefault\fP: MouseDPrimary
\fBDefault\fP: MouseDPrimary
.SS \fBme\-accept\-custom\fP
.SS \fBme-accept-custom\fP
.PP
Accept hovered row with custom action
.PP
\fBDefault\fP: Control+MouseDPrimary
\fBDefault\fP: Control+MouseDPrimary
.SH SEE ALSO
.PP
rofi(1), rofi\-sensible\-terminal(1), rofi\-theme(5), rofi\-script(5)
rofi(1), rofi-sensible-terminal(1), rofi-theme(5), rofi-script(5)
.SH AUTHOR
.PP
Qball Cow
\[la]qball@gmpclient.org\[ra]
Qball Cow qball@gmpclient.org
\[la]mailto:qball@gmpclient.org\[ra]
.PP
Rasmus Steinke
\[la]rasi@xssn.at\[ra]
Rasmus Steinke rasi@xssn.at
\[la]mailto:rasi@xssn.at\[ra]
.PP
Quentin Glidic
\[la]sardemff7+rofi@sardemff7.net\[ra]
Morgane Glidic sardemff7+rofi@sardemff7.net
\[la]mailto:sardemff7+rofi@sardemff7.net\[ra]
.PP
Original code based on work by: Sean Pringle
\[la]sean.pringle@gmail.com\[ra]
Original code based on work by: Sean Pringle sean.pringle@gmail.com
\[la]mailto:sean.pringle@gmail.com\[ra]
.PP
For a full list of authors, check the AUTHORS file.

View file

@ -136,12 +136,12 @@ Accept entry
**Default**: Control+j,Control+m,Return,KP_Enter
### **kb-accept-custom**
Use entered text as command (in ssh/run modi)
Use entered text as command (in ssh/run modes)
**Default**: Control+Return
### **kb-accept-custom-alt**
Use entered text as command (in ssh/run modi)
Use entered text as command (in ssh/run modes)
**Default**: Control+Shift+Return
@ -183,7 +183,7 @@ Go to the next column
### **kb-row-up**
Select previous entry
**Default**: Up,Control+p,ISO_Left_Tab
**Default**: Up,Control+p
### **kb-row-down**
Select next entry
@ -193,7 +193,17 @@ Select next entry
### **kb-row-tab**
Go to next row, if one left, accept it, if no left next mode.
**Default**: Tab
**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
@ -438,7 +448,7 @@ Qball Cow <qball@gmpclient.org>
Rasmus Steinke <rasi@xssn.at>
Quentin Glidic <sardemff7+rofi@sardemff7.net>
Morgane Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com>

View file

@ -1,7 +1,8 @@
.TH ROFI\-SCRIPT 5 rofi\-script
.nh
.TH ROFI-SCRIPT 5 rofi-script
.SH NAME
.PP
\fBrofi script mode\fP \- Rofi format for scriptable modi.
\fBrofi script mode\fP - Rofi format for scriptable mode.
.SH DESCRIPTION
.PP
@ -19,7 +20,7 @@ For example:
.RS
.nf
rofi \-show fb \-modi "fb:file\_browser.sh"
rofi -show fb -modes "fb:file_browser.sh"
.fi
.RE
@ -61,7 +62,7 @@ This shows two entries, reload and quit. When the quit entry is selected, rofi c
.PP
Rofi sets the following environment variable when executing the script:
.SS \fB\fCROFI\_RETV\fR
.SS \fB\fCROFI_RETV\fR
.PP
An integer number with the current state:
@ -73,14 +74,18 @@ An integer number with the current state:
.IP \(bu 2
\fB2\fP: Selected a custom entry.
.IP \(bu 2
\fB10\-28\fP: Custom keybinding 1\-19 ( need to be explicitly enabled by script ).
\fB10-28\fP: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
.RE
.SS \fB\fCROFI\_INFO\fR
.SS \fB\fCROFI_INFO\fR
.PP
Environment get set when selected entry get set with the property value of the 'info' row option, if set.
.SS \fB\fCROFI_DATA\fR
.PP
Environment get set when script sets \fB\fCdata\fR option in header.
.SH Passing mode options
.PP
Extra options, like setting the prompt, can be set by the script.
@ -93,7 +98,7 @@ For example to set the prompt:
.RS
.nf
echo \-en "\\0prompt\\x1fChange prompt\\n"
echo -en "\\0prompt\\x1fChange prompt\\n"
.fi
.RE
@ -107,7 +112,7 @@ The following extra options exists:
.IP \(bu 2
\fBmessage\fP: Update the message text.
.IP \(bu 2
\fBmarkup\-rows\fP: If 'true' renders markup in the row.
\fBmarkup-rows\fP: If 'true' renders markup in the row.
.IP \(bu 2
\fBurgent\fP: Mark rows as urgent. (for syntax see the urgent option in dmenu mode)
.IP \(bu 2
@ -115,9 +120,11 @@ The following extra options exists:
.IP \(bu 2
\fBdelim\fP: 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.
.IP \(bu 2
\fBno\-custom\fP: If set to 'true'; only accept listed entries, ignore custom input.
\fBno-custom\fP: If set to 'true'; only accept listed entries, ignore custom input.
.IP \(bu 2
\fBuse\-hot\-keys\fP: If set to true, it enabled the Custom keybindings for script. Warning this breaks the normal rofi flow.
\fBuse-hot-keys\fP: If set to true, it enabled the Custom keybindings for script. Warning this breaks the normal rofi flow.
.IP \(bu 2
\fBdata\fP: Passed data to the next execution of the script via \fBROFI_DATA\fP\&.
.RE
@ -133,7 +140,7 @@ For example:
.RS
.nf
echo \-en "aap\\0icon\\x1ffolder\\n"
echo -en "aap\\0icon\\x1ffolder\\n"
.fi
.RE
@ -149,7 +156,7 @@ The following options are supported:
.IP \(bu 2
\fBnonselectable\fP: If true the row cannot activated.
.IP \(bu 2
\fBinfo\fP: Info that, on selection, gets placed in the \fB\fCROFI\_INFO\fR environment variable. This entry does not get searched.
\fBinfo\fP: Info that, on selection, gets placed in the \fB\fCROFI_INFO\fR environment variable. This entry does not get searched.
.RE
@ -160,7 +167,7 @@ multiple entries can be passed using the \fB\fC\\x1f\fR separator.
.RS
.nf
echo \-en "aap\\0icon\\x1ffolder\\x1finfo\\x1ftest\\n"
echo -en "aap\\0icon\\x1ffolder\\x1finfo\\x1ftest\\n"
.fi
.RE
@ -177,7 +184,7 @@ In bash the best way to do this is using \fB\fCcoproc\fR\&.
.RS
.nf
coproc ( myApp > /dev/null 2>\&1 )
coproc ( myApp > /dev/null 2>&1 )
.fi
.RE
@ -189,24 +196,24 @@ See issue #1201 on github.
.SH SEE ALSO
.PP
rofi(1), rofi\-sensible\-terminal(1), dmenu(1), rofi\-theme(5), rofi\-theme\-selector(1)
rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-theme-selector(1)
.SH AUTHOR
.PP
Qball Cow
\[la]qball@gmpclient.org\[ra]
Qball Cow qball@gmpclient.org
\[la]mailto:qball@gmpclient.org\[ra]
.PP
Rasmus Steinke
\[la]rasi@xssn.at\[ra]
Rasmus Steinke rasi@xssn.at
\[la]mailto:rasi@xssn.at\[ra]
.PP
Quentin Glidic
\[la]sardemff7+rofi@sardemff7.net\[ra]
Morgane Glidic sardemff7+rofi@sardemff7.net
\[la]mailto:sardemff7+rofi@sardemff7.net\[ra]
.PP
Original code based on work by: Sean Pringle
\[la]sean.pringle@gmail.com\[ra]
Original code based on work by: Sean Pringle sean.pringle@gmail.com
\[la]mailto:sean.pringle@gmail.com\[ra]
.PP
For a full list of authors, check the AUTHORS file.

View file

@ -2,7 +2,7 @@
## NAME
**rofi script mode** - Rofi format for scriptable modi.
**rofi script mode** - Rofi format for scriptable mode.
## DESCRIPTION
@ -18,7 +18,7 @@ To specify a script mode, set a mode with the following syntax: "{name}:{executa
For example:
```
rofi -show fb -modi "fb:file_browser.sh"
rofi -show fb -modes "fb:file_browser.sh"
```
The name should be unique.
@ -63,6 +63,10 @@ An integer number with the current state:
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.
@ -84,6 +88,7 @@ The following extra options exists:
* **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.
* **data**: Passed data to the next execution of the script via **ROFI_DATA**.
## Parsing row options
@ -137,7 +142,7 @@ Qball Cow <qball@gmpclient.org>
Rasmus Steinke <rasi@xssn.at>
Quentin Glidic <sardemff7+rofi@sardemff7.net>
Morgane Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com>

View file

@ -1,17 +1,18 @@
.TH rofi\-sensible\-terminal 1 rofi\-sensible\-terminal
.nh
.TH rofi-sensible-terminal 1 rofi-sensible-terminal
.SH NAME
.PP
\fBrofi\-sensible\-terminal\fP \- launches $TERMINAL with fallbacks
\fBrofi-sensible-terminal\fP - launches $TERMINAL with fallbacks
.SH SYNOPSIS
.PP
rofi\-sensible\-terminal [arguments]
rofi-sensible-terminal [arguments]
.SH DESCRIPTION
.PP
rofi\-sensible\-terminal is invoked in the rofi default config to start a terminal. This
wrapper script is necessary since there is no distribution\-independent terminal launcher
(but for example Debian has x\-terminal\-emulator). Distribution packagers are responsible for
rofi-sensible-terminal is invoked in the rofi default config to start a terminal. This
wrapper script is necessary since there is no distribution-independent terminal launcher
(but for example Debian has x-terminal-emulator). Distribution packagers are responsible for
shipping this script in a way which is appropriate for the distribution.
.PP
@ -19,9 +20,9 @@ It tries to start one of the following (in that order):
.RS
.IP \(bu 2
\fB\fC$TERMINAL\fR (this is a non\-standard variable)
\fB\fC$TERMINAL\fR (this is a non-standard variable)
.IP \(bu 2
x\-terminal\-emulator
x-terminal-emulator
.IP \(bu 2
urxvt
.IP \(bu 2
@ -43,9 +44,9 @@ xterm
.IP \(bu 2
roxterm
.IP \(bu 2
xfce4\-terminal.wrapper
xfce4-terminal.wrapper
.IP \(bu 2
mate\-terminal
mate-terminal
.IP \(bu 2
lxterminal
.IP \(bu 2

View file

@ -1,38 +1,39 @@
.TH rofi\-theme\-selector 1 rofi\-theme\-selector
.nh
.TH rofi-theme-selector 1 rofi-theme-selector
.SH NAME
.PP
\fBrofi\-theme\-selector\fP \- Preview and apply themes for \fBrofi\fP
\fBrofi-theme-selector\fP - Preview and apply themes for \fBrofi\fP
.SH DESCRIPTION
.PP
\fBrofi\-theme\-selector\fP is a bash/rofi script to preview and apply themes for \fBrofi\fP\&.
\fBrofi-theme-selector\fP is a bash/rofi script to preview and apply themes for \fBrofi\fP\&.
It's part of any installation of \fBrofi\fP\&.
.SH USAGE
.SS Running rofi\-theme\-selector
.SS Running rofi-theme-selector
.PP
\fBrofi\-theme\-selector\fP shows a list of all available themes in a \fBrofi\fP window.
\fBrofi-theme-selector\fP shows a list of all available themes in a \fBrofi\fP window.
It lets you preview each theme with the Enter key and apply the theme to your
\fBrofi\fP configuration file with Alt+a.
.SH Theme directories
.PP
\fBrofi\-theme\-selector\fP searches the following directories for themes:
\fBrofi-theme-selector\fP searches the following directories for themes:
.RS
.IP \(bu 2
${PREFIX}/share/rofi/themes
.IP \(bu 2
$XDG\_CONFIG\_HOME/rofi/themes
$XDG_CONFIG_HOME/rofi/themes
.IP \(bu 2
$XDG\_DATA\_HOME/share/rofi/themes
$XDG_DATA_HOME/share/rofi/themes
.RE
.PP
${PREFIX} reflects the install location of rofi. In most cases this will be "/usr".<br>
$XDG\_CONFIG\_HOME is normally unset. Default path is "$HOME/.config".<br>
$XDG\_DATA\_HOME is normally unset. Default path is "$HOME/.local/share".
${PREFIX} reflects the install location of rofi. In most cases this will be "/usr".
$XDG_CONFIG_HOME is normally unset. Default path is "$HOME/.config".
$XDG_DATA_HOME is normally unset. Default path is "$HOME/.local/share".
.SH SEE ALSO
.PP
@ -40,5 +41,5 @@ rofi(1)
.SH AUTHORS
.PP
Qball Cow qball@gmpclient.org<br>
Qball Cow qball@gmpclient.org
Rasmus Steinke rasi@xssn.at

File diff suppressed because it is too large Load diff

View file

@ -4,19 +4,153 @@
**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:
```css
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:
```css
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:
```css
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:
```css
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.
```css
element-icon {
size: 2.5em;
}
```
```
┌─────────────────────────────────────────────────────────────────────┐
│ element │
│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │
│ │element─text │ │ element │ │
│ │ │ │ ─ │ │
│ │ │ │ icon │ │
│ └─────────────────────────────────────────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
```
In this example we specify the size in the [em](https://www.w3.org/Style/LieBos3e/em) unit.
Now lets change the text color of both the `entry` and the `element-text` widget to red and background to blue.
```css
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:
```css
element-icon {
vertical-align: 0.5;
}
```
```
┌─────────────────────────────────────────────────────────────────────┐
│ element │
│ ┌─────────────────────────────────────────────┐ ┌─────────────────┐ │
│ │ │ │ element │ │
│ │element-text │ │ ─ │ │
│ │ │ │ icon │ │
│ └─────────────────────────────────────────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
```
If you want to see the complete theme, including the modification you can run:
```bash
rofi -dump-theme
```
## DEFAULT THEME LOADING
By default, rofi loads the default theme. This theme is **always** loaded.
In the default (always loaded) configuration it does:
The default configuration contains:
```css
@theme "default"
```
To unload the default theme, and load another theme, add `@theme` to your
`config.rasi` file.
To unload the default theme, and load another theme, add the `@theme` statement
to your `config.rasi` file.
If you have a theme loaded by `@theme` or use the default theme, you can tweak
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
@ -39,7 +173,7 @@ user-friendly way. Therefore, a new file format has been created, replacing the
## Encoding
The encoding of the file is utf-8. Both unix (`\n`) and windows (`\r\n`) newlines format are supported. But unix is
The encoding of the file is UTF-8. Both unix (`\n`) and windows (`\r\n`) newlines format are supported. But unix is
preferred.
## Comments
@ -47,7 +181,7 @@ preferred.
C and C++ file comments are supported.
* Anything after `// ` and before a newline is considered a comment.
* Everything between `/*` and `*/` is 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.
@ -91,7 +225,7 @@ 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 `#`.
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.
@ -131,8 +265,8 @@ 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 `,`.
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:
@ -153,8 +287,8 @@ element normal normal, button {
}
```
Each section inherits the global properties. Properties can be explicitly inherited from their parent with the
`inherit` keyword.
Each section inherits the global properties. Properties can be explicitly
inherited from their parent with the `inherit` keyword.
In the following example:
```css
@ -170,7 +304,8 @@ mainbox {
}
```
The element `mainbox` will have the following set of properties (if `mainbox` is a child of `window`):
The element `mainbox` will have the following set of properties (if `mainbox`
is a child of `window`):
```css
a: 1;
@ -234,7 +369,15 @@ For example:
font: "Awasome 12";
```
The string must be valid UTF-8.
The string must be valid UTF-8, special characters can be escaped:
```css
text {
content: "Line one\n\tIndented line two";
}
```
The following special characters can be escaped: `\b`, `\f`, `\n`, `\r`, `\t`, `\v`, `\` and `"`.
## Integer
@ -401,17 +544,21 @@ Rofi supports some maths in calculating sizes. For this it uses the CSS syntax:
width: calc( 100% - 37px );
```
```css
width: calc( 20% min 512 );
```
It supports the following operations:
* `+` : Add
* `-` : Subtract
* `/` : Divide
* `*` : Multiply
* `%` : Multiply
* `min` : Minimum of l or rvalue;
* `max` : Maximum of l or rvalue;
* `+` : 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
* `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.
@ -456,24 +603,28 @@ style property.
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)`
```
north west | north | north east
-------------|-------------|------------
west | center | east
-------------|-------------|------------
south west | south | south east
```
## Visibility
It is possible to hide widgets:
```css
inputbar {
enabled: false;
}
```
## Reference
@ -693,22 +844,22 @@ The following properties are currently supported:
### all widgets:
* **enabled**: enable/disable the widget
* **padding**: padding
* **enabled**: enable/disable rendering of the widget
* **padding**: padding
Padding on the inside of the widget
* **margin**: padding
* **margin**: padding
Margin on the outside of the widget
* **border**: border
* **border**: border
Border around the widget (between padding and margin)/
* **border-radius**: padding
* **border-radius**: padding
Sets a radius on the corners of the borders.
* **background-color**: color
* **background-color**: color
Background color
* **background-image**: image
* **background-image**: image
Background image
* **border-color**: color
Color of the border
* **cursor**: cursor
* **cursor**: cursor
Type of mouse cursor that is set when the mouse pointer is hovered over the widget.
### window:
@ -731,8 +882,8 @@ The following properties are currently supported:
Window is fullscreen.
* **width**: distance
The width of the window
* **x-offset**: distance
* **y-offset**: distance
* **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
@ -747,7 +898,7 @@ The following properties are currently supported:
* **orientation**: orientation
Set the direction the elements are packed.
* **spacing**: distance
* **spacing**: distance
Distance between the packed elements.
### textbox:
@ -755,7 +906,7 @@ The following properties are currently supported:
* **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).
* **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.
@ -794,6 +945,8 @@ The following properties are currently supported:
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.
@ -836,42 +989,42 @@ The box can be vertical or horizontal. This is loosely inspired by [GTK](http://
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 | | | |
| | | |---------------| |---------------| |--------------| |---------------| | | |
| | |---------------------------------------------------------------------------| | |
| |-------------------------------------------------------------------------------| |
|------------------------------------------------------------------------------------|
┌────────────────────────────────────────────────────────────────────────────────────┐
│ 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 │ │ │ │
│ │ │ └───────────────┘ └───────────────┘ └──────────────┘ └───────────────┘ │ │ │
│ │ └───────────────────────────────────────────────────────────────────────────┘ │ │
│ └───────────────────────────────────────────────────────────────────────────────┘ │
└────────────────────────────────────────────────────────────────────────────────────┘
```
@ -882,16 +1035,15 @@ The current layout of **rofi** is structured as follows:
### Error message structure
```
|-----------------------------------------------------------------------------------|
| window {BOX:vertical} |
| |------------------------------------------------------------------------------| |
| | error-message {BOX:vertical} | |
| | |-------------------------------------------------------------------------| | |
| | | textbox | | |
| | |-------------------------------------------------------------------------| | |
| |------------------------------------------------------------------------------| |
|-----------------------------------------------------------------------------------|
┌──────────────────────────────────────────────────────────────────────────────────┐
│ window {BOX:vertical} │
│ ┌─────────────────────────────────────────────────────────────────────────────┐ │
│ │ error─message {BOX:vertical} │ │
│ │ ┌────────────────────────────────────────────────────────────────────────┐ │ │
│ │ │ textbox │ │ │
│ │ └────────────────────────────────────────────────────────────────────────┘ │ │
│ └─────────────────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────────────┘
```
@ -1035,18 +1187,18 @@ element selected {
Just like CSS, **rofi** uses the box model for each widget.
```
|-------------------------------------------------------------------|
| margin |
| |-------------------------------------------------------------| |
| | border | |
| | |---------------------------------------------------------| | |
| | | padding | | |
| | | |-----------------------------------------------------| | | |
| | | | content | | | |
| | | |-----------------------------------------------------| | | |
| | |---------------------------------------------------------| | |
| |-------------------------------------------------------------| |
|-------------------------------------------------------------------|
┌──────────────────────────────────────────────────────────────────┐
│ margin │
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ border │ │
│ │ ┌────────────────────────────────────────────────────────┐ │ │
│ │ │ padding │ │ │
│ │ │ ┌────────────────────────────────────────────────────┐ │ │ │
│ │ │ │ content │ │ │ │
│ │ │ └────────────────────────────────────────────────────┘ │ │ │
│ │ └────────────────────────────────────────────────────────┘ │ │
│ └────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────┘
```
Explanation of the different parts:
@ -1070,15 +1222,15 @@ Widgets that can pack more then one child widget (currently box and listview) ha
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 |-------| |
|---------------------------------------|
┌───────────────────────────────────────┐
│ ┌────────┐ s ┌────────┐ s ┌────────┐ │
│ │ child │ p │ child │ p │ child │ │
│ │ │ a │ │ a │ │ │
│ │ │ c │ │ c │ │ │
│ │ │ i │ │ i │ │ │
│ │ │ n │ │ n │ │ │
│ └────────┘ g └────────┘ g └────────┘ │
└───────────────────────────────────────┘
```
### Advanced box packing
@ -1086,15 +1238,15 @@ This property sets the distance between the packed widgets (both horizontally an
More dynamic spacing can be achieved by adding dummy widgets, for example to make one widget centered:
```
|----------------------------------------------------|
| |---------------| |--------| |---------------| |
| | dummy | | child | | dummy | |
| | expand: true; | | | | expand: true; | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| |---------------| |--------| |---------------| |
|----------------------------------------------------|
┌────────────────────────────────────────────────────┐
│ ┌───────────────┐ ┌────────┐ ┌───────────────┐ │
│ │ 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

File diff suppressed because it is too large Load diff

View file

@ -18,19 +18,33 @@ 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** 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.
**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 `run` dialog:
To show the `drun` dialog:
```bash
rofi -show drun
```
A very useful setup in minimalistic window managers is to combine `drun`, `run`
with `window` mode:
```bash
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.
rofi -show run
### Emulating dmenu
@ -60,6 +74,29 @@ 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:
```css
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:
```css
configuration {
dpi: 72;
}
```
The configuration system supports the following types:
* string
@ -131,6 +168,8 @@ 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`.
@ -141,16 +180,16 @@ To show the run-dialog:
rofi -show run
If `-show` is the last option passed to rofi, the first enabled modi is shown.
If `-show` is the last option passed to rofi, the first enabled modes is shown.
`-modi` *mode1,mode2*
`-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 -modi "run,ssh" -show run
rofi -modes "run,ssh" -show run
Custom modes can be added using the internal `script` mode. Each such mode has two parameters:
@ -158,14 +197,14 @@ Custom modes can be added using the internal `script` mode. Each such mode has t
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
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 -modi "My File Browser:fb.sh" -show "My File Browser"
rofi -modes "My File Browser:fb.sh" -show "My File Browser"
`-case-sensitive`
@ -347,7 +386,7 @@ 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)
(See `-modes` option)
To show sidebar, use:
rofi -show run -sidebar-mode
@ -533,13 +572,13 @@ configuration {
### Combi settings
`-combi-modi` *mode1*,*mode2*
`-combi-modes ` *mode1*,*mode2*
The modi to combine in combi mode.
For syntax to `-combi-modi`, see `-modi`.
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-modi "window,run,ssh" -modi combi
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.
@ -674,54 +713,10 @@ Please see **rofi-theme(5)** manpage for more information on theming.
## KEY BINDINGS
**rofi** has the following key bindings:
Please see the **rofi-keys(5)** manpage for the keybindings and how to set them up.
* `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:
The keybinding can also be used for actions, when the action is executed the
mentioned keystroke is inserted:
### Timeout
@ -750,9 +745,7 @@ configuration {
}
```
For a full list of bindings, see the **rofi-keys(5)** manpage.
## Available Modi
## Available Modes
### window
@ -825,19 +818,19 @@ Shows a searchable list of key bindings.
### script
Allows custom scripted Modi to be added, see the **rofi-script(5)** manpage for more information.
Allows custom scripted Modes 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.
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 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
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`
modi are shown, even if the rest of the input text would match results from `run`.
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 modi.
If no match, the input is handled by the first combined modes.
## FAQ
@ -873,19 +866,19 @@ Some basic usage examples of **rofi**:
Show the run dialog:
rofi -modi run -show run
rofi -modes run -show run
Show the run dialog, and allow switching to Desktop File run dialog (`drun`):
rofi -modi run,drun -show run
rofi -modes run,drun -show run
Combine the run and Desktop File run dialog (`drun`):
rofi -modi combi -show combi -combi-modi run,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 -modi combi,window -show combi -combi-modi run,drun
rofi -modes combi,window -show combi -combi-modes run,drun
Pop up a text message claiming that this is the end:
@ -899,10 +892,6 @@ 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](http://i3wm.org/) you want to bind **rofi** to be launched on key release. Otherwise, it cannot grab the keyboard.
@ -948,44 +937,7 @@ been released.
## 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](https://github.com/DaveDavenport/rofi/wiki/Debugging%20Rofi) wiki entry.
For more information see **rofi-debugging(5)** manpage.
## ISSUE TRACKER
@ -996,13 +948,13 @@ first.
## SEE ALSO
**rofi-sensible-terminal(1)**, **dmenu(1)**, **rofi-theme(5)**, **rofi-script(5)**, **rofi-keys(5)**,**rofi-theme-selector(1)**
**rofi-sensible-terminal(1)**, **dmenu(1)**, **rofi-debugging(5)**, **rofi-theme(5)**, **rofi-script(5)**, **rofi-keys(5)**,**rofi-theme-selector(1)**
## AUTHOR
* Qball Cow <qball@blame.services>
* Rasmus Steinke <rasi@xssn.at>
* Quentin Glidic <sardemff7+rofi@sardemff7.net>
* Morgane Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: [Sean Pringle](https://github.com/seanpringle/simpleswitcher) <sean.pringle@gmail.com>

View file

@ -1,276 +0,0 @@
! "Enabled modi" Set from: File
rofi.modi: combi,drun
! "Window width" Set from: File
rofi.width: 50
! "Number of lines" Set from: File
rofi.lines: 8
! "Number of columns" Set from: File
rofi.columns: 1
! "Font to use" Set from: File
rofi.font: Source Code Pro Medium 10
! "Border width" Set from: Default
! rofi.bw: 1
! "Location on screen" Set from: File
rofi.location: 2
! "Padding" Set from: Default
! rofi.padding: 5
! "Y-offset relative to location" Set from: File
rofi.yoffset: -2
! "X-offset relative to location" Set from: File
rofi.xoffset: 0
! "Always show number of lines" Set from: File
rofi.fixed-num-lines: true
! "Whether to load and show icons" Set from: Default
! rofi.show-icons: false
! "Terminal to use" Set from: File
rofi.terminal: sakura
! "Ssh client to use" Set from: File
rofi.ssh-client: ssh
! "Ssh command to execute" Set from: File
rofi.ssh-command: {terminal} -e {ssh-client} {host}
! "Run command to execute" Set from: File
rofi.run-command: bash -c "{cmd}"
! "Command to get extra run targets" Set from: Default
! rofi.run-list-command:
! "Run command to execute that runs in shell" Set from: File
rofi.run-shell-command: {terminal} -e {cmd}
! "Command executed on accep-entry-custom for window modus" Set from: File
rofi.window-command: xkill -id {window}
! "Window fields to match in window mode" Set from: Default
! rofi.window-match-fields: all
! "Theme to use to look for icons" Set from: Default
! rofi.icon-theme:
! "Desktop entry fields to match in drun" Set from: Default
! rofi.drun-match-fields: name,generic,exec,categories,keywords
! "Only show Desktop entry from these categories" Set from: Default
! rofi.drun-categories:
! "Desktop entry show actions." Set from: Default
! rofi.drun-show-actions: false
! "DRUN format string. (Supports: generic,name,comment,exec,categories)" Set from: Default
! rofi.drun-display-format: {name} [<span weight='light' size='small'><i>({generic})</i></span>]
! "Disable history in run/ssh" Set from: File
rofi.disable-history: false
! "Programs ignored for history" Set from: Default
! rofi.ignored-prefixes:
! "Use sorting" Set from: Default
! rofi.sort: false
! "Choose the strategy used for sorting: normal (levenshtein) or fzf." Set from: Default
! rofi.sorting-method:
! "Set case-sensitivity" Set from: File
rofi.case-sensitive: false
! "Cycle through the results list" Set from: File
rofi.cycle: true
! "Enable sidebar-mode" Set from: File
rofi.sidebar-mode: false
! "Row height (in chars)" Set from: File
rofi.eh: 1
! "Enable auto select mode" Set from: File
rofi.auto-select: false
! "Parse hosts file for ssh mode" Set from: File
rofi.parse-hosts: false
! "Parse known_hosts file for ssh mode" Set from: File
rofi.parse-known-hosts: true
! "Set the modi to combine in combi mode" Set from: File
rofi.combi-modi: window,drun,run,ssh
! "Set the matching algorithm. (normal, regex, glob, fuzzy, prefix)" Set from: Default
! rofi.matching: normal
! "Tokenize input string" Set from: File
rofi.tokenize: true
! "Monitor id to show on" Set from: File
rofi.m: -1
! "Margin between rows *DEPRECATED*" Set from: Default
! rofi.line-margin: 2
! "Padding within rows *DEPRECATED*" Set from: Default
! rofi.line-padding: 1
! "Pre-set filter" Set from: Default
! rofi.filter:
! "Separator style (none, dash, solid) *DEPRECATED*" Set from: Default
! rofi.separator-style: dash
! "Hide scroll-bar *DEPRECATED*" Set from: Default
! rofi.hide-scrollbar: false
! "Fullscreen" Set from: File
rofi.fullscreen: false
! "Fake transparency *DEPRECATED*" Set from: Default
! rofi.fake-transparency: false
! "DPI" Set from: File
rofi.dpi: 101
! "Threads to use for string matching" Set from: File
rofi.threads: 8
! "Scrollbar width *DEPRECATED*" Set from: Default
! rofi.scrollbar-width: 8
! "Scrolling method. (0: Page, 1: Centered)" Set from: File
rofi.scroll-method: 0
! "Background to use for fake transparency. (background or screenshot) *DEPRECATED*" Set from: Default
! rofi.fake-background: screenshot
! "Window Format. w (desktop name), t (title), n (name), r (role), c (class)" Set from: Default
! rofi.window-format: {w} {c} {t}
! "Click outside the window to exit" Set from: Default
! rofi.click-to-exit: true
! "New style theme file" Set from: Default
! rofi.theme:
! "Color scheme for normal row" Set from: Default
! rofi.color-normal:
! "Color scheme for urgent row" Set from: Default
! rofi.color-urgent:
! "Color scheme for active row" Set from: Default
! rofi.color-active:
! "Color scheme window" Set from: Default
! rofi.color-window:
! "Max history size (WARNING: can cause slowdowns when set too high)." Set from: Default
! rofi.max-history-size: 25
! "Hide the prefix mode prefix on the combi view." Set from: Default
! rofi.combi-hide-mode-prefix: false
! "Combi format string. (Supports: mode, text)" Set from: Default
! rofi.combi-display-format: {mode} {text}
! "Set the character used to negate the matching. ('\0' to disable)" Set from: Default
! rofi.matching-negate-char: -
! "Directory where history and temporary files are stored." Set from: Default
! rofi.cache-dir:
! "Show window thumbnail in window switcher if availalbe." Set from: Default
! rofi.window-thumbnail: false
! "Pidfile location" Set from: File
rofi.pid: /tmp/rofi.pid
! "Paste primary selection" Set from: File
rofi.kb-primary-paste: Control+Shift+v,Shift+Insert
! "Paste clipboard" Set from: File
rofi.kb-secondary-paste: Control+v,Insert
! "Clear input line" Set from: File
rofi.kb-clear-line: Control+w
! "Beginning of line" Set from: File
rofi.kb-move-front: Control+a
! "End of line" Set from: File
rofi.kb-move-end: Control+e
! "Move back one word" Set from: File
rofi.kb-move-word-back: Alt+b,Ctrl+Left
! "Move forward one word" Set from: File
rofi.kb-move-word-forward: Alt+f,Ctrl+Right
! "Move back one char" Set from: File
rofi.kb-move-char-back: Left,Control+b
! "Move forward one char" Set from: File
rofi.kb-move-char-forward: Right,Control+f
! "Delete previous word" Set from: File
rofi.kb-remove-word-back: Control+Alt+h,Control+BackSpace
! "Delete next word" Set from: File
rofi.kb-remove-word-forward: Control+Alt+d
! "Delete next char" Set from: File
rofi.kb-remove-char-forward: Delete,Control+d
! "Delete previous char" Set from: File
rofi.kb-remove-char-back: BackSpace,Shift+BackSpace,Control+h
! "Delete till the end of line" Set from: File
rofi.kb-remove-to-eol: Control+k
! "Delete till the start of line" Set from: File
rofi.kb-remove-to-sol: Control+u
! "Accept entry" Set from: File
rofi.kb-accept-entry: Control+j,Control+m,Return,KP_Enter
! "Use entered text as command (in ssh/run modi)" Set from: File
rofi.kb-accept-custom: Control+Return
! "Use alternate accept command." Set from: File
rofi.kb-accept-alt: Shift+Return
! "Delete entry from history" Set from: File
rofi.kb-delete-entry: Shift+Delete
! "Switch to the next mode." Set from: File
rofi.kb-mode-next: Shift+Right,Control+Tab
! "Switch to the previous mode." Set from: File
rofi.kb-mode-previous: Shift+Left,Control+ISO_Left_Tab
! "Go to the previous column" Set from: File
rofi.kb-row-left: Control+Page_Up
! "Go to the next column" Set from: File
rofi.kb-row-right: Control+Page_Down
! "Select previous entry" Set from: File
rofi.kb-row-up: Up,Control+p,ISO_Left_Tab
! "Select next entry" Set from: File
rofi.kb-row-down: Down,Control+n
! "Go to next row, if one left, accept it, if no left next mode." Set from: File
rofi.kb-row-tab: Tab
! "Go to the previous page" Set from: File
rofi.kb-page-prev: Page_Up
! "Go to the next page" Set from: File
rofi.kb-page-next: Page_Down
! "Go to the first entry" Set from: File
rofi.kb-row-first: Home,KP_Home
! "Go to the last entry" Set from: File
rofi.kb-row-last: End,KP_End
! "Set selected item as input text" Set from: File
rofi.kb-row-select: Control+space
! "Take a screenshot of the rofi window" Set from: File
rofi.kb-screenshot: Alt+S
! "Toggle between ellipsize modes for displayed data" Set from: Default
! rofi.kb-ellipsize: Alt+period
! "Toggle case sensitivity" Set from: File
rofi.kb-toggle-case-sensitivity: grave,dead_grave
! "Toggle sort" Set from: File
rofi.kb-toggle-sort: Alt+grave
! "Quit rofi" Set from: File
rofi.kb-cancel: Escape,Control+bracketleft
! "Custom keybinding 1" Set from: File
rofi.kb-custom-1: Alt+1
! "Custom keybinding 2" Set from: File
rofi.kb-custom-2: Alt+2
! "Custom keybinding 3" Set from: File
rofi.kb-custom-3: Alt+3
! "Custom keybinding 4" Set from: File
rofi.kb-custom-4: Alt+4
! "Custom Keybinding 5" Set from: File
rofi.kb-custom-5: Alt+5
! "Custom keybinding 6" Set from: File
rofi.kb-custom-6: Alt+6
! "Custom Keybinding 7" Set from: File
rofi.kb-custom-7: Alt+7
! "Custom keybinding 8" Set from: File
rofi.kb-custom-8: Alt+8
! "Custom keybinding 9" Set from: File
rofi.kb-custom-9: Alt+9
! "Custom keybinding 10" Set from: File
rofi.kb-custom-10: Alt+0
! "Custom keybinding 11" Set from: File
rofi.kb-custom-11: Alt+Shift+1
! "Custom keybinding 12" Set from: File
rofi.kb-custom-12: Alt+at
! "Custom keybinding 13" Set from: File
rofi.kb-custom-13: Alt+numbersign
! "Custom keybinding 14" Set from: File
rofi.kb-custom-14: Alt+dollar
! "Custom keybinding 15" Set from: File
rofi.kb-custom-15: Alt+percent
! "Custom keybinding 16" Set from: File
rofi.kb-custom-16: Alt+dead_circumflex
! "Custom keybinding 17" Set from: File
rofi.kb-custom-17: Alt+ampersand
! "Custom keybinding 18" Set from: File
rofi.kb-custom-18: Alt+asterisk
! "Custom Keybinding 19" Set from: File
rofi.kb-custom-19: Alt+parenleft
! "Select row 1" Set from: Default
! rofi.kb-select-1: Super+1
! "Select row 2" Set from: Default
! rofi.kb-select-2: Super+2
! "Select row 3" Set from: Default
! rofi.kb-select-3: Super+3
! "Select row 4" Set from: Default
! rofi.kb-select-4: Super+4
! "Select row 5" Set from: Default
! rofi.kb-select-5: Super+5
! "Select row 6" Set from: Default
! rofi.kb-select-6: Super+6
! "Select row 7" Set from: Default
! rofi.kb-select-7: Super+7
! "Select row 8" Set from: Default
! rofi.kb-select-8: Super+8
! "Select row 9" Set from: Default
! rofi.kb-select-9: Super+9
! "Select row 10" Set from: Default
! rofi.kb-select-10: Super+0
! "Go to the previous column" Set from: Default
! rofi.ml-row-left: ScrollLeft
! "Go to the next column" Set from: Default
! rofi.ml-row-right: ScrollRight
! "Select previous entry" Set from: Default
! rofi.ml-row-up: ScrollUp
! "Select next entry" Set from: Default
! rofi.ml-row-down: ScrollDown
! "Select hovered row" Set from: Default
! rofi.me-select-entry: MousePrimary
! "Accept hovered row" Set from: Default
! rofi.me-accept-entry: MouseDPrimary
! "Accept hovered row with custom action" Set from: Default
! rofi.me-accept-custom: Control+MouseDPrimary

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -149,11 +149,11 @@ int execute_generator(const char *cmd) __attribute__((nonnull));
/**
* @param pidfile The pidfile to create.
* @param kill Try killing running instance.
* @param kill_running Try killing running instance.
*
* returns file descriptor (or -1 when failed)
*/
int create_pid_file(const char *pidfile, gboolean kill);
int create_pid_file(const char *pidfile, gboolean kill_running);
/**
* Remove pid file

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -101,6 +101,8 @@ typedef enum {
ROW_UP,
ROW_DOWN,
ROW_TAB,
ELEMENT_NEXT,
ELEMENT_PREV,
PAGE_PREV,
PAGE_NEXT,
ROW_FIRST,

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -27,6 +27,7 @@
#ifndef ROFI_MODE_PRIVATE_H
#define ROFI_MODE_PRIVATE_H
#include "mode.h"
#include <gmodule.h>
G_BEGIN_DECLS

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -25,8 +25,8 @@
*
*/
#ifndef ROFI_DIALOG_COMBI_H
#define ROFI_DIALOG_COMBI_H
#ifndef ROFI_MODE_COMBI_H
#define ROFI_MODE_COMBI_H
#include "mode.h"
/**
@ -36,7 +36,7 @@
* Dialog that can combine multiple #Mode into one view.
*
* This mode uses the following options from the #config object:
* * #Settings::combi_modi
* * #Settings::combi_modes
*
* It creates the following option:
* * Settings::display_combi
@ -48,4 +48,4 @@
extern Mode combi_mode;
/**@}*/
#endif // ROFI_DIALOG_COMBI_H
#endif // ROFI_MODE_COMBI_H

View file

@ -25,8 +25,8 @@
*
*/
#ifndef ROFI_DIALOG_DMENU_H
#define ROFI_DIALOG_DMENU_H
#ifndef ROFI_MODE_DMENU_H
#define ROFI_MODE_DMENU_H
/**
* @defgroup DMENU DMenu
@ -48,4 +48,4 @@ int dmenu_mode_dialog(void);
void print_dmenu_options(void);
/**@}*/
#endif // ROFI_DIALOG_DMENU_H
#endif // ROFI_MODE_DMENU_H

View file

@ -1,5 +1,5 @@
#ifndef ROFI_DIALOGS_DMENU_SCRIPT_SHARED_H
#define ROFI_DIALOGS_DMENU_SCRIPT_SHARED_H
#ifndef ROFI_MODES_DMENU_SCRIPT_SHARED_H
#define ROFI_MODES_DMENU_SCRIPT_SHARED_H
#include <glib.h>
#include <mode.h>
@ -32,4 +32,4 @@ typedef struct {
void dmenuscript_parse_entry_extras(G_GNUC_UNUSED Mode *sw,
DmenuScriptEntry *entry, char *buffer,
size_t length);
#endif // ROFI_DIALOGS_DMENU_SCRIPT_SHARED_H
#endif // ROFI_MODES_DMENU_SCRIPT_SHARED_H

View file

@ -25,9 +25,8 @@
*
*/
#ifndef ROFI_DIALOG_DRUN_H
#define ROFI_DIALOG_DRUN_H
#include "mode.h"
#ifndef ROFI_MODE_DRUN_H
#define ROFI_MODE_DRUN_H
#include "mode.h"
@ -41,4 +40,4 @@
extern Mode drun_mode;
#endif // ENABLE_DRUN
/**@}*/
#endif // ROFI_DIALOG_DRUN_H
#endif // ROFI_MODE_DRUN_H

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -25,8 +25,8 @@
*
*/
#ifndef ROFI_DIALOG_FILE_BROWSER_H
#define ROFI_DIALOG_FILE_BROWSER_H
#ifndef ROFI_MODE_FILE_BROWSER_H
#define ROFI_MODE_FILE_BROWSER_H
#include "mode.h"
/**
* @defgroup FileBrowserMode FileBrowser
@ -55,4 +55,4 @@ Mode *create_new_file_browser(void);
ModeMode file_browser_mode_completer(Mode *sw, int mretv, char **input,
unsigned int selected_line, char **path);
/**@}*/
#endif // ROFI_DIALOG_FILE_BROWSER_H
#endif // ROFI_MODE_FILE_BROWSER_H

View file

@ -25,9 +25,8 @@
*
*/
#ifndef ROFI_DIALOG_HELPKEYS_H
#define ROFI_DIALOG_HELPKEYS_H
#include "mode.h"
#ifndef ROFI_MODE_HELPKEYS_H
#define ROFI_MODE_HELPKEYS_H
#include "mode.h"
/**
@ -43,4 +42,4 @@
*/
extern Mode help_keys_mode;
/**@}*/
#endif // ROFI_DIALOG_HELPKEYS_H
#endif // ROFI_MODE_HELPKEYS_H

View file

@ -25,23 +25,23 @@
*
*/
#ifndef ROFI_DIALOGS_DIALOGS_H
#define ROFI_DIALOGS_DIALOGS_H
#ifndef ROFI_MODES_MODES_H
#define ROFI_MODES_MODES_H
/**
* @defgroup MODES Modes
*/
/**
* List of available dialogs.
* List of available modes.
*/
#include "dialogs/combi.h"
#include "dialogs/dmenu.h"
#include "dialogs/drun.h"
#include "dialogs/filebrowser.h"
#include "dialogs/help-keys.h"
#include "dialogs/run.h"
#include "dialogs/script.h"
#include "dialogs/ssh.h"
#include "dialogs/window.h"
#endif // ROFI_DIALOGS_DIALOGS_H
#include "modes/combi.h"
#include "modes/dmenu.h"
#include "modes/drun.h"
#include "modes/filebrowser.h"
#include "modes/help-keys.h"
#include "modes/run.h"
#include "modes/script.h"
#include "modes/ssh.h"
#include "modes/window.h"
#endif // ROFI_MODES_MODES_H

View file

@ -25,8 +25,9 @@
*
*/
#ifndef ROFI_DIALOG_RUN_H
#define ROFI_DIALOG_RUN_H
#ifndef ROFI_MODE_RUN_H
#define ROFI_MODE_RUN_H
#include "mode.h"
/**
@ -44,4 +45,4 @@
extern Mode run_mode;
/**@}*/
#endif // DIALOG_RUN_H
#endif // ROFI_MODE_RUN_H

View file

@ -25,9 +25,8 @@
*
*/
#ifndef ROFI_DIALOG_SCRIPT_H
#define ROFI_DIALOG_SCRIPT_H
#include "mode.h"
#ifndef ROFI_MODE_SCRIPT_H
#define ROFI_MODE_SCRIPT_H
#include "mode.h"
@ -48,12 +47,12 @@
Mode *script_mode_parse_setup(const char *str);
/**
* @param token The modi str to check
* @param token The modes str to check
*
* Check if token could be a valid script modi.
* Check if token could be a valid script modes.
*
* @returns true when valid.
*/
gboolean script_mode_is_valid(const char *token);
/**@}*/
#endif // ROFI_DIALOG_SCRIPT_H
#endif // ROFI_MODE_SCRIPT_H

View file

@ -25,8 +25,8 @@
*
*/
#ifndef ROFI_DIALOG_SSH_H
#define ROFI_DIALOG_SSH_H
#ifndef ROFI_MODE_SSH_H
#define ROFI_MODE_SSH_H
#include "mode.h"
/**
* @defgroup SSHMode SSH
@ -44,7 +44,7 @@
* @{
*/
/** #Mode object representing the ssh dialog. */
/** #Mode object representing the ssh mode. */
extern Mode ssh_mode;
/**@}*/
#endif // ROFI_DIALOG_SSH_H
#endif // ROFI_MODE_SSH_H

View file

@ -25,9 +25,8 @@
*
*/
#ifndef ROFI_DIALOG_WINDOW_H
#define ROFI_DIALOG_WINDOW_H
#include "mode.h"
#ifndef ROFI_MODE_WINDOW_H
#define ROFI_MODE_WINDOW_H
#include "mode.h"
@ -45,4 +44,4 @@ extern Mode window_mode_cd;
void window_client_handle_signal(xcb_window_t win, gboolean create);
#endif // WINDOW_MODE
/** @}*/
#endif // ROFI_DIALOG_WINDOW_H
#endif // ROFI_MODE_WINDOW_H

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -48,11 +48,11 @@
extern const char *cache_dir;
/**
* Get the number of enabled modi.
* Get the number of enabled modes.
*
* @returns the number of enabled modi.
* @returns the number of enabled modes.
*/
unsigned int rofi_get_num_enabled_modi(void);
unsigned int rofi_get_num_enabled_modes(void);
/**
* @param index The mode to return. (should be smaller then
@ -90,7 +90,7 @@ void rofi_quit_main_loop(void);
*
* @return returns Mode * when found, NULL if not.
*/
Mode *rofi_collect_modi_search(const char *name);
Mode *rofi_collect_modes_search(const char *name);
/** Reset terminal */
#define color_reset "\033[0m"
/** Set terminal text bold */

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -58,8 +58,8 @@ typedef enum {
* @ingroup CONFIGURATION
*/
typedef struct {
/** List of enabled modi */
char *modi;
/** List of enabled modes */
char *modes;
/** Font string (pango format) */
char *menu_font;
@ -124,7 +124,7 @@ typedef struct {
unsigned int cycle;
/** Height of an element in number of rows */
int element_height;
/** Sidebar mode, show the modi */
/** Sidebar mode, show the modes */
unsigned int sidebar_mode;
/** Mouse hover automatically selects */
gboolean hover_select;
@ -137,7 +137,7 @@ typedef struct {
/** Knonw_hosts file parsing */
unsigned int parse_known_hosts;
/** Combi Modes */
char *combi_modi;
char *combi_modes;
char *matching;
MatchingMethod matching_method;
unsigned int tokenize;

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -412,6 +412,11 @@ char *rofi_theme_parse_prepare_file(const char *file, const char *parent_file);
*/
void rofi_theme_parse_process_conditionals(void);
/**
* Process links.
*/
void rofi_theme_parse_process_links(void);
/**
* @param parent target theme tree
* @param child source theme three

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -99,12 +99,12 @@ struct RofiViewState {
/** Monitor #workarea the view is displayed on */
workarea mon;
/** #box holding the different modi buttons */
/** #box holding the different modes buttons */
box *sidebar_bar;
/** number of modi to display */
unsigned int num_modi;
/** Array of #textbox that act as buttons for switching modi */
textbox **modi;
/** number of modes to display */
unsigned int num_modes;
/** Array of #textbox that act as buttons for switching modes */
textbox **modes;
/** Total rows. */
textbox *tb_total_rows;

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -111,6 +111,21 @@ void listview_set_selected(listview *lv, unsigned int selected);
*/
unsigned int listview_get_selected(listview *lv);
/**
* @param lv The listview handle
*
* Move the selection next element.
* - Wrap around.
*/
void listview_nav_next(listview *lv);
/**
* @param lv The listview handle
*
* Move the selection previous element.
* - Wrap around.
*/
void listview_nav_prev(listview *lv);
/**
* @param lv The listview handle
*

View file

@ -62,7 +62,7 @@ typedef enum {
WIDGET_TYPE_EDITBOX = SCOPE_MOUSE_EDITBOX,
/** The listview scrollbar */
WIDGET_TYPE_SCROLLBAR = SCOPE_MOUSE_SCROLLBAR,
/** A widget allowing user to swithc between modi */
/** A widget allowing user to swithc between modes */
WIDGET_TYPE_MODE_SWITCHER = SCOPE_MOUSE_MODE_SWITCHER,
/** Text-only textbox */
WIDGET_TYPE_TEXTBOX_TEXT,

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -670,8 +670,8 @@ if ( queue == NULL ) {
BEGIN(GPOINTER_TO_INT(g_queue_pop_head ( queue )));
return T_PARENT_RIGHT;
}
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{S_T_PARENT_LEFT} { return T_PARENT_LEFT; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{S_T_PARENT_RIGHT} { return T_PARENT_RIGHT; }
<PROPERTIES_ARRAY,PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{S_T_PARENT_LEFT} { return T_PARENT_LEFT; }
<PROPERTIES,PROPERTIES_ARRAY,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{S_T_PARENT_RIGHT} { return T_PARENT_RIGHT; }
<PROPERTIES,PROPERTIES_ARRAY,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{COMMA} { return T_COMMA; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{LIST_OPEN} {
g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) );

View file

@ -659,13 +659,23 @@ t_property_element_list
p->value.s = $1;
$$ = g_list_append ( NULL, p);
}
| T_CALC {
Property *p = rofi_theme_property_create ( P_STRING );
p->value.s = g_strdup("calc");
$$ = g_list_append ( NULL, p);
}
| t_property_element_list T_COMMA t_property_element {
$$ = g_list_append ( $1, $3 );
}
| t_property_element_list T_COMMA T_ELEMENT {
Property *p = rofi_theme_property_create ( P_STRING );
p->value.s = $3;
$$ = g_list_append ( $1, p);
}
| t_property_element_list T_COMMA t_property_element {
$$ = g_list_append ( $1, $3 );
| t_property_element_list T_COMMA T_CALC {
Property *p = rofi_theme_property_create ( P_STRING );
p->value.s = g_strdup("calc");
$$ = g_list_append ( $1, p);
}
;

View file

@ -129,7 +129,9 @@ nk_options = [
nk = subproject('libnkutils', default_options: nk_options)
nk_subproject_options = nk.get_variable('nk_options')
foreach o : nk_options + nk_subproject_options
if not nk_options.contains(o) or not nk_subproject_options.contains(o)
if ( o.startswith('git-work-tree=') )
continue
elif not nk_options.contains(o) or not nk_subproject_options.contains(o)
error('You must not change libnkutils options @0@ != @1@'.format('|'.join(nk_options), '|'.join(nk_subproject_options)))
endif
endforeach
@ -157,7 +159,7 @@ flex = generator(find_program('flex'),
)
bison = generator(find_program('bison'),
output: [ '@BASENAME@.c', '@BASENAME@.h' ],
arguments: [ '--verbose', '-d', '@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@' ]
arguments: [ '--report=all', '--report-file=bison.log', '-Wall', '--verbose', '-d', '@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@' ]
)
rofi_sources = files(
@ -182,14 +184,14 @@ rofi_sources = files(
'source/widgets/scrollbar.c',
'source/xrmoptions.c',
'source/rofi-types.c',
'source/dialogs/run.c',
'source/dialogs/ssh.c',
'source/dialogs/drun.c',
'source/dialogs/dmenu.c',
'source/dialogs/combi.c',
'source/dialogs/script.c',
'source/dialogs/help-keys.c',
'source/dialogs/filebrowser.c',
'source/modes/run.c',
'source/modes/ssh.c',
'source/modes/drun.c',
'source/modes/dmenu.c',
'source/modes/combi.c',
'source/modes/script.c',
'source/modes/help-keys.c',
'source/modes/filebrowser.c',
'include/display.h',
'include/xcb.h',
'include/rofi.h',
@ -216,23 +218,23 @@ rofi_sources = files(
'include/widgets/listview.h',
'include/widgets/scrollbar.h',
'include/xrmoptions.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/dialogs.h',
'include/dialogs/help-keys.h',
'include/dialogs/filebrowser.h',
'include/dialogs/dmenuscriptshared.h',
'include/modes/ssh.h',
'include/modes/run.h',
'include/modes/drun.h',
'include/modes/dmenu.h',
'include/modes/combi.h',
'include/modes/script.h',
'include/modes/modes.h',
'include/modes/help-keys.h',
'include/modes/filebrowser.h',
'include/modes/dmenuscriptshared.h',
)
if xcb_enabled
rofi_sources += files(
'source/dialogs/window.c',
'source/modes/window.c',
'source/xcb/display.c',
'source/xcb/view.c',
'include/dialogs/window.h',
'include/modes/window.h',
'include/xcb-internal.h',
)
endif
@ -297,6 +299,7 @@ install_man(
'doc/rofi-sensible-terminal.1',
'doc/rofi-script.5',
'doc/rofi-theme.5',
'doc/rofi-debugging.5',
'doc/rofi-dmenu.5',
'doc/rofi-keys.5',
)
@ -517,7 +520,7 @@ if check.found()
],
objects: rofi.extract_objects([
'config/config.c',
'source/dialogs/help-keys.c',
'source/modes/help-keys.c',
'source/helper.c',
'source/theme.c',
'source/css-colors.c',

View file

@ -377,7 +377,7 @@ rofi -theme-str '@import "mytheme"' -show drun
Big thanks to:
* Quentin Glidic
* Morgane Glidic
* a1346054
* Ian C
* TonCherAmi

View file

@ -42,7 +42,7 @@ Special thanks goes to:
* Iggy
* RaZ0rr-Two
* Quentin Glidic
* Morgane Glidic
* Danny Colin
* Tuure Piitulainen

View file

@ -17,7 +17,7 @@ Big thanks to everybody reporting issues.
Special thanks goes to:
* Iggy
* Quentin Glidic
* Morgane Glidic
* Danny Colin
Apologies if I mistyped or missed anybody.

View file

@ -28,8 +28,8 @@ Big thanks to everybody reporting issues.
Special thanks goes to:
* Iggy
* Quentin Glidic
* Morgane Glidic
* Danny Colin
* Jakub Jiruta
* Jakub Jirutka
Apologies if I mistyped or missed anybody.

View file

@ -3,7 +3,7 @@
*
* MIT/X11 License
* Copyright © 2012 Sean Pringle <sean.pringle@gmail.com>
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -1062,7 +1062,7 @@ char *helper_get_theme_path(const char *file, const char *ext) {
const char *cpath = g_get_user_config_dir();
if (cpath) {
char *themep = g_build_filename(cpath, "rofi", "themes", filename, NULL);
g_debug("Opening theme, testing: %s\n", themep);
g_debug("Opening theme, testing: %s", themep);
if (themep && g_file_test(themep, G_FILE_TEST_EXISTS)) {
g_free(filename);
return themep;
@ -1072,7 +1072,7 @@ char *helper_get_theme_path(const char *file, const char *ext) {
// Check config directory.
if (cpath) {
char *themep = g_build_filename(cpath, "rofi", filename, NULL);
g_debug("Opening theme, testing: %s\n", themep);
g_debug("Opening theme, testing: %s", themep);
if (g_file_test(themep, G_FILE_TEST_EXISTS)) {
g_free(filename);
return themep;
@ -1083,8 +1083,8 @@ char *helper_get_theme_path(const char *file, const char *ext) {
if (datadir) {
char *theme_path =
g_build_filename(datadir, "rofi", "themes", filename, NULL);
g_debug("Opening theme, testing: %s\n", theme_path);
if (theme_path) {
g_debug("Opening theme, testing: %s", theme_path);
if (g_file_test(theme_path, G_FILE_TEST_EXISTS)) {
g_free(filename);
return theme_path;
@ -1093,9 +1093,26 @@ char *helper_get_theme_path(const char *file, const char *ext) {
}
}
const gchar * const * system_data_dirs = g_get_system_data_dirs ();
if ( system_data_dirs ) {
for ( uint_fast32_t i = 0; system_data_dirs[i] != NULL; i++ ){
const char * const datadir = system_data_dirs[i];
g_debug("Opening theme directory: %s", datadir );
char *theme_path = g_build_filename(datadir, "rofi", "themes", filename, NULL);
if (theme_path) {
g_debug("Opening theme, testing: %s", theme_path);
if (g_file_test(theme_path, G_FILE_TEST_EXISTS)) {
g_free(filename);
return theme_path;
}
g_free(theme_path);
}
}
}
char *theme_path = g_build_filename(THEME_DIR, filename, NULL);
if (theme_path) {
g_debug("Opening theme, testing: %s\n", theme_path);
g_debug("Opening theme, testing: %s", theme_path);
if (g_file_test(theme_path, G_FILE_TEST_EXISTS)) {
g_free(filename);
return theme_path;

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -25,181 +25,426 @@
*
*/
#include "config.h"
#include <string.h>
#include "rofi.h"
#include <glib.h>
#include "nkutils-bindings.h"
#include "rofi.h"
#include "xrmoptions.h"
#include <string.h>
typedef struct
{
guint id;
guint scope;
char *name;
char *binding;
char *comment;
typedef struct {
guint id;
guint scope;
char *name;
char *binding;
char *comment;
} ActionBindingEntry;
/**
* Data structure holding all the action keybinding.
*/
ActionBindingEntry rofi_bindings[] =
{
{ .id = PASTE_PRIMARY, .name = "kb-primary-paste", .binding = "Control+V,Shift+Insert", .comment = "Paste primary selection" },
{ .id = PASTE_SECONDARY, .name = "kb-secondary-paste", .binding = "Control+v,Insert", .comment = "Paste clipboard" },
{ .id = CLEAR_LINE, .name = "kb-clear-line", .binding = "Control+w", .comment = "Clear input line" },
{ .id = MOVE_FRONT, .name = "kb-move-front", .binding = "Control+a", .comment = "Beginning of line" },
{ .id = MOVE_END, .name = "kb-move-end", .binding = "Control+e", .comment = "End of line" },
{ .id = MOVE_WORD_BACK, .name = "kb-move-word-back", .binding = "Alt+b,Control+Left", .comment = "Move back one word" },
{ .id = MOVE_WORD_FORWARD, .name = "kb-move-word-forward", .binding = "Alt+f,Control+Right", .comment = "Move forward one word" },
{ .id = MOVE_CHAR_BACK, .name = "kb-move-char-back", .binding = "Left,Control+b", .comment = "Move back one char" },
{ .id = MOVE_CHAR_FORWARD, .name = "kb-move-char-forward", .binding = "Right,Control+f", .comment = "Move forward one char" },
{ .id = REMOVE_WORD_BACK, .name = "kb-remove-word-back", .binding = "Control+Alt+h,Control+BackSpace", .comment = "Delete previous word" },
{ .id = REMOVE_WORD_FORWARD, .name = "kb-remove-word-forward", .binding = "Control+Alt+d", .comment = "Delete next word" },
{ .id = REMOVE_CHAR_FORWARD, .name = "kb-remove-char-forward", .binding = "Delete,Control+d", .comment = "Delete next char" },
{ .id = REMOVE_CHAR_BACK, .name = "kb-remove-char-back", .binding = "BackSpace,Shift+BackSpace,Control+h", .comment = "Delete previous char" },
{ .id = REMOVE_TO_EOL, .name = "kb-remove-to-eol", .binding = "Control+k", .comment = "Delete till the end of line" },
{ .id = REMOVE_TO_SOL, .name = "kb-remove-to-sol", .binding = "Control+u", .comment = "Delete till the start of line" },
{ .id = ACCEPT_ENTRY, .name = "kb-accept-entry", .binding = "Control+j,Control+m,Return,KP_Enter", .comment = "Accept entry" },
{ .id = ACCEPT_CUSTOM, .name = "kb-accept-custom", .binding = "Control+Return", .comment = "Use entered text as command (in ssh/run modi)" },
{ .id = ACCEPT_CUSTOM_ALT, .name = "kb-accept-custom-alt", .binding = "Control+Shift+Return", .comment = "Use entered text as command (in ssh/run modi)" },
{ .id = ACCEPT_ALT, .name = "kb-accept-alt", .binding = "Shift+Return", .comment = "Use alternate accept command." },
{ .id = DELETE_ENTRY, .name = "kb-delete-entry", .binding = "Shift+Delete", .comment = "Delete entry from history" },
{ .id = MODE_NEXT, .name = "kb-mode-next", .binding = "Shift+Right,Control+Tab", .comment = "Switch to the next mode." },
{ .id = MODE_PREVIOUS, .name = "kb-mode-previous", .binding = "Shift+Left,Control+ISO_Left_Tab", .comment = "Switch to the previous mode." },
{ .id = MODE_COMPLETE, .name = "kb-mode-complete", .binding = "Control+l", .comment = "Start completion for mode." },
{ .id = ROW_LEFT, .name = "kb-row-left", .binding = "Control+Page_Up", .comment = "Go to the previous column" },
{ .id = ROW_RIGHT, .name = "kb-row-right", .binding = "Control+Page_Down", .comment = "Go to the next column" },
{ .id = ROW_UP, .name = "kb-row-up", .binding = "Up,Control+p,ISO_Left_Tab", .comment = "Select previous entry" },
{ .id = ROW_DOWN, .name = "kb-row-down", .binding = "Down,Control+n", .comment = "Select next entry" },
{ .id = ROW_TAB, .name = "kb-row-tab", .binding = "Tab", .comment = "Go to next row, if one left, accept it, if no left next mode." },
{ .id = PAGE_PREV, .name = "kb-page-prev", .binding = "Page_Up", .comment = "Go to the previous page" },
{ .id = PAGE_NEXT, .name = "kb-page-next", .binding = "Page_Down", .comment = "Go to the next page" },
{ .id = ROW_FIRST, .name = "kb-row-first", .binding = "Home,KP_Home", .comment = "Go to the first entry" },
{ .id = ROW_LAST, .name = "kb-row-last", .binding = "End,KP_End", .comment = "Go to the last entry" },
{ .id = ROW_SELECT, .name = "kb-row-select", .binding = "Control+space", .comment = "Set selected item as input text" },
{ .id = SCREENSHOT, .name = "kb-screenshot", .binding = "Alt+S", .comment = "Take a screenshot of the rofi window" },
{ .id = CHANGE_ELLIPSIZE, .name = "kb-ellipsize", .binding = "Alt+period", .comment = "Toggle between ellipsize modes for displayed data" },
{ .id = TOGGLE_CASE_SENSITIVITY, .name = "kb-toggle-case-sensitivity", .binding = "grave,dead_grave", .comment = "Toggle case sensitivity" },
{ .id = TOGGLE_SORT, .name = "kb-toggle-sort", .binding = "Alt+grave", .comment = "Toggle sort" },
{ .id = CANCEL, .name = "kb-cancel", .binding = "Escape,Control+g,Control+bracketleft", .comment = "Quit rofi" },
{ .id = CUSTOM_1, .name = "kb-custom-1", .binding = "Alt+1", .comment = "Custom keybinding 1" },
{ .id = CUSTOM_2, .name = "kb-custom-2", .binding = "Alt+2", .comment = "Custom keybinding 2" },
{ .id = CUSTOM_3, .name = "kb-custom-3", .binding = "Alt+3", .comment = "Custom keybinding 3" },
{ .id = CUSTOM_4, .name = "kb-custom-4", .binding = "Alt+4", .comment = "Custom keybinding 4" },
{ .id = CUSTOM_5, .name = "kb-custom-5", .binding = "Alt+5", .comment = "Custom Keybinding 5" },
{ .id = CUSTOM_6, .name = "kb-custom-6", .binding = "Alt+6", .comment = "Custom keybinding 6" },
{ .id = CUSTOM_7, .name = "kb-custom-7", .binding = "Alt+7", .comment = "Custom Keybinding 7" },
{ .id = CUSTOM_8, .name = "kb-custom-8", .binding = "Alt+8", .comment = "Custom keybinding 8" },
{ .id = CUSTOM_9, .name = "kb-custom-9", .binding = "Alt+9", .comment = "Custom keybinding 9" },
{ .id = CUSTOM_10, .name = "kb-custom-10", .binding = "Alt+0", .comment = "Custom keybinding 10" },
{ .id = CUSTOM_11, .name = "kb-custom-11", .binding = "Alt+exclam", .comment = "Custom keybinding 11" },
{ .id = CUSTOM_12, .name = "kb-custom-12", .binding = "Alt+at", .comment = "Custom keybinding 12" },
{ .id = CUSTOM_13, .name = "kb-custom-13", .binding = "Alt+numbersign", .comment = "Custom keybinding 13" },
{ .id = CUSTOM_14, .name = "kb-custom-14", .binding = "Alt+dollar", .comment = "Custom keybinding 14" },
{ .id = CUSTOM_15, .name = "kb-custom-15", .binding = "Alt+percent", .comment = "Custom keybinding 15" },
{ .id = CUSTOM_16, .name = "kb-custom-16", .binding = "Alt+dead_circumflex", .comment = "Custom keybinding 16" },
{ .id = CUSTOM_17, .name = "kb-custom-17", .binding = "Alt+ampersand", .comment = "Custom keybinding 17" },
{ .id = CUSTOM_18, .name = "kb-custom-18", .binding = "Alt+asterisk", .comment = "Custom keybinding 18" },
{ .id = CUSTOM_19, .name = "kb-custom-19", .binding = "Alt+parenleft", .comment = "Custom Keybinding 19" },
{ .id = SELECT_ELEMENT_1, .name = "kb-select-1", .binding = "Super+1", .comment = "Select row 1" },
{ .id = SELECT_ELEMENT_2, .name = "kb-select-2", .binding = "Super+2", .comment = "Select row 2" },
{ .id = SELECT_ELEMENT_3, .name = "kb-select-3", .binding = "Super+3", .comment = "Select row 3" },
{ .id = SELECT_ELEMENT_4, .name = "kb-select-4", .binding = "Super+4", .comment = "Select row 4" },
{ .id = SELECT_ELEMENT_5, .name = "kb-select-5", .binding = "Super+5", .comment = "Select row 5" },
{ .id = SELECT_ELEMENT_6, .name = "kb-select-6", .binding = "Super+6", .comment = "Select row 6" },
{ .id = SELECT_ELEMENT_7, .name = "kb-select-7", .binding = "Super+7", .comment = "Select row 7" },
{ .id = SELECT_ELEMENT_8, .name = "kb-select-8", .binding = "Super+8", .comment = "Select row 8" },
{ .id = SELECT_ELEMENT_9, .name = "kb-select-9", .binding = "Super+9", .comment = "Select row 9" },
{ .id = SELECT_ELEMENT_10, .name = "kb-select-10", .binding = "Super+0", .comment = "Select row 10" },
ActionBindingEntry rofi_bindings[] = {
{.id = PASTE_PRIMARY,
.name = "kb-primary-paste",
.binding = "Control+V,Shift+Insert",
.comment = "Paste primary selection"},
{.id = PASTE_SECONDARY,
.name = "kb-secondary-paste",
.binding = "Control+v,Insert",
.comment = "Paste clipboard"},
{.id = CLEAR_LINE,
.name = "kb-clear-line",
.binding = "Control+w",
.comment = "Clear input line"},
{.id = MOVE_FRONT,
.name = "kb-move-front",
.binding = "Control+a",
.comment = "Beginning of line"},
{.id = MOVE_END,
.name = "kb-move-end",
.binding = "Control+e",
.comment = "End of line"},
{.id = MOVE_WORD_BACK,
.name = "kb-move-word-back",
.binding = "Alt+b,Control+Left",
.comment = "Move back one word"},
{.id = MOVE_WORD_FORWARD,
.name = "kb-move-word-forward",
.binding = "Alt+f,Control+Right",
.comment = "Move forward one word"},
{.id = MOVE_CHAR_BACK,
.name = "kb-move-char-back",
.binding = "Left,Control+b",
.comment = "Move back one char"},
{.id = MOVE_CHAR_FORWARD,
.name = "kb-move-char-forward",
.binding = "Right,Control+f",
.comment = "Move forward one char"},
{.id = REMOVE_WORD_BACK,
.name = "kb-remove-word-back",
.binding = "Control+Alt+h,Control+BackSpace",
.comment = "Delete previous word"},
{.id = REMOVE_WORD_FORWARD,
.name = "kb-remove-word-forward",
.binding = "Control+Alt+d",
.comment = "Delete next word"},
{.id = REMOVE_CHAR_FORWARD,
.name = "kb-remove-char-forward",
.binding = "Delete,Control+d",
.comment = "Delete next char"},
{.id = REMOVE_CHAR_BACK,
.name = "kb-remove-char-back",
.binding = "BackSpace,Shift+BackSpace,Control+h",
.comment = "Delete previous char"},
{.id = REMOVE_TO_EOL,
.name = "kb-remove-to-eol",
.binding = "Control+k",
.comment = "Delete till the end of line"},
{.id = REMOVE_TO_SOL,
.name = "kb-remove-to-sol",
.binding = "Control+u",
.comment = "Delete till the start of line"},
{.id = ACCEPT_ENTRY,
.name = "kb-accept-entry",
.binding = "Control+j,Control+m,Return,KP_Enter",
.comment = "Accept entry"},
{.id = ACCEPT_CUSTOM,
.name = "kb-accept-custom",
.binding = "Control+Return",
.comment = "Use entered text as command (in ssh/run modes)"},
{.id = ACCEPT_CUSTOM_ALT,
.name = "kb-accept-custom-alt",
.binding = "Control+Shift+Return",
.comment = "Use entered text as command (in ssh/run modes)"},
{.id = ACCEPT_ALT,
.name = "kb-accept-alt",
.binding = "Shift+Return",
.comment = "Use alternate accept command."},
{.id = DELETE_ENTRY,
.name = "kb-delete-entry",
.binding = "Shift+Delete",
.comment = "Delete entry from history"},
{.id = MODE_NEXT,
.name = "kb-mode-next",
.binding = "Shift+Right,Control+Tab",
.comment = "Switch to the next mode."},
{.id = MODE_PREVIOUS,
.name = "kb-mode-previous",
.binding = "Shift+Left,Control+ISO_Left_Tab",
.comment = "Switch to the previous mode."},
{.id = MODE_COMPLETE,
.name = "kb-mode-complete",
.binding = "Control+l",
.comment = "Start completion for mode."},
{.id = ROW_LEFT,
.name = "kb-row-left",
.binding = "Control+Page_Up",
.comment = "Go to the previous column"},
{.id = ROW_RIGHT,
.name = "kb-row-right",
.binding = "Control+Page_Down",
.comment = "Go to the next column"},
{.id = ROW_UP,
.name = "kb-row-up",
.binding = "Up,Control+p",
.comment = "Select previous entry"},
{.id = ROW_DOWN,
.name = "kb-row-down",
.binding = "Down,Control+n",
.comment = "Select next entry"},
{.id = ROW_TAB,
.name = "kb-row-tab",
.binding = "",
.comment =
"Go to next row, if one left, accept it, if no left next mode."},
{.id = ELEMENT_NEXT,
.name = "kb-element-next",
.binding = "Tab",
.comment = "Go to next element (in logical order)."},
{.id = ELEMENT_PREV,
.name = "kb-element-prev",
.binding = "ISO_Left_Tab",
.comment = "Go to next previous element (in logical order)."},
{.id = PAGE_PREV,
.name = "kb-page-prev",
.binding = "Page_Up",
.comment = "Go to the previous page"},
{.id = PAGE_NEXT,
.name = "kb-page-next",
.binding = "Page_Down",
.comment = "Go to the next page"},
{.id = ROW_FIRST,
.name = "kb-row-first",
.binding = "Home,KP_Home",
.comment = "Go to the first entry"},
{.id = ROW_LAST,
.name = "kb-row-last",
.binding = "End,KP_End",
.comment = "Go to the last entry"},
{.id = ROW_SELECT,
.name = "kb-row-select",
.binding = "Control+space",
.comment = "Set selected item as input text"},
{.id = SCREENSHOT,
.name = "kb-screenshot",
.binding = "Alt+S",
.comment = "Take a screenshot of the rofi window"},
{.id = CHANGE_ELLIPSIZE,
.name = "kb-ellipsize",
.binding = "Alt+period",
.comment = "Toggle between ellipsize modes for displayed data"},
{.id = TOGGLE_CASE_SENSITIVITY,
.name = "kb-toggle-case-sensitivity",
.binding = "grave,dead_grave",
.comment = "Toggle case sensitivity"},
{.id = TOGGLE_SORT,
.name = "kb-toggle-sort",
.binding = "Alt+grave",
.comment = "Toggle sort"},
{.id = CANCEL,
.name = "kb-cancel",
.binding = "Escape,Control+g,Control+bracketleft",
.comment = "Quit rofi"},
{.id = CUSTOM_1,
.name = "kb-custom-1",
.binding = "Alt+1",
.comment = "Custom keybinding 1"},
{.id = CUSTOM_2,
.name = "kb-custom-2",
.binding = "Alt+2",
.comment = "Custom keybinding 2"},
{.id = CUSTOM_3,
.name = "kb-custom-3",
.binding = "Alt+3",
.comment = "Custom keybinding 3"},
{.id = CUSTOM_4,
.name = "kb-custom-4",
.binding = "Alt+4",
.comment = "Custom keybinding 4"},
{.id = CUSTOM_5,
.name = "kb-custom-5",
.binding = "Alt+5",
.comment = "Custom Keybinding 5"},
{.id = CUSTOM_6,
.name = "kb-custom-6",
.binding = "Alt+6",
.comment = "Custom keybinding 6"},
{.id = CUSTOM_7,
.name = "kb-custom-7",
.binding = "Alt+7",
.comment = "Custom Keybinding 7"},
{.id = CUSTOM_8,
.name = "kb-custom-8",
.binding = "Alt+8",
.comment = "Custom keybinding 8"},
{.id = CUSTOM_9,
.name = "kb-custom-9",
.binding = "Alt+9",
.comment = "Custom keybinding 9"},
{.id = CUSTOM_10,
.name = "kb-custom-10",
.binding = "Alt+0",
.comment = "Custom keybinding 10"},
{.id = CUSTOM_11,
.name = "kb-custom-11",
.binding = "Alt+exclam",
.comment = "Custom keybinding 11"},
{.id = CUSTOM_12,
.name = "kb-custom-12",
.binding = "Alt+at",
.comment = "Custom keybinding 12"},
{.id = CUSTOM_13,
.name = "kb-custom-13",
.binding = "Alt+numbersign",
.comment = "Custom keybinding 13"},
{.id = CUSTOM_14,
.name = "kb-custom-14",
.binding = "Alt+dollar",
.comment = "Custom keybinding 14"},
{.id = CUSTOM_15,
.name = "kb-custom-15",
.binding = "Alt+percent",
.comment = "Custom keybinding 15"},
{.id = CUSTOM_16,
.name = "kb-custom-16",
.binding = "Alt+dead_circumflex",
.comment = "Custom keybinding 16"},
{.id = CUSTOM_17,
.name = "kb-custom-17",
.binding = "Alt+ampersand",
.comment = "Custom keybinding 17"},
{.id = CUSTOM_18,
.name = "kb-custom-18",
.binding = "Alt+asterisk",
.comment = "Custom keybinding 18"},
{.id = CUSTOM_19,
.name = "kb-custom-19",
.binding = "Alt+parenleft",
.comment = "Custom Keybinding 19"},
{.id = SELECT_ELEMENT_1,
.name = "kb-select-1",
.binding = "Super+1",
.comment = "Select row 1"},
{.id = SELECT_ELEMENT_2,
.name = "kb-select-2",
.binding = "Super+2",
.comment = "Select row 2"},
{.id = SELECT_ELEMENT_3,
.name = "kb-select-3",
.binding = "Super+3",
.comment = "Select row 3"},
{.id = SELECT_ELEMENT_4,
.name = "kb-select-4",
.binding = "Super+4",
.comment = "Select row 4"},
{.id = SELECT_ELEMENT_5,
.name = "kb-select-5",
.binding = "Super+5",
.comment = "Select row 5"},
{.id = SELECT_ELEMENT_6,
.name = "kb-select-6",
.binding = "Super+6",
.comment = "Select row 6"},
{.id = SELECT_ELEMENT_7,
.name = "kb-select-7",
.binding = "Super+7",
.comment = "Select row 7"},
{.id = SELECT_ELEMENT_8,
.name = "kb-select-8",
.binding = "Super+8",
.comment = "Select row 8"},
{.id = SELECT_ELEMENT_9,
.name = "kb-select-9",
.binding = "Super+9",
.comment = "Select row 9"},
{.id = SELECT_ELEMENT_10,
.name = "kb-select-10",
.binding = "Super+0",
.comment = "Select row 10"},
/* Mouse-aware bindings */
{ .id = SCROLL_LEFT, .scope = SCOPE_MOUSE_LISTVIEW, .name = "ml-row-left", .binding = "ScrollLeft", .comment = "Go to the previous column" },
{ .id = SCROLL_RIGHT, .scope = SCOPE_MOUSE_LISTVIEW, .name = "ml-row-right", .binding = "ScrollRight", .comment = "Go to the next column" },
{ .id = SCROLL_UP, .scope = SCOPE_MOUSE_LISTVIEW, .name = "ml-row-up", .binding = "ScrollUp", .comment = "Select previous entry" },
{ .id = SCROLL_DOWN, .scope = SCOPE_MOUSE_LISTVIEW, .name = "ml-row-down", .binding = "ScrollDown", .comment = "Select next entry" },
{.id = SCROLL_LEFT,
.scope = SCOPE_MOUSE_LISTVIEW,
.name = "ml-row-left",
.binding = "ScrollLeft",
.comment = "Go to the previous column"},
{.id = SCROLL_RIGHT,
.scope = SCOPE_MOUSE_LISTVIEW,
.name = "ml-row-right",
.binding = "ScrollRight",
.comment = "Go to the next column"},
{.id = SCROLL_UP,
.scope = SCOPE_MOUSE_LISTVIEW,
.name = "ml-row-up",
.binding = "ScrollUp",
.comment = "Select previous entry"},
{.id = SCROLL_DOWN,
.scope = SCOPE_MOUSE_LISTVIEW,
.name = "ml-row-down",
.binding = "ScrollDown",
.comment = "Select next entry"},
{ .id = SELECT_HOVERED_ENTRY, .scope = SCOPE_MOUSE_LISTVIEW_ELEMENT, .name = "me-select-entry", .binding = "MousePrimary", .comment = "Select hovered row" },
{ .id = ACCEPT_HOVERED_ENTRY, .scope = SCOPE_MOUSE_LISTVIEW_ELEMENT, .name = "me-accept-entry", .binding = "MouseDPrimary", .comment = "Accept hovered row" },
{ .id = ACCEPT_HOVERED_CUSTOM, .scope = SCOPE_MOUSE_LISTVIEW_ELEMENT, .name = "me-accept-custom", .binding = "Control+MouseDPrimary", .comment = "Accept hovered row with custom action"},
{.id = SELECT_HOVERED_ENTRY,
.scope = SCOPE_MOUSE_LISTVIEW_ELEMENT,
.name = "me-select-entry",
.binding = "MousePrimary",
.comment = "Select hovered row"},
{.id = ACCEPT_HOVERED_ENTRY,
.scope = SCOPE_MOUSE_LISTVIEW_ELEMENT,
.name = "me-accept-entry",
.binding = "MouseDPrimary",
.comment = "Accept hovered row"},
{.id = ACCEPT_HOVERED_CUSTOM,
.scope = SCOPE_MOUSE_LISTVIEW_ELEMENT,
.name = "me-accept-custom",
.binding = "Control+MouseDPrimary",
.comment = "Accept hovered row with custom action"},
};
/** Default binding of mouse button to action. */
static const gchar *mouse_default_bindings[] = {
[MOUSE_CLICK_DOWN] = "MousePrimary",
[MOUSE_CLICK_UP] = "!MousePrimary",
[MOUSE_CLICK_DOWN] = "MousePrimary",
[MOUSE_CLICK_UP] = "!MousePrimary",
[MOUSE_DCLICK_DOWN] = "MouseDPrimary",
[MOUSE_DCLICK_UP] = "!MouseDPrimary",
[MOUSE_DCLICK_UP] = "!MouseDPrimary",
};
void setup_abe ( void )
{
for ( gsize i = 0; i < G_N_ELEMENTS ( rofi_bindings ); ++i ) {
ActionBindingEntry *b = &rofi_bindings[i];
b->binding = g_strdup ( b->binding );
config_parser_add_option ( xrm_String, b->name, (void * *) &( b->binding ), b->comment );
}
}
static gboolean binding_check_action ( guint64 scope, G_GNUC_UNUSED gpointer target, gpointer user_data )
{
return rofi_view_check_action ( rofi_view_get_active (), scope, GPOINTER_TO_UINT ( user_data ) ) ? NK_BINDINGS_BINDING_TRIGGERED : NK_BINDINGS_BINDING_NOT_TRIGGERED;
}
static void binding_trigger_action ( guint64 scope, G_GNUC_UNUSED gpointer target, gpointer user_data )
{
rofi_view_trigger_action ( rofi_view_get_active (), scope, GPOINTER_TO_UINT ( user_data ) );
}
guint key_binding_get_action_from_name ( const char *name )
{
for ( gsize i = 0; i < G_N_ELEMENTS ( rofi_bindings ); ++i ) {
void setup_abe(void) {
for (gsize i = 0; i < G_N_ELEMENTS(rofi_bindings); ++i) {
ActionBindingEntry *b = &rofi_bindings[i];
if ( g_strcmp0(b->name, name) == 0 ) {
b->binding = g_strdup(b->binding);
config_parser_add_option(xrm_String, b->name, (void **)&(b->binding),
b->comment);
}
}
static gboolean binding_check_action(guint64 scope,
G_GNUC_UNUSED gpointer target,
gpointer user_data) {
return rofi_view_check_action(rofi_view_get_active(), scope,
GPOINTER_TO_UINT(user_data))
? NK_BINDINGS_BINDING_TRIGGERED
: NK_BINDINGS_BINDING_NOT_TRIGGERED;
}
static void binding_trigger_action(guint64 scope, G_GNUC_UNUSED gpointer target,
gpointer user_data) {
rofi_view_trigger_action(rofi_view_get_active(), scope,
GPOINTER_TO_UINT(user_data));
}
guint key_binding_get_action_from_name(const char *name) {
for (gsize i = 0; i < G_N_ELEMENTS(rofi_bindings); ++i) {
ActionBindingEntry *b = &rofi_bindings[i];
if (g_strcmp0(b->name, name) == 0) {
return b->id;
}
}
return UINT32_MAX;
}
gboolean parse_keys_abe(NkBindings *bindings) {
GError *error = NULL;
GString *error_msg = g_string_new("");
for (gsize i = 0; i < G_N_ELEMENTS(rofi_bindings); ++i) {
ActionBindingEntry *b = &rofi_bindings[i];
char *keystr = g_strdup(b->binding);
char *sp = NULL;
gboolean parse_keys_abe ( NkBindings *bindings )
{
GError *error = NULL;
GString *error_msg = g_string_new ( "" );
for ( gsize i = 0; i < G_N_ELEMENTS ( rofi_bindings ); ++i ) {
ActionBindingEntry *b = &rofi_bindings[i];
char *keystr = g_strdup ( b->binding );
char *sp = NULL;
// Iter over bindings.
const char *const sep = ",";
for ( char *entry = strtok_r ( keystr, sep, &sp ); entry != NULL; entry = strtok_r ( NULL, sep, &sp ) ) {
if ( !nk_bindings_add_binding ( bindings, b->scope, entry, binding_check_action, binding_trigger_action, GUINT_TO_POINTER ( b->id ), NULL, &error ) ) {
char *str = g_markup_printf_escaped ( "Failed to set binding <i>%s</i> for: <i>%s (%s)</i>:\n\t<span size=\"smaller\" style=\"italic\">%s</span>\n",
b->binding, b->comment, b->name, error->message );
g_string_append ( error_msg, str );
g_free ( str );
g_clear_error ( &error );
}
}
g_free ( keystr );
}
if ( error_msg->len > 0 ) {
//rofi_view_error_dialog ( error_msg->str, TRUE );
rofi_add_error_message ( error_msg );
// g_string_free ( error_msg, TRUE );
return FALSE;
// Iter over bindings.
const char *const sep = ",";
for (char *entry = strtok_r(keystr, sep, &sp); entry != NULL;
entry = strtok_r(NULL, sep, &sp)) {
if (!nk_bindings_add_binding(bindings, b->scope, entry,
binding_check_action, binding_trigger_action,
GUINT_TO_POINTER(b->id), NULL, &error)) {
char *str = g_markup_printf_escaped(
"Failed to set binding <i>%s</i> for: <i>%s (%s)</i>:\n\t<span "
"size=\"smaller\" style=\"italic\">%s</span>\n",
b->binding, b->comment, b->name, error->message);
g_string_append(error_msg, str);
g_free(str);
g_clear_error(&error);
}
}
for ( gsize i = SCOPE_MIN_FIXED; i <= SCOPE_MAX_FIXED; ++i ) {
for ( gsize j = 1; j < G_N_ELEMENTS ( mouse_default_bindings ); ++j ) {
nk_bindings_add_binding ( bindings, i, mouse_default_bindings[j], binding_check_action, binding_trigger_action, GSIZE_TO_POINTER ( j ), NULL, NULL );
}
}
g_free(keystr);
}
if (error_msg->len > 0) {
// rofi_view_error_dialog ( error_msg->str, TRUE );
rofi_add_error_message(error_msg);
// g_string_free ( error_msg, TRUE );
return FALSE;
}
g_string_free ( error_msg, TRUE );
return TRUE;
for (gsize i = SCOPE_MIN_FIXED; i <= SCOPE_MAX_FIXED; ++i) {
for (gsize j = 1; j < G_N_ELEMENTS(mouse_default_bindings); ++j) {
nk_bindings_add_binding(bindings, i, mouse_default_bindings[j],
binding_check_action, binding_trigger_action,
GSIZE_TO_POINTER(j), NULL, NULL);
}
}
g_string_free(error_msg, TRUE);
return TRUE;
}

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -26,7 +26,7 @@
*/
/** The log domain of this dialog. */
#define G_LOG_DOMAIN "Dialogs.Combi"
#define G_LOG_DOMAIN "Modes.Combi"
#include "helper.h"
#include "settings.h"
@ -36,7 +36,7 @@
#include "mode-private.h"
#include "widgets/textbox.h"
#include <dialogs/dialogs.h>
#include <modes/modes.h>
#include <pango/pango.h>
#include <theme.h>
@ -63,21 +63,21 @@ static void combi_mode_parse_switchers(Mode *sw) {
CombiModePrivateData *pd = mode_get_private_data(sw);
char *savept = NULL;
// Make a copy, as strtok will modify it.
char *switcher_str = g_strdup(config.combi_modi);
char *switcher_str = g_strdup(config.combi_modes);
const char *const sep = ",#";
// Split token on ','. This modifies switcher_str.
for (char *token = strtok_r(switcher_str, sep, &savept); token != NULL;
token = strtok_r(NULL, sep, &savept)) {
/* Check against recursion. */
if (g_strcmp0(token, sw->name) == 0) {
g_warning("You cannot add '%s' to the list of combined modi.", sw->name);
g_warning("You cannot add '%s' to the list of combined modes.", sw->name);
continue;
}
// Resize and add entry.
pd->switchers = (CombiMode *)g_realloc(
pd->switchers, sizeof(CombiMode) * (pd->num_switchers + 1));
Mode *mode = rofi_collect_modi_search(token);
Mode *mode = rofi_collect_modes_search(token);
if (mode != NULL) {
pd->switchers[pd->num_switchers].disable = FALSE;
pd->switchers[pd->num_switchers++].mode = mode;
@ -236,10 +236,7 @@ static char *combi_mgrv(const Mode *sw, unsigned int selected_line, int *state,
}
retv = helper_string_replace_if_exists(
config.combi_display_format,
"{mode}", dname,
"{text}", str,
NULL);
config.combi_display_format, "{mode}", dname, "{text}", str, NULL);
g_free(str);
if (attr_list != NULL) {

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -26,9 +26,9 @@
*/
/** The log domain of this dialog. */
#define G_LOG_DOMAIN "Dialogs.DMenu"
#define G_LOG_DOMAIN "Modes.DMenu"
#include "dialogs/dmenu.h"
#include "modes/dmenu.h"
#include "helper.h"
#include "rofi-icon-fetcher.h"
#include "rofi.h"
@ -50,7 +50,7 @@
#include <sys/types.h>
#include <unistd.h>
#include "dialogs/dmenuscriptshared.h"
#include "modes/dmenuscriptshared.h"
static int dmenu_mode_init(Mode *sw);
static int dmenu_token_match(const Mode *sw, rofi_int_matcher **tokens,
@ -239,21 +239,23 @@ static gchar *dmenu_format_output_string(const DmenuModePrivateData *pd,
for (; splitted && splitted[ns]; ns++) {
;
}
GString *str_retv = g_string_new("");
for (uint32_t i = 0; pd->columns && pd->columns[i]; i++) {
unsigned int index =
(unsigned int)g_ascii_strtoull(pd->columns[i], NULL, 10);
if (index < ns && index > 0) {
if (retv == NULL) {
retv = g_strdup(splitted[index - 1]);
if (index <= ns && index > 0) {
if (index == 1) {
g_string_append(str_retv, splitted[index - 1]);
} else {
gchar *t = g_strjoin("\t", retv, splitted[index - 1], NULL);
g_free(retv);
retv = t;
g_string_append_c(str_retv, '\t');
g_string_append(str_retv, splitted[index - 1]);
}
}
}
g_strfreev(splitted);
return retv ? retv : g_strdup("");
retv = str_retv->str;
g_string_free(str_retv, FALSE);
return retv;
}
static inline unsigned int get_index(unsigned int length, int index) {
@ -474,7 +476,7 @@ static int dmenu_token_match(const Mode *sw, rofi_int_matcher **tokens,
// int retv = helper_token_match ( tokens, esc );
int match = 1;
if (tokens) {
for (int j = 0; match && tokens != NULL && tokens[j] != NULL; j++) {
for (int j = 0; match && tokens[j] != NULL; j++) {
rofi_int_matcher *ftokens[2] = {tokens[j], NULL};
int test = 0;
test = helper_token_match(ftokens, esc);
@ -818,4 +820,8 @@ void print_dmenu_options(void) {
print_help_msg("-w", "windowid", "Position over window with X11 windowid.",
NULL, is_term);
print_help_msg("-keep-right", "", "Set ellipsize to end.", NULL, is_term);
print_help_msg("--display-columns", "", "Only show the selected columns",
NULL, is_term);
print_help_msg("--display-column-separator", "\t",
"Separator to use to split columns (regex)", NULL, is_term);
}

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -26,7 +26,7 @@
*/
/** The log domain of this dialog. */
#define G_LOG_DOMAIN "Dialogs.DRun"
#define G_LOG_DOMAIN "Modes.DRun"
#include <config.h>
#ifdef ENABLE_DRUN
@ -44,11 +44,11 @@
#include <sys/types.h>
#include <unistd.h>
#include "dialogs/drun.h"
#include "dialogs/filebrowser.h"
#include "helper.h"
#include "history.h"
#include "mode-private.h"
#include "modes/drun.h"
#include "modes/filebrowser.h"
#include "rofi.h"
#include "settings.h"
#include "timings.h"
@ -1385,7 +1385,7 @@ static int drun_token_match(const Mode *data, rofi_int_matcher **tokens,
}
int match = 1;
if (tokens) {
for (int j = 0; match && tokens != NULL && tokens[j] != NULL; j++) {
for (int j = 0; match && tokens[j] != NULL; j++) {
int test = 0;
rofi_int_matcher *ftokens[2] = {tokens[j], NULL};
// Match name

View file

@ -36,11 +36,11 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "dialogs/filebrowser.h"
#include "helper.h"
#include "history.h"
#include "mode-private.h"
#include "mode.h"
#include "modes/filebrowser.h"
#include "rofi.h"
#include "theme.h"
@ -402,7 +402,7 @@ static void file_browser_mode_init_current_dir(Mode *sw) {
static int file_browser_mode_init(Mode *sw) {
/**
* Called on startup when enabled (in modi list)
* Called on startup when enabled (in modes list)
*/
if (mode_get_private_data(sw) == NULL) {
FileBrowserModePrivateData *pd = g_malloc0(sizeof(*pd));
@ -427,6 +427,9 @@ static ModeMode file_browser_mode_result(Mode *sw, int mretv, char **input,
ModeMode retv = MODE_EXIT;
FileBrowserModePrivateData *pd =
(FileBrowserModePrivateData *)mode_get_private_data(sw);
gboolean special_command =
((mretv & MENU_CUSTOM_ACTION) == MENU_CUSTOM_ACTION);
if (mretv & MENU_NEXT) {
retv = NEXT_DIALOG;
} else if (mretv & MENU_PREVIOUS) {
@ -446,6 +449,17 @@ static ModeMode file_browser_mode_result(Mode *sw, int mretv, char **input,
get_file_browser(sw);
return RESET_DIALOG;
}
} else if ((pd->array[selected_line].type == RFILE) ||
(pd->array[selected_line].type == DIRECTORY &&
special_command)) {
char *d_esc = g_shell_quote(pd->array[selected_line].path);
char *cmd = g_strdup_printf("xdg-open %s", d_esc);
g_free(d_esc);
char *cdir = g_file_get_path(pd->current_dir);
helper_execute_command(cdir, cmd, FALSE, NULL);
g_free(cdir);
g_free(cmd);
return MODE_EXIT;
} else if (pd->array[selected_line].type == DIRECTORY) {
char *path = g_build_filename(cache_dir, FILEBROWSER_CACHE_FILE, NULL);
g_file_set_contents(path, pd->array[selected_line].path, -1, NULL);
@ -456,18 +470,6 @@ static ModeMode file_browser_mode_result(Mode *sw, int mretv, char **input,
free_list(pd);
get_file_browser(sw);
return RESET_DIALOG;
} else if (pd->array[selected_line].type == RFILE) {
// char *d = g_filename_from_utf8(pd->array[selected_line].path,
// -1, NULL,
// NULL, NULL);
char *d_esc = g_shell_quote(pd->array[selected_line].path);
char *cmd = g_strdup_printf("xdg-open %s", d_esc);
g_free(d_esc);
char *cdir = g_file_get_path(pd->current_dir);
helper_execute_command(cdir, cmd, FALSE, NULL);
g_free(cdir);
g_free(cmd);
return MODE_EXIT;
}
}
retv = RELOAD_DIALOG;

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -38,7 +38,7 @@
#include <sys/types.h>
#include <unistd.h>
#include "dialogs/help-keys.h"
#include "modes/help-keys.h"
#include "helper.h"
#include "rofi.h"
#include "settings.h"

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -31,7 +31,7 @@
*/
/** The log domain of this dialog. */
#define G_LOG_DOMAIN "Dialogs.Run"
#define G_LOG_DOMAIN "Modes.Run"
#include <config.h>
#include <stdio.h>
@ -46,8 +46,8 @@
#include <sys/types.h>
#include <unistd.h>
#include "dialogs/filebrowser.h"
#include "dialogs/run.h"
#include "modes/filebrowser.h"
#include "modes/run.h"
#include "helper.h"
#include "history.h"
#include "rofi.h"

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -26,10 +26,9 @@
*/
/** The log domain of this dialog. */
#define G_LOG_DOMAIN "Dialogs.Script"
#define G_LOG_DOMAIN "Modes.Script"
#include "dialogs/script.h"
#include "config.h"
#include "modes/script.h"
#include "helper.h"
#include "rofi.h"
#include <assert.h>
@ -47,7 +46,7 @@
#include "rofi-icon-fetcher.h"
#include "dialogs/dmenuscriptshared.h"
#include "modes/dmenuscriptshared.h"
typedef struct {
/** ID of the current script. */
@ -66,6 +65,7 @@ typedef struct {
/** Configuration settings. */
char *message;
char *prompt;
char *data;
gboolean do_markup;
char delim;
/** no custom */
@ -135,6 +135,9 @@ static void parse_header_entry(Mode *sw, char *line, ssize_t length) {
pd->no_custom = (strcasecmp(value, "true") == 0);
} else if (strcasecmp(line, "use-hot-keys") == 0) {
pd->use_hot_keys = (strcasecmp(value, "true") == 0);
} else if (strcasecmp(line, "data") == 0) {
g_free(pd->data);
pd->data = g_strdup(value);
}
}
}
@ -164,6 +167,9 @@ static DmenuScriptEntry *execute_executor(Mode *sw, char *arg,
if (entry && entry->info) {
env = g_environ_setenv(env, "ROFI_INFO", entry->info, TRUE);
}
if (pd->data) {
env = g_environ_setenv(env, "ROFI_DATA", pd->data, TRUE);
}
if (g_shell_parse_argv(sw->ed, &argc, &argv, &error)) {
argv = g_realloc(argv, (argc + 2) * sizeof(char *));
@ -204,7 +210,11 @@ static DmenuScriptEntry *execute_executor(Mode *sw, char *arg,
}
if (retv) {
size_t buf_length = strlen(buffer) + 1;
#if GLIB_CHECK_VERSION(2, 68, 0)
retv[(*length)].entry = g_memdup2(buffer, buf_length);
#else
retv[(*length)].entry = g_memdup(buffer, buf_length);
#endif
retv[(*length)].icon_name = NULL;
retv[(*length)].meta = NULL;
retv[(*length)].info = NULL;
@ -339,6 +349,7 @@ static void script_mode_destroy(Mode *sw) {
g_free(rmpd->cmd_list);
g_free(rmpd->message);
g_free(rmpd->prompt);
g_free(rmpd->data);
g_free(rmpd->urgent_list);
g_free(rmpd->active_list);
g_free(rmpd);
@ -386,7 +397,7 @@ static int script_token_match(const Mode *sw, rofi_int_matcher **tokens,
ScriptModePrivateData *rmpd = sw->private_data;
int match = 1;
if (tokens) {
for (int j = 0; match && tokens != NULL && tokens[j] != NULL; j++) {
for (int j = 0; match && tokens[j] != NULL; j++) {
rofi_int_matcher *ftokens[2] = {tokens[j], NULL};
int test = 0;
test = helper_token_match(ftokens, rmpd->cmd_list[index].entry);

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -31,9 +31,9 @@
*/
/**
* Log domain for the ssh modi.
* Log domain for the ssh mode.
*/
#define G_LOG_DOMAIN "Dialogs.Ssh"
#define G_LOG_DOMAIN "Modes.Ssh"
#include <config.h>
#include <glib.h>
@ -51,7 +51,7 @@
#include <sys/types.h>
#include <unistd.h>
#include "dialogs/ssh.h"
#include "modes/ssh.h"
#include "history.h"
#include "rofi.h"
#include "settings.h"

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -26,7 +26,7 @@
*/
/** The log domain of this dialog. */
#define G_LOG_DOMAIN "Dialogs.Window"
#define G_LOG_DOMAIN "Modes.Window"
#include <config.h>
@ -49,8 +49,8 @@
#include "xcb-internal.h"
#include "xcb.h"
#include "dialogs/window.h"
#include "helper.h"
#include "modes/window.h"
#include "rofi.h"
#include "settings.h"
#include "widgets/textbox.h"
@ -418,7 +418,7 @@ static int window_match(const Mode *sw, rofi_int_matcher **tokens,
client *c = cache_client->data[idx];
if (tokens) {
for (int j = 0; match && tokens != NULL && tokens[j] != NULL; j++) {
for (int j = 0; match && tokens[j] != NULL; j++) {
int test = 0;
// Dirty hack. Normally helper_token_match does _all_ the matching,
// Now we want it to match only one item at the time.

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -35,6 +35,8 @@
#include "rofi-icon-fetcher.h"
#include "rofi-types.h"
#include "settings.h"
#include <cairo.h>
#include <pango/pangocairo.h>
#include "keyb.h"
#include "view.h"
@ -290,6 +292,32 @@ static void rofi_icon_fetcher_worker(thread_state *sdata,
if (g_path_is_absolute(sentry->entry->name)) {
icon_path = sentry->entry->name;
} else if (g_str_has_prefix(sentry->entry->name, "font:")) {
cairo_surface_t *surface = cairo_image_surface_create(
CAIRO_FORMAT_ARGB32, sentry->wsize, sentry->hsize);
cairo_t *cr = cairo_create(surface);
PangoLayout *layout = pango_cairo_create_layout(cr);
pango_layout_set_text(layout, &sentry->entry->name[5], -1);
int width, height;
pango_layout_get_size(layout, &width, &height);
double ws = sentry->wsize / ((double)width / PANGO_SCALE);
double wh = sentry->hsize / ((double)height / PANGO_SCALE);
double scale = MIN(ws, wh);
cairo_move_to(
cr, (sentry->wsize - ((double)width / PANGO_SCALE) * scale) / 2.0,
(sentry->hsize - ((double)height / PANGO_SCALE) * scale) / 2.0);
cairo_scale(cr, scale, scale);
pango_cairo_update_layout(cr, layout);
pango_layout_get_size(layout, &width, &height);
pango_cairo_show_layout(cr, layout);
g_object_unref(layout);
cairo_destroy(cr);
sentry->surface = surface;
rofi_view_reload();
return;
} else {
icon_path = icon_path_ = nk_xdg_theme_get_icon(
rofi_icon_fetcher_data->xdg_context, themes, NULL, sentry->entry->name,

View file

@ -3,7 +3,7 @@
*
* MIT/X11 License
* Copyright © 2012 Sean Pringle <sean.pringle@gmail.com>
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -56,9 +56,9 @@
#include "rofi.h"
#include "settings.h"
#include "dialogs/dialogs.h"
#include "helper.h"
#include "mode.h"
#include "modes/modes.h"
#include "widgets/textbox.h"
#include "xrmoptions.h"
@ -82,7 +82,7 @@ const char *cache_dir = NULL;
/** List of error messages.*/
GList *list_of_error_msgs = NULL;
static void rofi_collect_modi_destroy(void);
static void rofi_collectmodes_destroy(void);
void rofi_add_error_message(GString *str) {
list_of_error_msgs = g_list_append(list_of_error_msgs, str);
}
@ -100,15 +100,15 @@ void rofi_clear_error_messages(void) {
/** Path to the configuration file */
G_MODULE_EXPORT char *config_path = NULL;
/** Path to the configuration file in the new format */
/** Array holding all activated modi. */
Mode **modi = NULL;
/** Array holding all activated modes. */
Mode **modes = NULL;
/** List of (possibly uninitialized) modi's */
Mode **available_modi = NULL;
/** Length of #num_available_modi */
unsigned int num_available_modi = 0;
/** Number of activated modi in #modi array */
unsigned int num_modi = 0;
/** List of (possibly uninitialized) modes */
Mode **available_modes = NULL;
/** Length of #num_available_modes */
unsigned int num_available_modes = 0;
/** Number of activated modes in #modes array */
unsigned int num_modes = 0;
/** Current selected mode */
unsigned int curr_mode = 0;
@ -127,20 +127,20 @@ void process_result(RofiViewState *state);
void rofi_set_return_code(int code) { return_code = code; }
unsigned int rofi_get_num_enabled_modi(void) { return num_modi; }
unsigned int rofi_get_num_enabled_modes(void) { return num_modes; }
const Mode *rofi_get_mode(unsigned int index) { return modi[index]; }
const Mode *rofi_get_mode(unsigned int index) { return modes[index]; }
/**
* @param name Name of the mode to lookup.
*
* Find the index of the mode with name.
*
* @returns index of the mode in modi, -1 if not found.
* @returns index of the mode in modes, -1 if not found.
*/
static int mode_lookup(const char *name) {
for (unsigned int i = 0; i < num_modi; i++) {
if (strcmp(mode_get_name(modi[i]), name) == 0) {
for (unsigned int i = 0; i < num_modes; i++) {
if (strcmp(mode_get_name(modes[i]), name) == 0) {
return i;
}
}
@ -164,10 +164,10 @@ static void teardown(int pfd) {
}
static void run_mode_index(ModeMode mode) {
// Otherwise check if requested mode is enabled.
for (unsigned int i = 0; i < num_modi; i++) {
if (!mode_init(modi[i])) {
for (unsigned int i = 0; i < num_modes; i++) {
if (!mode_init(modes[i])) {
GString *str = g_string_new("Failed to initialize the mode: ");
g_string_append(str, modi[i]->name);
g_string_append(str, modes[i]->name);
g_string_append(str, "\n");
rofi_view_error_dialog(str->str, ERROR_MSG_MARKUP);
@ -181,7 +181,7 @@ static void run_mode_index(ModeMode mode) {
}
curr_mode = mode;
RofiViewState *state =
rofi_view_create(modi[mode], config.filter, 0, process_result);
rofi_view_create(modes[mode], config.filter, 0, process_result);
// User can pre-select a row.
if (find_arg("-selected-row") >= 0) {
@ -220,19 +220,19 @@ void process_result(RofiViewState *state) {
ModeMode mode = curr_mode;
// Find next enabled
if (retv == NEXT_DIALOG) {
mode = (mode + 1) % num_modi;
mode = (mode + 1) % num_modes;
} else if (retv == PREVIOUS_DIALOG) {
if (mode == 0) {
mode = num_modi - 1;
mode = num_modes - 1;
} else {
mode = (mode - 1) % num_modi;
mode = (mode - 1) % num_modes;
}
} else if (retv == RELOAD_DIALOG) {
// do nothing.
} else if (retv == RESET_DIALOG) {
rofi_view_clear_input(state);
} else if (retv < MODE_EXIT) {
mode = (retv) % num_modi;
mode = (retv) % num_modes;
} else {
mode = retv;
}
@ -240,7 +240,7 @@ void process_result(RofiViewState *state) {
/**
* Load in the new mode.
*/
rofi_view_switch_mode(state, modi[mode]);
rofi_view_switch_mode(state, modes[mode]);
curr_mode = mode;
return;
}
@ -257,18 +257,18 @@ void process_result(RofiViewState *state) {
/**
* Help function.
*/
static void print_list_of_modi(int is_term) {
for (unsigned int i = 0; i < num_available_modi; i++) {
static void print_list_of_modes(int is_term) {
for (unsigned int i = 0; i < num_available_modes; i++) {
gboolean active = FALSE;
for (unsigned int j = 0; j < num_modi; j++) {
if (modi[j] == available_modi[i]) {
for (unsigned int j = 0; j < num_modes; j++) {
if (modes[j] == available_modes[i]) {
active = TRUE;
break;
}
}
printf(" • %s%s%s%s\n", active ? "+" : "",
is_term ? (active ? color_green : color_red) : "",
available_modi[i]->name, is_term ? color_reset : "");
available_modes[i]->name, is_term ? color_reset : "");
}
}
static void print_main_application_options(int is_term) {
@ -320,8 +320,8 @@ static void help(G_GNUC_UNUSED int argc, char **argv) {
printf("\n");
display_dump_monitor_layout();
printf("\n");
printf("Detected modi:\n");
print_list_of_modi(is_term);
printf("Detected modes:\n");
print_list_of_modes(is_term);
printf("\n");
printf("Compile time options:\n");
#ifdef WINDOW_MODE
@ -387,26 +387,26 @@ static void help_print_disabled_mode(const char *mode) {
fprintf(stderr, "Mode %s%s%s is not enabled. I have enabled it for now.\n",
color_red, mode, color_reset);
fprintf(stderr,
"Please consider adding %s%s%s to the list of enabled modi: "
"%smodi: [%s%s%s,%s]%s.\n",
color_red, mode, color_reset, color_green, config.modi, color_reset,
color_red, mode, color_reset);
"Please consider adding %s%s%s to the list of enabled modes: "
"%smodes: [%s%s%s,%s]%s.\n",
color_red, mode, color_reset, color_green, config.modes,
color_reset, color_red, mode, color_reset);
}
}
static void help_print_mode_not_found(const char *mode) {
GString *str = g_string_new("");
g_string_printf(str, "Mode %s is not found.\nThe following modi are known:\n",
mode);
for (unsigned int i = 0; i < num_available_modi; i++) {
g_string_printf(
str, "Mode %s is not found.\nThe following modes are known:\n", mode);
for (unsigned int i = 0; i < num_available_modes; i++) {
gboolean active = FALSE;
for (unsigned int j = 0; j < num_modi; j++) {
if (modi[j] == available_modi[i]) {
for (unsigned int j = 0; j < num_modes; j++) {
if (modes[j] == available_modes[i]) {
active = TRUE;
break;
}
}
g_string_append_printf(str, " * %s%s\n", active ? "+" : "",
available_modi[i]->name);
available_modes[i]->name);
}
rofi_add_error_message(str);
}
@ -418,27 +418,27 @@ static void help_print_no_arguments(void) {
fprintf(stderr, " %srofi%s -show %s{mode}%s\n\n",
is_term ? color_bold : "", is_term ? color_reset : "",
is_term ? color_green : "", is_term ? color_reset : "");
fprintf(stderr, "The following modi are enabled:\n");
for (unsigned int j = 0; j < num_modi; j++) {
fprintf(stderr, " * %s%s%s\n", is_term ? color_green : "", modi[j]->name,
fprintf(stderr, "The following modes are enabled:\n");
for (unsigned int j = 0; j < num_modes; j++) {
fprintf(stderr, " * %s%s%s\n", is_term ? color_green : "", modes[j]->name,
is_term ? color_reset : "");
}
fprintf(stderr, "\nThe following can be enabled:\n");
for (unsigned int i = 0; i < num_available_modi; i++) {
for (unsigned int i = 0; i < num_available_modes; i++) {
gboolean active = FALSE;
for (unsigned int j = 0; j < num_modi; j++) {
if (modi[j] == available_modi[i]) {
for (unsigned int j = 0; j < num_modes; j++) {
if (modes[j] == available_modes[i]) {
active = TRUE;
break;
}
}
if (!active) {
fprintf(stderr, " * %s%s%s\n", is_term ? color_red : "",
available_modi[i]->name, is_term ? color_reset : "");
available_modes[i]->name, is_term ? color_reset : "");
}
}
fprintf(stderr,
"\nTo activate a mode, add it to the list of modi in the %smodi%s "
"\nTo activate a mode, add it to the list of modes in the %smodes%s "
"setting.\n",
is_term ? color_green : "", is_term ? color_reset : "");
}
@ -447,8 +447,8 @@ static void help_print_no_arguments(void) {
* Cleanup globally allocated memory.
*/
static void cleanup(void) {
for (unsigned int i = 0; i < num_modi; i++) {
mode_destroy(modi[i]);
for (unsigned int i = 0; i < num_modes; i++) {
mode_destroy(modes[i]);
}
rofi_view_workers_finalize();
if (main_loop != NULL) {
@ -462,7 +462,7 @@ static void cleanup(void) {
// Cleaning up memory allocated by the Xresources file.
config_xresource_free();
g_free(modi);
g_free(modes);
g_free(config_path);
@ -473,7 +473,7 @@ static void cleanup(void) {
rofi_theme = NULL;
}
TIMINGS_STOP();
rofi_collect_modi_destroy();
rofi_collectmodes_destroy();
rofi_icon_fetcher_destroy();
rofi_theme_free_parsed_files();
@ -484,13 +484,13 @@ static void cleanup(void) {
}
/**
* Collected modi
* Collected modes
*/
Mode *rofi_collect_modi_search(const char *name) {
for (unsigned int i = 0; i < num_available_modi; i++) {
if (g_strcmp0(name, available_modi[i]->name) == 0) {
return available_modi[i];
Mode *rofi_collect_modes_search(const char *name) {
for (unsigned int i = 0; i < num_available_modes; i++) {
if (g_strcmp0(name, available_modes[i]->name) == 0) {
return available_modes[i];
}
}
return NULL;
@ -500,20 +500,20 @@ Mode *rofi_collect_modi_search(const char *name) {
*
* @returns TRUE when success.
*/
static gboolean rofi_collect_modi_add(Mode *mode) {
Mode *m = rofi_collect_modi_search(mode->name);
static gboolean rofi_collectmodes_add(Mode *mode) {
Mode *m = rofi_collect_modes_search(mode->name);
if (m == NULL) {
available_modi =
g_realloc(available_modi, sizeof(Mode *) * (num_available_modi + 1));
available_modes =
g_realloc(available_modes, sizeof(Mode *) * (num_available_modes + 1));
// Set mode.
available_modi[num_available_modi] = mode;
num_available_modi++;
available_modes[num_available_modes] = mode;
num_available_modes++;
return TRUE;
}
return FALSE;
}
static void rofi_collect_modi_dir(const char *base_dir) {
static void rofi_collectmodes_dir(const char *base_dir) {
g_debug("Looking into: %s for plugins", base_dir);
GDir *dir = g_dir_open(base_dir, 0, NULL);
if (dir) {
@ -536,7 +536,7 @@ static void rofi_collect_modi_dir(const char *base_dir) {
g_module_close(mod);
} else {
m->module = mod;
if (!rofi_collect_modi_add(m)) {
if (!rofi_collectmodes_add(m)) {
g_module_close(mod);
}
}
@ -555,34 +555,34 @@ static void rofi_collect_modi_dir(const char *base_dir) {
}
/**
* Find all available modi.
* Find all available modes.
*/
static void rofi_collect_modi(void) {
static void rofi_collect_modes(void) {
#ifdef WINDOW_MODE
if (config.backend == DISPLAY_XCB) {
rofi_collect_modi_add(&window_mode);
rofi_collect_modi_add(&window_mode_cd);
rofi_collectmodes_add(&window_mode);
rofi_collectmodes_add(&window_mode_cd);
}
#endif
rofi_collect_modi_add(&run_mode);
rofi_collect_modi_add(&ssh_mode);
rofi_collectmodes_add(&run_mode);
rofi_collectmodes_add(&ssh_mode);
#ifdef ENABLE_DRUN
rofi_collect_modi_add(&drun_mode);
rofi_collectmodes_add(&drun_mode);
#endif
rofi_collect_modi_add(&combi_mode);
rofi_collect_modi_add(&help_keys_mode);
rofi_collect_modi_add(&file_browser_mode);
rofi_collectmodes_add(&combi_mode);
rofi_collectmodes_add(&help_keys_mode);
rofi_collectmodes_add(&file_browser_mode);
if (find_arg("-no-plugins") < 0) {
find_arg_str("-plugin-path", &(config.plugin_path));
g_debug("Parse plugin path: %s", config.plugin_path);
rofi_collect_modi_dir(config.plugin_path);
rofi_collectmodes_dir(config.plugin_path);
/* ROFI_PLUGIN_PATH */
const char *path = g_getenv("ROFI_PLUGIN_PATH");
if (path != NULL) {
gchar **paths = g_strsplit(path, ":", -1);
for (unsigned int i = 0; paths[i]; i++) {
rofi_collect_modi_dir(paths[i]);
rofi_collectmodes_dir(paths[i]);
}
g_strfreev(paths);
}
@ -592,61 +592,61 @@ static void rofi_collect_modi(void) {
/**
* Setup configuration for config.
*/
static void rofi_collect_modi_setup(void) {
for (unsigned int i = 0; i < num_available_modi; i++) {
mode_set_config(available_modi[i]);
static void rofi_collectmodes_setup(void) {
for (unsigned int i = 0; i < num_available_modes; i++) {
mode_set_config(available_modes[i]);
}
}
static void rofi_collect_modi_destroy(void) {
for (unsigned int i = 0; i < num_available_modi; i++) {
if (available_modi[i]->module) {
GModule *mod = available_modi[i]->module;
available_modi[i] = NULL;
static void rofi_collectmodes_destroy(void) {
for (unsigned int i = 0; i < num_available_modes; i++) {
if (available_modes[i]->module) {
GModule *mod = available_modes[i]->module;
available_modes[i] = NULL;
g_module_close(mod);
}
if (available_modi[i]) {
mode_free(&(available_modi[i]));
if (available_modes[i]) {
mode_free(&(available_modes[i]));
}
}
g_free(available_modi);
available_modi = NULL;
num_available_modi = 0;
g_free(available_modes);
available_modes = NULL;
num_available_modes = 0;
}
/**
* Parse the mode string, into internal array of type Mode.
*
* String is split on separator ','
* First the three build-in modi are checked: window, run, ssh
* First the three build-in modes are checked: window, run, ssh
* if that fails, a script-mode is created.
*/
static int add_mode(const char *token) {
unsigned int index = num_modi;
unsigned int index = num_modes;
// Resize and add entry.
modi = (Mode **)g_realloc(modi, sizeof(Mode *) * (num_modi + 1));
modes = (Mode **)g_realloc(modes, sizeof(Mode *) * (num_modes + 1));
Mode *mode = rofi_collect_modi_search(token);
Mode *mode = rofi_collect_modes_search(token);
if (mode) {
modi[num_modi] = mode;
num_modi++;
modes[num_modes] = mode;
num_modes++;
} else if (script_mode_is_valid(token)) {
// If not build in, use custom modi.
// If not build in, use custom mode.
Mode *sw = script_mode_parse_setup(token);
if (sw != NULL) {
// Add to available list, so combi can find it.
rofi_collect_modi_add(sw);
rofi_collectmodes_add(sw);
mode_set_config(sw);
modi[num_modi] = sw;
num_modi++;
modes[num_modes] = sw;
num_modes++;
}
}
return (index == num_modi) ? -1 : (int)index;
return (index == num_modes) ? -1 : (int)index;
}
static gboolean setup_modi(void) {
static gboolean setup_modes(void) {
const char *const sep = ",#";
char *savept = NULL;
// Make a copy, as strtok will modify it.
char *mode_str = g_strdup(config.modi);
char *mode_str = g_strdup(config.modes);
// Split token on ','. This modifies mode_str.
for (char *token = strtok_r(mode_str, sep, &savept); token != NULL;
token = strtok_r(NULL, sep, &savept)) {
@ -749,7 +749,7 @@ static gboolean startup(G_GNUC_UNUSED gpointer data) {
show_error_dialog();
return G_SOURCE_REMOVE;
}
} else if (find_arg("-show") >= 0 && num_modi > 0) {
} else if (find_arg("-show") >= 0 && num_modes > 0) {
run_mode_index(0);
} else {
help_print_no_arguments();
@ -907,10 +907,10 @@ int main(int argc, char *argv[]) {
}
TICK_N("Setup Locale");
rofi_collect_modi();
TICK_N("Collect MODI");
rofi_collect_modi_setup();
TICK_N("Setup MODI");
rofi_collect_modes();
TICK_N("Collect MODES");
rofi_collectmodes_setup();
TICK_N("Setup MODES");
main_loop = g_main_loop_new(NULL, FALSE);
@ -1000,12 +1000,12 @@ int main(int argc, char *argv[]) {
/** dirty hack for dmenu compatibility */
char *windowid = NULL;
if (!dmenu_mode) {
// setup_modi
if (setup_modi()) {
// setup_modes
if (setup_modes()) {
cleanup();
return EXIT_FAILURE;
}
TICK_N("Setup Modi");
TICK_N("Setup Modes");
} else {
// Hack for dmenu compatibility.
if (find_arg_str("-w", &windowid) == TRUE) {
@ -1091,6 +1091,7 @@ int main(int argc, char *argv[]) {
TICK_N("Setup late Display");
rofi_theme_parse_process_conditionals();
rofi_theme_parse_process_links();
TICK_N("Theme setup");
// Setup signal handling sources.
@ -1113,6 +1114,7 @@ int main(int argc, char *argv[]) {
extern GList *list_of_error_msgs;
int rofi_theme_rasi_validate(const char *filename) {
rofi_theme_parse_file(filename);
rofi_theme_parse_process_links();
if (list_of_error_msgs == NULL) {
return EXIT_SUCCESS;
}
@ -1120,6 +1122,7 @@ int rofi_theme_rasi_validate(const char *filename) {
for (GList *iter = g_list_first(list_of_error_msgs); iter != NULL;
iter = g_list_next(iter)) {
fputs(((GString *)iter->data)->str, stderr);
fputs("\n", stderr);
}
return EXIT_FAILURE;

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -252,8 +252,10 @@ void rofi_theme_free(ThemeWidget *widget) {
* print
*/
inline static void printf_double(double d) {
char buf[G_ASCII_DTOSTR_BUF_SIZE];
g_ascii_formatd(buf, G_ASCII_DTOSTR_BUF_SIZE, "%.4lf", d);
char buf[G_ASCII_DTOSTR_BUF_SIZE + 1] = {
0,
};
g_ascii_formatd(buf, G_ASCII_DTOSTR_BUF_SIZE, "%.4f", d);
fputs(buf, stdout);
}
@ -1236,17 +1238,17 @@ GList *rofi_theme_get_list_distance(const widget *widget,
iter = g_list_next(iter)) {
Property *prop = (Property *)(iter->data);
if (prop->type == P_PADDING) {
RofiDistance *p = g_new0(RofiDistance, 1);
*p = prop->value.padding.left;
retv = g_list_append(retv, p);
RofiDistance *pnew = g_new0(RofiDistance, 1);
*pnew = prop->value.padding.left;
retv = g_list_append(retv, pnew);
} else if (prop->type == P_INTEGER) {
RofiDistance *p = g_new0(RofiDistance, 1);
RofiDistance *pnew = g_new0(RofiDistance, 1);
RofiDistance d =
(RofiDistance){.base = {prop->value.i, ROFI_PU_PX,
ROFI_DISTANCE_MODIFIER_NONE, NULL, NULL},
.style = ROFI_HL_SOLID};
*p = d;
retv = g_list_append(retv, p);
*pnew = d;
retv = g_list_append(retv, pnew);
} else {
g_warning("Invalid type detected in list.");
}
@ -1543,6 +1545,57 @@ static void rofi_theme_parse_process_conditionals_int(workarea mon,
}
}
}
static char *rofi_theme_widget_get_name(ThemeWidget *wid) {
GString *str = g_string_new(wid->name);
for (ThemeWidget *i = wid->parent; i->parent != NULL; i = i->parent) {
g_string_prepend_c(str, ' ');
g_string_prepend(str, i->name);
}
char *retv = str->str;
g_string_free(str, FALSE);
return retv;
}
static void rofi_theme_parse_process_links_int(ThemeWidget *wid) {
if (wid == NULL) {
return;
}
for (unsigned int i = 0; i < wid->num_widgets; i++) {
ThemeWidget *widget = wid->widgets[i];
rofi_theme_parse_process_links_int(widget);
if (widget->properties == NULL) {
continue;
}
GHashTableIter iter;
gpointer key, value;
g_hash_table_iter_init(&iter, widget->properties);
while (g_hash_table_iter_next(&iter, &key, &value)) {
Property *pv = (Property *)value;
if (pv->type == P_LINK) {
if (pv->value.link.ref == NULL) {
rofi_theme_resolve_link_property(pv, 0);
if (pv->value.link.ref == pv) {
char *n = rofi_theme_widget_get_name(widget);
GString *str = g_string_new(NULL);
g_string_printf(
str, "Failed to resolve variable '%s' in: `%s { %s: var(%s);}`",
pv->value.link.name, n, pv->name, pv->value.link.name);
rofi_add_error_message(str);
g_free(n);
}
}
}
}
}
}
void rofi_theme_parse_process_links(void) {
rofi_theme_parse_process_links_int(rofi_theme);
}
void rofi_theme_parse_process_conditionals(void) {
workarea mon;
monitor_active(&mon);

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -46,7 +46,6 @@
#include "settings.h"
#include "timings.h"
#include "dialogs/dialogs.h"
#include "display.h"
#include "helper-theme.h"
#include "helper.h"
@ -241,8 +240,8 @@ void rofi_view_free(RofiViewState *state) {
g_free(state->distance);
// Free the switcher boxes.
// When state is free'ed we should no longer need these.
g_free(state->modi);
state->num_modi = 0;
g_free(state->modes);
state->num_modes = 0;
g_free(state);
}
@ -773,6 +772,12 @@ static void rofi_view_trigger_global_action(KeyBindingAction action) {
state->retv = MENU_CANCEL;
state->quit = TRUE;
break;
case ELEMENT_NEXT:
listview_nav_next(state->list_view);
break;
case ELEMENT_PREV:
listview_nav_prev(state->list_view);
break;
case ROW_UP:
listview_nav_up(state->list_view);
break;
@ -1039,17 +1044,17 @@ static WidgetTriggerActionResult textbox_button_trigger_action(
}
return WIDGET_TRIGGER_ACTION_RESULT_IGNORED;
}
static WidgetTriggerActionResult textbox_sidebar_modi_trigger_action(
static WidgetTriggerActionResult textbox_sidebar_modes_trigger_action(
widget *wid, MouseBindingMouseDefaultAction action, G_GNUC_UNUSED gint x,
G_GNUC_UNUSED gint y, G_GNUC_UNUSED void *user_data) {
RofiViewState *state = (RofiViewState *)user_data;
unsigned int i;
for (i = 0; i < state->num_modi; i++) {
if (WIDGET(state->modi[i]) == wid) {
for (i = 0; i < state->num_modes; i++) {
if (WIDGET(state->modes[i]) == wid) {
break;
}
}
if (i == state->num_modi) {
if (i == state->num_modes) {
return WIDGET_TRIGGER_ACTION_RESULT_IGNORED;
}
@ -1217,17 +1222,17 @@ static void rofi_view_add_widget(RofiViewState *state, widget *parent_widget,
state->sidebar_bar =
box_create(parent_widget, name, ROFI_ORIENTATION_HORIZONTAL);
box_add((box *)parent_widget, WIDGET(state->sidebar_bar), FALSE);
state->num_modi = rofi_get_num_enabled_modi();
state->modi = g_malloc0(state->num_modi * sizeof(textbox *));
for (unsigned int j = 0; j < state->num_modi; j++) {
state->num_modes = rofi_get_num_enabled_modes();
state->modes = g_malloc0(state->num_modes * sizeof(textbox *));
for (unsigned int j = 0; j < state->num_modes; j++) {
const Mode *mode = rofi_get_mode(j);
state->modi[j] = textbox_create(
state->modes[j] = textbox_create(
WIDGET(state->sidebar_bar), WIDGET_TYPE_MODE_SWITCHER, "button",
TB_AUTOHEIGHT, (mode == state->sw) ? HIGHLIGHT : NORMAL,
mode_get_display_name(mode), 0.5, 0.5);
box_add(state->sidebar_bar, WIDGET(state->modi[j]), TRUE);
box_add(state->sidebar_bar, WIDGET(state->modes[j]), TRUE);
widget_set_trigger_action_handler(
WIDGET(state->modi[j]), textbox_sidebar_modi_trigger_action, state);
WIDGET(state->modes[j]), textbox_sidebar_modes_trigger_action, state);
}
} else if (g_ascii_strcasecmp(name, "overlay") == 0) {
state->overlay = textbox_create(
@ -1501,9 +1506,10 @@ void rofi_view_switch_mode(RofiViewState *state, Mode *mode) {
rofi_view_set_window_title("rofi");
}
if (state->sidebar_bar) {
for (unsigned int j = 0; j < state->num_modi; j++) {
for (unsigned int j = 0; j < state->num_modes; j++) {
const Mode *tb_mode = rofi_get_mode(j);
textbox_font(state->modi[j], (tb_mode == state->sw) ? HIGHLIGHT : NORMAL);
textbox_font(state->modes[j],
(tb_mode == state->sw) ? HIGHLIGHT : NORMAL);
}
}
rofi_view_restart(state);

View file

@ -45,7 +45,7 @@
#include "settings.h"
#include "timings.h"
#include "dialogs/dialogs.h"
#include "modes/modes.h"
#include "display.h"
#include "helper-theme.h"
#include "helper.h"

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -71,6 +71,9 @@ struct _listview {
// RChanged
// Text needs to be repainted.
unsigned int rchanged;
// The direction we pack the widgets.
RofiOrientation pack_direction;
// Administration
unsigned int cur_page;
@ -433,30 +436,53 @@ static void listview_draw(widget *wid, cairo_t *draw) {
}
}
for (unsigned int i = 0; i < max; i++) {
unsigned int ex =
left_offset + ((i) / lv->max_rows) * (element_width + spacing_hori);
if (lv->pack_direction == ROFI_ORIENTATION_HORIZONTAL) {
unsigned int ex = left_offset + ((i) % lv->cur_columns) *
(element_width + spacing_hori);
unsigned int ey = 0;
if (lv->reverse) {
ey = wid->h -
(widget_padding_get_bottom(wid) +
((i) / lv->cur_columns) *
(lv->element_height + spacing_vert)) -
lv->element_height;
if ((i) / lv->max_rows == (lv->cur_columns - 1)) {
ex += d;
}
if (lv->reverse) {
unsigned int ey =
wid->h -
(widget_padding_get_bottom(wid) +
((i) % lv->max_rows) * (lv->element_height + spacing_vert)) -
lv->element_height;
if ((i) / lv->cur_columns == (lv->cur_columns - 1)) {
ex += d;
}
} else {
ey = top_offset +
((i) / lv->cur_columns) * (lv->element_height + spacing_vert);
if ((i) / lv->cur_columns == (lv->cur_columns - 1)) {
ex += d;
}
}
widget_move(WIDGET(lv->boxes[i].box), ex, ey);
widget_resize(WIDGET(lv->boxes[i].box), element_width,
lv->element_height);
} else {
unsigned int ey =
top_offset +
((i) % lv->max_rows) * (lv->element_height + spacing_vert);
unsigned int ex = left_offset + ((i) / lv->max_rows) *
(element_width + spacing_hori);
if ((i) / lv->max_rows == (lv->cur_columns - 1)) {
ex += d;
}
unsigned int ey = 0;
if (lv->reverse) {
ey = wid->h -
(widget_padding_get_bottom(wid) +
((i) % lv->max_rows) * (lv->element_height + spacing_vert)) -
lv->element_height;
} else {
ey = top_offset +
((i) % lv->max_rows) * (lv->element_height + spacing_vert);
}
widget_move(WIDGET(lv->boxes[i].box), ex, ey);
widget_resize(WIDGET(lv->boxes[i].box), element_width,
lv->element_height);
}
update_element(lv, i, i + offset, TRUE);
widget_draw(WIDGET(lv->boxes[i].box), draw);
}
@ -494,7 +520,14 @@ static void listview_recompute_elements(listview *lv) {
}
if (!(lv->fixed_columns) && lv->req_elements < lv->max_elements) {
newne = lv->req_elements;
lv->cur_columns = (lv->req_elements + (lv->max_rows - 1)) / lv->max_rows;
if (lv->pack_direction == ROFI_ORIENTATION_VERTICAL) {
lv->cur_columns = (lv->req_elements + (lv->max_rows - 1)) / lv->max_rows;
} else {
lv->cur_columns = lv->menu_columns;
if (lv->req_elements < lv->menu_columns) {
lv->cur_columns = lv->req_elements;
}
}
} else {
newne = MIN(lv->req_elements, lv->max_elements);
lv->cur_columns = lv->menu_columns;
@ -709,6 +742,8 @@ listview *listview_create(widget *parent, const char *name,
config.fixed_num_lines);
lv->dynamic = rofi_theme_get_boolean(WIDGET(lv), "dynamic", TRUE);
lv->reverse = rofi_theme_get_boolean(WIDGET(lv), "reverse", reverse);
lv->pack_direction =
rofi_theme_get_orientation(WIDGET(lv), "flow", ROFI_ORIENTATION_VERTICAL);
lv->cycle = rofi_theme_get_boolean(WIDGET(lv), "cycle", config.cycle);
lv->fixed_columns =
rofi_theme_get_boolean(WIDGET(lv), "fixed-columns", FALSE);
@ -756,11 +791,44 @@ static void listview_nav_down_int(listview *lv) {
lv->barview.direction = LEFT_TO_RIGHT;
widget_queue_redraw(WIDGET(lv));
}
void listview_nav_next(listview *lv) {
if (lv == NULL) {
return;
}
listview_nav_down_int(lv);
}
void listview_nav_prev(listview *lv) {
if (lv == NULL) {
return;
}
listview_nav_up_int(lv);
}
static void listview_nav_column_left_int(listview *lv) {
if (lv->selected >= lv->cur_columns) {
lv->selected -= lv->cur_columns;
widget_queue_redraw(WIDGET(lv));
}
}
static void listview_nav_column_right_int(listview *lv) {
if ((lv->selected + lv->cur_columns) < lv->req_elements) {
lv->selected += lv->cur_columns;
widget_queue_redraw(WIDGET(lv));
}
}
void listview_nav_up(listview *lv) {
if (lv == NULL) {
return;
}
if (lv->pack_direction == ROFI_ORIENTATION_HORIZONTAL) {
if (lv->reverse) {
listview_nav_column_right_int(lv);
} else {
listview_nav_column_left_int(lv);
}
return;
}
if (lv->reverse) {
listview_nav_down_int(lv);
} else {
@ -771,6 +839,14 @@ void listview_nav_down(listview *lv) {
if (lv == NULL) {
return;
}
if (lv->pack_direction == ROFI_ORIENTATION_HORIZONTAL) {
if (lv->reverse) {
listview_nav_column_left_int(lv);
} else {
listview_nav_column_right_int(lv);
}
return;
}
if (lv->reverse) {
listview_nav_up_int(lv);
} else {
@ -782,6 +858,13 @@ void listview_nav_left(listview *lv) {
if (lv == NULL) {
return;
}
if (lv->max_rows == 0) {
return;
}
if (lv->pack_direction == ROFI_ORIENTATION_HORIZONTAL) {
listview_nav_up_int(lv);
return;
}
if (lv->type == BARVIEW) {
listview_nav_up_int(lv);
return;
@ -798,6 +881,10 @@ void listview_nav_right(listview *lv) {
if (lv->max_rows == 0) {
return;
}
if (lv->pack_direction == ROFI_ORIENTATION_HORIZONTAL) {
listview_nav_down_int(lv);
return;
}
if (lv->type == BARVIEW) {
listview_nav_down_int(lv);
return;

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -3,7 +3,7 @@
*
* MIT/X11 License
* Copyright © 2012 Sean Pringle <sean.pringle@gmail.com>
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -727,9 +727,7 @@ static void textbox_cursor_del_eol(textbox *tb) {
static void textbox_cursor_del_sol(textbox *tb) {
if (tb && tb->cursor >= 0) {
int length = tb->cursor;
if (length >= 0) {
textbox_delete(tb, 0, length);
}
textbox_delete(tb, 0, length);
}
}
static void textbox_cursor_del_word(textbox *tb) {

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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

View file

@ -3,7 +3,7 @@
*
* MIT/X11 License
* Copyright © 2012 Sean Pringle <sean.pringle@gmail.com>
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -63,8 +63,8 @@
#include "xcb.h"
#include <libsn/sn.h>
#include "dialogs/window.h"
#include "mode.h"
#include "modes/window.h"
#include <rofi.h>
@ -977,10 +977,8 @@ int monitor_active(workarea *mon) {
}
g_debug("Monitor active");
if (mon_set) {
if (mon) {
*mon = mon_cache;
return TRUE;
}
*mon = mon_cache;
return TRUE;
}
if (config.monitor != NULL) {
g_debug("Monitor lookup by name : %s", config.monitor);

View file

@ -54,7 +54,7 @@
#include "settings.h"
#include "timings.h"
#include "dialogs/dialogs.h"
#include "modes/modes.h"
#include "display.h"
#include "helper-theme.h"
#include "helper.h"

View file

@ -2,7 +2,7 @@
* rofi
*
* MIT/X11 License
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
* Copyright © 2013-2022 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
@ -72,12 +72,18 @@ typedef struct {
* Currently supports string, boolean and number (signed and unsigned).
*/
static XrmOption xrmOptions[] = {
{xrm_String, "switchers", {.str = &config.modi}, NULL, "", CONFIG_DEFAULT},
{xrm_String, "switchers", {.str = &config.modes}, NULL, "", CONFIG_DEFAULT},
{xrm_String,
"modi",
{.str = &config.modi},
{.str = &config.modes},
NULL,
"Enabled modi",
"Enabled modes",
CONFIG_DEFAULT},
{xrm_String,
"modes",
{.str = &config.modes},
NULL,
"Enable modes",
CONFIG_DEFAULT},
{xrm_String,
"font",
@ -278,7 +284,13 @@ static XrmOption xrmOptions[] = {
CONFIG_DEFAULT},
{xrm_String,
"combi-modi",
{.str = &config.combi_modi},
{.str = &config.combi_modes},
NULL,
"Set the modi to combine in combi mode",
CONFIG_DEFAULT},
{xrm_String,
"combi-modes",
{.str = &config.combi_modes},
NULL,
"Set the modi to combine in combi mode",
CONFIG_DEFAULT},
@ -599,7 +611,7 @@ void config_parse_cmd_options(void) {
static gboolean __config_parser_set_property(XrmOption *option,
const Property *p, char **error) {
if (option->type == xrm_String) {
if (p->type != P_STRING && p->type != P_LIST) {
if (p->type != P_STRING && (p->type != P_LIST && p->type != P_INTEGER)) {
*error =
g_strdup_printf("Option: %s needs to be set with a string not a %s.",
option->name, PropertyTypeName[p->type]);
@ -609,15 +621,17 @@ static gboolean __config_parser_set_property(XrmOption *option,
if (p->type == P_LIST) {
for (GList *iter = p->value.list; iter != NULL;
iter = g_list_next(iter)) {
Property *p = (Property *)iter->data;
Property *p2 = (Property *)iter->data;
if (value == NULL) {
value = g_strdup((char *)(p->value.s));
value = g_strdup((char *)(p2->value.s));
} else {
char *nv = g_strjoin(",", value, (char *)(p->value.s), NULL);
char *nv = g_strjoin(",", value, (char *)(p2->value.s), NULL);
g_free(value);
value = nv;
}
}
} else if (p->type == P_INTEGER) {
value = g_strdup_printf("%d", p->value.i);
} else {
value = g_strdup(p->value.s);
}

View file

@ -25,215 +25,183 @@
*
*/
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
#include <glib.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <mode.h>
#include <mode-private.h>
#include <dialogs/help-keys.h>
#include "theme.h"
#include "rofi.h"
#include "display.h"
#include "rofi.h"
#include "theme.h"
#include "widgets/textbox.h"
#include <keyb.h>
#include "xcb.h"
#include <helper.h>
#include <keyb.h>
#include <mode-private.h>
#include <mode.h>
#include <modes/help-keys.h>
#include <check.h>
#include "rofi-icon-fetcher.h"
#include <check.h>
ThemeWidget *rofi_theme = NULL;
uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
{
uint32_t rofi_icon_fetcher_query(const char *name, const int size) { return 0; }
uint32_t rofi_icon_fetcher_query_advanced(const char *name, const int wsize,
const int hsize) {
return 0;
}
uint32_t rofi_icon_fetcher_query_advanced ( const char *name, const int wsize, const int hsize )
{
return 0;
}
void rofi_clear_error_messages ( void ) {}
cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
{
return NULL;
}
void rofi_clear_error_messages(void) {}
cairo_surface_t *rofi_icon_fetcher_get(const uint32_t uid) { return NULL; }
gboolean rofi_theme_parse_string ( const char *string )
{
gboolean rofi_theme_parse_string(const char *string) { return FALSE; }
double textbox_get_estimated_char_height(void) { return 16.0; }
double textbox_get_estimated_ch(void) { return 9.0; }
void rofi_add_error_message(G_GNUC_UNUSED GString *msg) {}
int monitor_active(G_GNUC_UNUSED workarea *d) { return 0; }
int rofi_view_error_dialog(const char *msg, G_GNUC_UNUSED int markup) {
fputs(msg, stderr);
return TRUE;
}
void rofi_view_get_current_monitor(G_GNUC_UNUSED int *width,
G_GNUC_UNUSED int *height) {}
RofiViewState *rofi_view_get_active(void) { return NULL; }
gboolean rofi_view_check_action(G_GNUC_UNUSED RofiViewState *state,
G_GNUC_UNUSED BindingsScope scope,
G_GNUC_UNUSED guint action) {
return FALSE;
}
void rofi_view_trigger_action(G_GNUC_UNUSED RofiViewState *state,
G_GNUC_UNUSED BindingsScope scope,
G_GNUC_UNUSED guint action) {}
double textbox_get_estimated_char_height ( void )
{
return 16.0;
}
double textbox_get_estimated_ch ( void )
{
return 9.0;
}
void rofi_add_error_message ( G_GNUC_UNUSED GString *msg )
{
}
int monitor_active ( G_GNUC_UNUSED workarea *d )
{
return 0;
}
int rofi_view_error_dialog ( const char *msg, G_GNUC_UNUSED int markup )
{
fputs ( msg, stderr );
return TRUE;
}
void rofi_view_get_current_monitor ( G_GNUC_UNUSED int *width, G_GNUC_UNUSED int *height )
{
}
RofiViewState * rofi_view_get_active ( void )
{
return NULL;
}
gboolean rofi_view_check_action ( G_GNUC_UNUSED RofiViewState *state, G_GNUC_UNUSED BindingsScope scope, G_GNUC_UNUSED guint action )
{
return FALSE;
}
void rofi_view_trigger_action ( G_GNUC_UNUSED RofiViewState *state, G_GNUC_UNUSED BindingsScope scope, G_GNUC_UNUSED guint action )
{
}
void display_startup_notification ( G_GNUC_UNUSED RofiHelperExecuteContext *context, G_GNUC_UNUSED GSpawnChildSetupFunc *child_setup, G_GNUC_UNUSED gpointer *user_data )
{
}
void display_startup_notification(
G_GNUC_UNUSED RofiHelperExecuteContext *context,
G_GNUC_UNUSED GSpawnChildSetupFunc *child_setup,
G_GNUC_UNUSED gpointer *user_data) {}
#ifndef _ck_assert_ptr_null
/* Pointer against NULL comparison macros with improved output
* compared to ck_assert(). */
/* OP may only be == or != */
#define _ck_assert_ptr_null(X, OP) do { \
const void* _ck_x = (X); \
ck_assert_msg(_ck_x OP NULL, \
"Assertion '%s' failed: %s == %#x", \
#X" "#OP" NULL", \
#X, _ck_x); \
} while (0)
#define _ck_assert_ptr_null(X, OP) \
do { \
const void *_ck_x = (X); \
ck_assert_msg(_ck_x OP NULL, "Assertion '%s' failed: %s == %#x", \
#X " " #OP " NULL", #X, _ck_x); \
} while (0)
#define ck_assert_ptr_null(X) _ck_assert_ptr_null(X, ==)
#define ck_assert_ptr_nonnull(X) _ck_assert_ptr_null(X, !=)
#endif
static void test_mode_setup ( void )
{
ck_assert_int_eq ( mode_init ( &help_keys_mode ), TRUE);
}
static void test_mode_teardown ( void )
{
mode_destroy ( &help_keys_mode );
static void test_mode_setup(void) {
ck_assert_int_eq(mode_init(&help_keys_mode), TRUE);
}
static void test_mode_teardown(void) { mode_destroy(&help_keys_mode); }
START_TEST(test_mode_create)
{
ck_assert_ptr_nonnull ( help_keys_mode.private_data );
START_TEST(test_mode_create) {
ck_assert_ptr_nonnull(help_keys_mode.private_data);
}
END_TEST
START_TEST(test_mode_destroy)
{
mode_destroy ( &help_keys_mode );
ck_assert_ptr_null ( help_keys_mode.private_data );
START_TEST(test_mode_destroy) {
mode_destroy(&help_keys_mode);
ck_assert_ptr_null(help_keys_mode.private_data);
}
END_TEST
START_TEST(test_mode_num_items)
{
unsigned int rows = mode_get_num_entries ( &help_keys_mode);
ck_assert_int_eq ( rows, 74);
for ( unsigned int i =0; i < rows; i++ ) {
int state = 0;
GList *list = NULL;
char *v = mode_get_display_value ( &help_keys_mode, i, &state, &list, TRUE );
ck_assert_ptr_nonnull ( v );
g_free ( v );
v = mode_get_display_value ( &help_keys_mode, i, &state, &list, FALSE );
ck_assert_ptr_null ( v );
}
mode_destroy ( &help_keys_mode );
START_TEST(test_mode_num_items) {
unsigned int rows = mode_get_num_entries(&help_keys_mode);
ck_assert_int_eq(rows, 76);
for (unsigned int i = 0; i < rows; i++) {
int state = 0;
GList *list = NULL;
char *v = mode_get_display_value(&help_keys_mode, i, &state, &list, TRUE);
ck_assert_ptr_nonnull(v);
g_free(v);
v = mode_get_display_value(&help_keys_mode, i, &state, &list, FALSE);
ck_assert_ptr_null(v);
}
mode_destroy(&help_keys_mode);
}
END_TEST
START_TEST(test_mode_result)
{
char *res;
START_TEST(test_mode_result) {
char *res;
res = NULL;
ck_assert_int_eq ( mode_result ( &help_keys_mode, MENU_NEXT, &res,0), NEXT_DIALOG);
g_free ( res );
res = NULL;
ck_assert_int_eq(mode_result(&help_keys_mode, MENU_NEXT, &res, 0),
NEXT_DIALOG);
g_free(res);
res = NULL;
ck_assert_int_eq ( mode_result ( &help_keys_mode, MENU_PREVIOUS, &res,0), PREVIOUS_DIALOG);
g_free ( res );
res = NULL;
ck_assert_int_eq(mode_result(&help_keys_mode, MENU_PREVIOUS, &res, 0),
PREVIOUS_DIALOG);
g_free(res);
res = NULL;
ck_assert_int_eq ( mode_result ( &help_keys_mode, MENU_QUICK_SWITCH|1, &res,0), 1);
g_free ( res );
res = NULL;
ck_assert_int_eq(mode_result(&help_keys_mode, MENU_QUICK_SWITCH | 1, &res, 0),
1);
g_free(res);
res = NULL;
ck_assert_int_eq ( mode_result ( &help_keys_mode, MENU_QUICK_SWITCH|2, &res,0), 2);
g_free ( res );
res = NULL;
ck_assert_int_eq(mode_result(&help_keys_mode, MENU_QUICK_SWITCH | 2, &res, 0),
2);
g_free(res);
}
END_TEST
START_TEST(test_mode_match_entry)
{
rofi_int_matcher **t = helper_tokenize( "primary-paste", FALSE );
ck_assert_ptr_nonnull ( t );
START_TEST(test_mode_match_entry) {
rofi_int_matcher **t = helper_tokenize("primary-paste", FALSE);
ck_assert_ptr_nonnull(t);
ck_assert_int_eq ( mode_token_match ( &help_keys_mode, t, 0), TRUE );
ck_assert_int_eq ( mode_token_match ( &help_keys_mode, t, 1), FALSE );
helper_tokenize_free ( t );
t = helper_tokenize( "y-paste", FALSE );
ck_assert_ptr_nonnull ( t );
ck_assert_int_eq ( mode_token_match ( &help_keys_mode, t, 0), TRUE );
ck_assert_int_eq ( mode_token_match ( &help_keys_mode, t, 1), TRUE );
ck_assert_int_eq ( mode_token_match ( &help_keys_mode, t, 2), FALSE );
helper_tokenize_free ( t );
ck_assert_int_eq(mode_token_match(&help_keys_mode, t, 0), TRUE);
ck_assert_int_eq(mode_token_match(&help_keys_mode, t, 1), FALSE);
helper_tokenize_free(t);
t = helper_tokenize("y-paste", FALSE);
ck_assert_ptr_nonnull(t);
ck_assert_int_eq(mode_token_match(&help_keys_mode, t, 0), TRUE);
ck_assert_int_eq(mode_token_match(&help_keys_mode, t, 1), TRUE);
ck_assert_int_eq(mode_token_match(&help_keys_mode, t, 2), FALSE);
helper_tokenize_free(t);
}
END_TEST
static Suite * mode_suite (void)
{
Suite *s;
TCase *tc_core;
static Suite *mode_suite(void) {
Suite *s;
TCase *tc_core;
s = suite_create("Mode");
s = suite_create("Mode");
/* Core test case */
tc_core = tcase_create("HelpKeys");
tcase_add_checked_fixture(tc_core, test_mode_setup, test_mode_teardown);
tcase_add_test(tc_core, test_mode_create);
tcase_add_test(tc_core, test_mode_num_items);
tcase_add_test(tc_core, test_mode_result );
tcase_add_test(tc_core, test_mode_destroy);
tcase_add_test(tc_core, test_mode_match_entry );
suite_add_tcase(s, tc_core);
/* Core test case */
tc_core = tcase_create("HelpKeys");
tcase_add_checked_fixture(tc_core, test_mode_setup, test_mode_teardown);
tcase_add_test(tc_core, test_mode_create);
tcase_add_test(tc_core, test_mode_num_items);
tcase_add_test(tc_core, test_mode_result);
tcase_add_test(tc_core, test_mode_destroy);
tcase_add_test(tc_core, test_mode_match_entry);
suite_add_tcase(s, tc_core);
return s;
return s;
}
int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
{
setup_abe ();
int number_failed = 0;
Suite *s;
SRunner *sr;
int main(G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv) {
setup_abe();
int number_failed = 0;
Suite *s;
SRunner *sr;
s = mode_suite();
sr = srunner_create(s);
s = mode_suite();
sr = srunner_create(s);
srunner_run_all(sr, CK_NORMAL);
number_failed = srunner_ntests_failed(sr);
srunner_free(sr);
return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
srunner_run_all(sr, CK_NORMAL);
number_failed = srunner_ntests_failed(sr);
srunner_free(sr);
return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}

View file

@ -250,6 +250,41 @@ START_TEST(test_properties_distance_em_linestyle) {
ck_assert_int_eq(p.left.style, ROFI_HL_DASH);
}
END_TEST
START_TEST(test_properties_distance_ch) {
widget wid;
wid.name = "blaat";
wid.state = NULL;
rofi_theme_parse_string("* { test: 10ch;}");
ck_assert_ptr_nonnull(rofi_theme);
RofiDistance d = (RofiDistance){
{1, ROFI_PU_PX, ROFI_DISTANCE_MODIFIER_NONE, NULL, NULL}, ROFI_HL_SOLID};
RofiPadding pi = (RofiPadding){d, d, d, d};
RofiPadding p = rofi_theme_get_padding(&wid, "test", pi);
ck_assert_int_eq(p.left.base.distance, 10);
ck_assert_int_eq(p.left.base.type, ROFI_PU_CH);
ck_assert_int_eq(p.left.style, ROFI_HL_SOLID);
}
END_TEST
START_TEST(test_properties_distance_ch_linestyle) {
widget wid;
wid.name = "blaat";
wid.state = NULL;
rofi_theme_parse_string("* { sol: 1.3ch solid; dash: 1.5ch dash;}");
ck_assert_ptr_nonnull(rofi_theme);
RofiDistance d = (RofiDistance){
{1, ROFI_PU_PX, ROFI_DISTANCE_MODIFIER_NONE, NULL, NULL}, ROFI_HL_SOLID};
RofiPadding pi = (RofiPadding){d, d, d, d};
RofiPadding p = rofi_theme_get_padding(&wid, "sol", pi);
ck_assert_double_eq_tol(p.left.base.distance, 1.3, REAL_COMPARE_DELTA);
ck_assert_int_eq(p.left.base.type, ROFI_PU_CH);
ck_assert_int_eq(p.left.style, ROFI_HL_SOLID);
p = rofi_theme_get_padding(&wid, "dash", pi);
ck_assert_double_eq_tol(p.left.base.distance, 1.5, REAL_COMPARE_DELTA);
ck_assert_int_eq(p.left.base.type, ROFI_PU_CH);
ck_assert_int_eq(p.left.style, ROFI_HL_DASH);
}
END_TEST
START_TEST(test_properties_distance_px) {
widget wid;
wid.name = "blaat";
@ -318,6 +353,42 @@ START_TEST(test_properties_distance_percent_linestyle) {
ck_assert_int_eq(p.left.style, ROFI_HL_DASH);
}
END_TEST
START_TEST(test_properties_distance_mm) {
widget wid;
wid.name = "blaat";
wid.state = NULL;
rofi_theme_parse_string("* { test: 10mm;}");
ck_assert_ptr_nonnull(rofi_theme);
RofiDistance d = (RofiDistance){
{1, ROFI_PU_EM, ROFI_DISTANCE_MODIFIER_NONE, NULL, NULL}, ROFI_HL_DASH};
RofiPadding pi = (RofiPadding){d, d, d, d};
RofiPadding p = rofi_theme_get_padding(&wid, "test", pi);
ck_assert_double_eq_tol(p.left.base.distance, 10.0, REAL_COMPARE_DELTA);
ck_assert_int_eq(p.left.base.type, ROFI_PU_MM);
ck_assert_int_eq(p.left.style, ROFI_HL_SOLID);
}
END_TEST
START_TEST(test_properties_distance_mm_linestyle) {
widget wid;
wid.name = "blaat";
wid.state = NULL;
rofi_theme_parse_string("* { sol: 10mm solid; dash: 10mm dash;}");
ck_assert_ptr_nonnull(rofi_theme);
RofiDistance d = (RofiDistance){
{1, ROFI_PU_EM, ROFI_DISTANCE_MODIFIER_NONE, NULL, NULL}, ROFI_HL_DASH};
RofiPadding pi = (RofiPadding){d, d, d, d};
RofiPadding p = rofi_theme_get_padding(&wid, "sol", pi);
ck_assert_double_eq_tol(p.left.base.distance, 10.0, REAL_COMPARE_DELTA);
ck_assert_int_eq(p.left.base.type, ROFI_PU_MM);
ck_assert_int_eq(p.left.style, ROFI_HL_SOLID);
p = rofi_theme_get_padding(&wid, "dash", pi);
ck_assert_double_eq_tol(p.left.base.distance, 10, REAL_COMPARE_DELTA);
ck_assert_int_eq(p.left.base.type, ROFI_PU_MM);
ck_assert_int_eq(p.left.style, ROFI_HL_DASH);
}
END_TEST
START_TEST(test_properties_position) {
widget wid;
wid.name = "blaat";
@ -1273,6 +1344,151 @@ START_TEST(test_prepare_array) {
}
END_TEST
START_TEST(test_prepare_math_floor) {
widget wid;
wid.name = "window";
wid.state = "";
rofi_theme_parse_string("window { width: calc( 1024 floor 30 );}");
ck_assert_ptr_nonnull(rofi_theme);
// ck_assert_ptr_null ( rofi_theme->widgets );
ck_assert_ptr_null(rofi_theme->properties);
ck_assert_ptr_null(rofi_theme->parent);
ck_assert_str_eq(rofi_theme->name, "Root");
RofiDistance l = rofi_theme_get_distance(&wid, "width", 0);
int dist = distance_get_pixel(l, ROFI_ORIENTATION_HORIZONTAL);
ck_assert_int_eq(dist, 1020);
}
END_TEST
START_TEST(test_prepare_math_ceil) {
widget wid;
wid.name = "window";
wid.state = "";
rofi_theme_parse_string("window { width: calc( 1024 ceil 30 );}");
ck_assert_ptr_nonnull(rofi_theme);
// ck_assert_ptr_null ( rofi_theme->widgets );
ck_assert_ptr_null(rofi_theme->properties);
ck_assert_ptr_null(rofi_theme->parent);
ck_assert_str_eq(rofi_theme->name, "Root");
RofiDistance l = rofi_theme_get_distance(&wid, "width", 0);
int dist = distance_get_pixel(l, ROFI_ORIENTATION_HORIZONTAL);
ck_assert_int_eq(dist, 1050);
}
END_TEST
START_TEST(test_prepare_math_round) {
widget wid;
wid.name = "window";
wid.state = "";
rofi_theme_parse_string("window { width: calc( 1036 round 30 );}");
ck_assert_ptr_nonnull(rofi_theme);
// ck_assert_ptr_null ( rofi_theme->widgets );
ck_assert_ptr_null(rofi_theme->properties);
ck_assert_ptr_null(rofi_theme->parent);
ck_assert_str_eq(rofi_theme->name, "Root");
RofiDistance l = rofi_theme_get_distance(&wid, "width", 0);
int dist = distance_get_pixel(l, ROFI_ORIENTATION_HORIZONTAL);
ck_assert_int_eq(dist, 1050);
}
END_TEST
START_TEST(test_prepare_math_add) {
widget wid;
wid.name = "window";
wid.state = "";
rofi_theme_parse_string("window { width: calc( 1036 + 30 );}");
ck_assert_ptr_nonnull(rofi_theme);
// ck_assert_ptr_null ( rofi_theme->widgets );
ck_assert_ptr_null(rofi_theme->properties);
ck_assert_ptr_null(rofi_theme->parent);
ck_assert_str_eq(rofi_theme->name, "Root");
RofiDistance l = rofi_theme_get_distance(&wid, "width", 0);
int dist = distance_get_pixel(l, ROFI_ORIENTATION_HORIZONTAL);
ck_assert_int_eq(dist, 1066);
}
END_TEST
START_TEST(test_prepare_math_subtract) {
widget wid;
wid.name = "window";
wid.state = "";
rofi_theme_parse_string("window { width: calc( 1036 - 30 );}");
ck_assert_ptr_nonnull(rofi_theme);
// ck_assert_ptr_null ( rofi_theme->widgets );
ck_assert_ptr_null(rofi_theme->properties);
ck_assert_ptr_null(rofi_theme->parent);
ck_assert_str_eq(rofi_theme->name, "Root");
RofiDistance l = rofi_theme_get_distance(&wid, "width", 0);
int dist = distance_get_pixel(l, ROFI_ORIENTATION_HORIZONTAL);
ck_assert_int_eq(dist, 1006);
}
END_TEST
START_TEST(test_prepare_math_multiply) {
widget wid;
wid.name = "window";
wid.state = "";
rofi_theme_parse_string("window { width: calc( 256*4 );}");
ck_assert_ptr_nonnull(rofi_theme);
// ck_assert_ptr_null ( rofi_theme->widgets );
ck_assert_ptr_null(rofi_theme->properties);
ck_assert_ptr_null(rofi_theme->parent);
ck_assert_str_eq(rofi_theme->name, "Root");
RofiDistance l = rofi_theme_get_distance(&wid, "width", 0);
int dist = distance_get_pixel(l, ROFI_ORIENTATION_HORIZONTAL);
ck_assert_int_eq(dist, 1024);
}
END_TEST
START_TEST(test_prepare_math_modulo) {
widget wid;
wid.name = "window";
wid.state = "";
rofi_theme_parse_string("window { width: calc( 255 % 4 % 3 % );}");
ck_assert_ptr_nonnull(rofi_theme);
// ck_assert_ptr_null ( rofi_theme->widgets );
ck_assert_ptr_null(rofi_theme->properties);
ck_assert_ptr_null(rofi_theme->parent);
ck_assert_str_eq(rofi_theme->name, "Root");
RofiDistance l = rofi_theme_get_distance(&wid, "width", 0);
int dist = distance_get_pixel(l, ROFI_ORIENTATION_HORIZONTAL);
ck_assert_int_eq(dist, 3);
}
END_TEST
START_TEST(test_prepare_math_min) {
widget wid;
wid.name = "window";
wid.state = "";
rofi_theme_parse_string("window { width: calc( 256 min 4 );}");
ck_assert_ptr_nonnull(rofi_theme);
// ck_assert_ptr_null ( rofi_theme->widgets );
ck_assert_ptr_null(rofi_theme->properties);
ck_assert_ptr_null(rofi_theme->parent);
ck_assert_str_eq(rofi_theme->name, "Root");
RofiDistance l = rofi_theme_get_distance(&wid, "width", 0);
int dist = distance_get_pixel(l, ROFI_ORIENTATION_HORIZONTAL);
ck_assert_int_eq(dist, 4);
}
END_TEST
START_TEST(test_prepare_math_max) {
widget wid;
wid.name = "window";
wid.state = "";
rofi_theme_parse_string("window { width: calc( 256 max 4 );}");
ck_assert_ptr_nonnull(rofi_theme);
// ck_assert_ptr_null ( rofi_theme->widgets );
ck_assert_ptr_null(rofi_theme->properties);
ck_assert_ptr_null(rofi_theme->parent);
ck_assert_str_eq(rofi_theme->name, "Root");
RofiDistance l = rofi_theme_get_distance(&wid, "width", 0);
int dist = distance_get_pixel(l, ROFI_ORIENTATION_HORIZONTAL);
ck_assert_int_eq(dist, 256);
}
END_TEST
START_TEST(test_prepare_default) {
rofi_theme_parse_string("@import \"default\"");
ck_assert_ptr_null(error_msg);
ck_assert_ptr_nonnull(rofi_theme);
}
END_TEST
START_TEST(test_prepare_path) {
char *current_dir = g_get_current_dir();
ck_assert_ptr_nonnull(current_dir);
@ -1345,10 +1561,15 @@ static Suite *theme_parser_suite(void) {
tcase_add_checked_fixture(tc_prop_distance, theme_parser_setup,
theme_parser_teardown);
tcase_add_test(tc_prop_distance, test_properties_distance_em);
tcase_add_test(tc_prop_distance, test_properties_distance_ch);
tcase_add_test(tc_prop_distance, test_properties_distance_px);
tcase_add_test(tc_prop_distance, test_properties_distance_percent);
tcase_add_test(tc_prop_distance, test_properties_distance_em_linestyle);
tcase_add_test(tc_prop_distance, test_properties_distance_ch_linestyle);
tcase_add_test(tc_prop_distance, test_properties_distance_px_linestyle);
tcase_add_test(tc_prop_distance, test_properties_distance_mm);
tcase_add_test(tc_prop_distance, test_properties_distance_mm_linestyle);
tcase_add_test(tc_prop_distance,
test_properties_distance_percent_linestyle);
suite_add_tcase(s, tc_prop_distance);
@ -1484,6 +1705,24 @@ static Suite *theme_parser_suite(void) {
tcase_add_test(tc_prepare_array, test_prepare_array);
suite_add_tcase(s, tc_prepare_array);
}
{
TCase *tc_prepare_default = tcase_create("default");
tcase_add_test(tc_prepare_default, test_prepare_default);
suite_add_tcase(s, tc_prepare_default);
}
{
TCase *tc_prepare_math = tcase_create("math");
tcase_add_test(tc_prepare_math, test_prepare_math_add);
tcase_add_test(tc_prepare_math, test_prepare_math_subtract);
tcase_add_test(tc_prepare_math, test_prepare_math_multiply);
tcase_add_test(tc_prepare_math, test_prepare_math_modulo);
tcase_add_test(tc_prepare_math, test_prepare_math_floor);
tcase_add_test(tc_prepare_math, test_prepare_math_ceil);
tcase_add_test(tc_prepare_math, test_prepare_math_round);
tcase_add_test(tc_prepare_math, test_prepare_math_min);
tcase_add_test(tc_prepare_math, test_prepare_math_max);
suite_add_tcase(s, tc_prepare_math);
}
return s;
}