375 Commits

Author SHA1 Message Date
ede969e9ce filebrowser: include entries of d_type DT_UNKNOWN
workaround for https://github.com/davatorium/rofi/issues/1954
2025-06-03 03:42:43 +00:00
81e9d6ca1f run-{shell-,}command: expand {app_id} inside the template string 2025-06-03 03:42:43 +00:00
c0c861372e add default.nix
build this project from NixOS with `nix-build`
2025-06-03 03:42:43 +00:00
lbonn
07955bf9b3 Rofi 1.7.9+wayland1 2025-05-18 20:20:30 +02:00
lbonn
9f458ad2e7 Fix a merge conflict resolution error 2025-05-18 20:20:19 +02:00
lbonn
5596ecaca4 Merge tag '1.7.9' into wayland 2025-05-18 20:03:28 +02:00
Qball
b5e1494fcc Bump release to 1.7.9 2025-05-18 19:01:00 +02:00
Qball
4b41e4e8df [MKDocs] Update Downloads page with missing releases. 2025-05-18 12:12:15 +02:00
Qball
c873b37119 [MKDocs] More updates to menu structure. 2025-05-18 11:48:43 +02:00
Qball
709faac842 Add rofi-actions to website and update releasenotes. 2025-05-18 11:43:33 +02:00
Qball
54411627a9 More releasenote updates. 2025-05-17 19:24:15 +02:00
Qball
c645bdeab9 Add initial release notes for 1.7.9. 2025-05-17 15:07:31 +02:00
Amos Bird
b35f516556 Add -imdkit config to toggle imdkit at runtime (#2124) 2025-04-26 16:16:51 +02:00
Qball
f0ccf4c186 [Widget] Add 2 workaround for error in corner radius drawing
* Disable AA (works on nvidia)
* Disable nvidia workaround.
2025-03-30 15:04:22 +02:00
Qball Cow
d948e33e68 [rofi-sensible-terminal] Add ghostty
fixes: #2110
2025-03-09 12:47:13 +01:00
J0hannes101
56fd08ed58 [scrollbar] Add theming for rounded corners (#2108)
* [scrollbar] Add theming for rounded corners

* rename "rounded-corners" to "handle-rounded-corners"
2025-03-08 18:34:39 +01:00
Qball
a993ceadf4 [DOC] Fix indenting of sub-bullets as mkdocs interpets them differently
issue: #2112
2025-03-06 11:26:18 +01:00
elig0n
8b13ae350d Fix typo in fullscreen-preview.rasi (#2113) 2025-03-06 11:13:34 +01:00
J0hannes101
e70e3906cc Add theming to hide text cursor if no text is put in (#2106)
* Add theming to hide text cursor if no text is put in

* rename "hide-empty-cursor" to "hide-cursor-on-empty"

* update docs
2025-02-25 18:50:25 +01:00
Qball
22a0e39b9b [Build] Update dependencies for sr.ht. 2025-02-21 17:10:21 +01:00
J0hannes101
a84f04a14b [DRUN] Add option to exclude categories from drun #2102 (#2104)
* Add option to exclude categories from drun

* Fix memory leak when both -drun-categories and -drun-exclude-categories are used

* update docs
2025-02-21 16:28:21 +01:00
lbonn
3bec3fac59 Wayland: remove some dead code
Found with Codacy https://app.codacy.com/gh/davatorium/rofi/pull-requests/2099
2025-02-20 19:08:45 +01:00
Qball Cow
8639783f5f [XCB] Don't keep casting from int to double to int 2025-02-20 10:08:35 +01:00
Qball Cow
5d77a9bb33 [Helper] Add a rofi_fallthrough macro to tell compiler fallthrough is intentional 2025-02-20 09:59:53 +01:00
Qball
47053f30d2 [View] xcb_clear_area fixed wrong argument order. 2025-02-18 21:15:14 +01:00
lbonn
183b0b5d75 Wayland: fix key repeat rate
Fixes #81
2025-02-16 19:35:07 +01:00
Qball
c609e5e085 [DRun] Better handling of corrupted cache file. 2025-02-13 21:04:29 +01:00
lbonn
cebb0fd1a7 Merge remote-tracking branch 'upstream/next' into wayland 2025-02-13 09:35:15 +01:00
Emil
32a0374fb1 Fix broken Pango link (#2096) 2025-02-12 21:36:05 +01:00
Qball
f2f22e7edc [NKUtils] Drop support for binding Meta key.
fixes: #2095
2025-02-12 19:50:44 +01:00
Dave Davenport
88456b6adc [WIP] [View] Allow cycling through matching methods (#2091)
* [View] Allow cycling through matching methods

* [Doc] Fix documentation and test for keybindings

* [Helper] Allow selecting different matching modes for cycling at runtime.

* [View] Fix bool to gboolean

* [Doc] Small type fix, theme cleanup

* [Overlay] Make timeout configurable.

* [Helper] Reduce scope of variable.
2025-02-09 17:34:57 +01:00
Qball Cow
1942c527a8 Update script to avoid possible issues. 2025-02-09 11:15:36 +01:00
Qball Cow
00b15de450 Update codeql flow version 2025-02-09 11:09:16 +01:00
Qball Cow
995cd3c048 Fix wrong pointer -replace and small cleanup. 2025-02-09 11:00:59 +01:00
Qball Cow
f43d578264 [Textbox] Small signedness fixes for password mask code. 2025-02-08 21:37:20 +01:00
Zebra2711
1c144cc901 [dmenu] Modified textbox password masking (#2067)
* Modified textbox password masking

Use Unicode Character “●” (U+25CF) inteads '*'

* [dmenu] change password mask via theme config file

* revert wrong delete lib

* Fix cursor position

* Correct cursor positioning for UTF-8 paste in textboxes, remove unused variables.

* [Revert] Fix pasting UTF-8 characters. It causes the cursor position to move incorrectly.

* Make everything work again

* fix memory leak
2025-02-08 17:01:35 +01:00
phanium
0c3cbd0cfb feat: add smartcase support like vim (#2060) 2025-01-27 17:52:32 +01:00
Qball
3724b4dd31 [Mode] Fix wrong documentation header. 2025-01-26 21:40:24 +01:00
Qball Cow
fb326c1b61 Revert "[Window] Allow active window to be sorted on top."
This reverts commit 8542b3ee7e.
2025-01-26 20:13:21 +01:00
Qball Cow
e068ddbc01 [Mode] Add some wrappers and use object via accessors.
* Make sure file is only shown once in parsed list, not twice.
2025-01-26 20:07:04 +01:00
Qball
613bc5814c Merge remote-tracking branch 'github/next' into next 2025-01-24 11:33:02 +01:00
giomatfois62
bc67d8a8a6 [WIP] Execute custom user commands or scripts on a variety of rofi events (#2053)
* Implemented custom user command execution on the following menu events: entry selected, entry accepted, menu canceled, menu error, mode changed, screenshot taken

* fixed different signedness comparison warning and compare unfiltered entry index in selection_changed_user_callback

* track previously selected line in RofiViewState

* added documentation about custom scripts to run on certain actions

---------

Co-authored-by: Matteo <giomatfois62@yahoo.it>
2025-01-24 11:19:48 +01:00
Qball
168b5d6381 Merge remote-tracking branch 'github/next' into next 2025-01-22 18:19:30 +01:00
Tiou Lims
5870040256 Add option to enable the kb-delete-entry in script mode (#2087)
* Add option to enable the `kb-delete-entry` in script mode

* Remove `use-delete` option
2025-01-22 18:12:27 +01:00
lbonn
03a3a58d54 Review files exported in tarballs 2025-01-22 10:06:48 +01:00
lbonn
369818666b Rofi 1.7.8+wayland1 2025-01-20 20:00:32 +01:00
lbonn
e22d8ff75f Add tag in gh artifacts names 2025-01-20 20:00:30 +01:00
lbonn
42c384aec0 Merge tag '1.7.8' into wayland 2025-01-20 19:41:23 +01:00
Qball
8542b3ee7e [Window] Allow active window to be sorted on top.
fixes: #2048
2025-01-20 18:27:19 +01:00
Qball
5b95abce92 [Lexer] Allow for optional imports.
Adds the `?import` syntax.

fixes: #2078
2025-01-20 14:34:53 +01:00
Qball
56fbb62bd3 Bump to 1.7.8-dev release. 2025-01-19 10:43:57 +01:00
Qball
68a27ff317 Release 1.7.8 2025-01-19 10:41:47 +01:00
Qball
40a084949d [Doc] Update releasenotes. 2025-01-16 18:36:04 +01:00
Faule Socke
4cdca24995 Fix buffer overflow in rofi -e after reading from stdin (#2082) 2025-01-16 18:22:28 +01:00
Qball
329a5dd6a5 [Doc] Add first version of 1.7.8 releasenotes. 2025-01-13 19:21:05 +01:00
Qball Cow
4287ff444a [DRun] Reduce DBus timeout to 1500ms add option to disable DBusActivatable.
Issue: #2077
2025-01-09 12:53:37 +01:00
Qball
b8932b36ce [CI] Do explicit compare with 'true'?
Why is CI a pain like this.
2025-01-07 19:54:04 +01:00
Qball
829310b290 [CI] Fix typo in conditional. 2025-01-07 19:42:46 +01:00
Qball
53fd39b6ee [CI] Only make dist on one build. 2025-01-07 19:34:56 +01:00
Qball
ff56b4b954 [CI] Fix identical name? 2025-01-07 19:19:03 +01:00
Qball
6c1c029e98 [CI] Bump upload action to v4 2025-01-07 19:12:21 +01:00
lbonn
5df2d3a137 Merge remote-tracking branch 'upstream/next' into wayland 2025-01-07 13:24:51 +01:00
Qball
60181710dc [Widget] Actually remove ADD operator from border drawing.
Issue: #2076
2025-01-06 18:38:55 +01:00
Qball
5a016a3b17 [widget] Remove the ADD operator.
Issue: #2076
2025-01-06 18:37:03 +01:00
Qball
bbe85035c9 Add 1.7.7 docs to README. 2025-01-06 17:46:06 +01:00
lbonn
5cf3d34ba4 Set -dev version 2025-01-05 15:31:04 +01:00
lbonn
96df6d233e Rofi 1.7.7+wayland1 2025-01-05 15:26:18 +01:00
lbonn
3550af6d5b Fix imdkit detection
config.h needs to be included before ifdef check...
2025-01-05 14:38:29 +01:00
lbonn
fab79016fb Fix a shadowing warning 2025-01-05 14:01:36 +01:00
lbonn
57c53bdc16 Merge tag '1.7.7' into wayland 2025-01-05 14:01:24 +01:00
Qball
085e5eaccd Mark as dev version 2025-01-04 20:02:02 +01:00
Qball
c8d0bd3156 Release 1.7.7 2025-01-04 20:00:20 +01:00
Qball Cow
3500cdb540 First version release notes 1.7.8 2025-01-04 10:10:25 +01:00
Qball
3b1e483a6c [Widget] Don't use cairo_push/pop_group as it causes issues.
Seems to happen on nvidia systems, rendering to PNG surface is fine,
problem is with rendering to screen.
Hopefully this patch fixes it.

Issue: #2068
2025-01-03 22:28:49 +01:00
Qball
496101ac36 Revert "[window] Check bitmask, not full comparison"
This reverts commit 5185895643.
2025-01-03 19:48:56 +01:00
Qball
de4e10a7de [Config] Remove character data type as it aliases with string.
Internal character option will now use the first ascii char from the
string type.
2025-01-03 13:12:05 +01:00
Qball
de85539eb7 [Doc] Refer to releasenotes for updates in Changelog file. 2025-01-02 21:31:01 +01:00
Qball
e8ecd86bc0 [Doc] Update theme documentation with import resolving update.
Resolve both .rasi and .rasinc and what order

Issue: #2069
2025-01-02 21:09:20 +01:00
Qball
ec5c6fe7c8 [Themes] Update themes to import without rasi(nc) extensions.
Issue: #2069
2025-01-02 21:04:29 +01:00
Qball
25c1adbb2a [Theme] Fix resolving of 'rasinc' extension when no extension is given.
Was an unresolved TODO in code.

Fixes: #2069
2025-01-02 21:01:14 +01:00
Qball
d8e9a1981f Be more diligent trying to resolve -config 2024-12-31 12:00:03 +01:00
Qball Cow
f9491690fd Use FALSE instead of false. 2024-12-29 15:10:47 +01:00
Qball Cow
39f231b5ff Resolve -config argument identical to a -theme argument.
fixes: #2040
2024-12-29 10:34:50 +01:00
Qball Cow
b955b9aff9 [DRun] If indicated by .desktop file, launch via dbus activation.
fixes: #1924
2024-12-29 10:26:39 +01:00
Qball
b5861f8626 [Website] Update website links and headers. 2024-12-27 11:22:05 +01:00
Qball
33a50843f7 Set things ready for 1.7.7 development.
Add website entry.
2024-12-27 11:16:27 +01:00
Qball
554c0d6d49 Release 1.7.6 2024-12-27 11:08:42 +01:00
Qball Cow
ec6df03950 [Releasenotes] Small update to releasenotes 2024-12-26 14:49:33 +01:00
lbonn
7adea592a0 [Doc] Update release notes (#1958)
* [Doc] Update release notes

* [ReleaseNotes] Update releasenotes.

* [Doc] Update release notes

* [Doc] Update release notes

* Update release notes with latest change + known issue.

---------

Co-authored-by: Dave Davenport <qball@blame.services>
Co-authored-by: Laurent Bonnans <laurent.bonnans@smart-steel-technologies.com>
2024-12-26 14:49:22 +01:00
Qball
54ebfa7484 [CI] Update doxygen-coverage. 2024-12-23 14:15:48 +01:00
Qball
8b9afa39c8 [Doc] More doxygen file updates for CI. 2024-12-23 13:51:24 +01:00
Qball
53a80627e7 [Doc] Update doxygen file to remove obsolete entries. 2024-12-23 13:45:43 +01:00
Qball
98924ddcb7 [CI] Add dev package of libgdk-pixbuf-2.0 2024-12-23 13:27:59 +01:00
Qball
151b91092e [CI] add libgdk-pixbuf-2.0 to dependency list. 2024-12-23 13:26:16 +01:00
SWarrener
0abd88784b Fixing incorrect link in INSTALL.md 2024-11-29 17:01:37 +01:00
Dave Davenport
405f5231d8 [DOC] Add mouse button names to documentation. 2024-11-27 10:09:01 +01:00
lbonn
0a0cc5f6d7 Remove duplicated disable history code 2024-11-10 20:49:42 +01:00
lbonn
2baa809d8a Merge remote-tracking branch 'upstream/next' into wayland 2024-11-06 18:51:32 +01:00
lbonn
c38dc9a1d9 Re-indent recursivebrowser.c with clang-format 2024-11-04 10:12:06 +01:00
Dave Davenport
08989ab4fc [Doc] Clarify documentation for User Script directory.
Fixes: #2043
2024-10-26 12:07:47 +02:00
Dave Davenport
9d785b5ce1 Add -Wshadow to build system. (#2042)
* Add -Wshadow to build system.

Issue: #2036

* Take out unintended change

* [Icon] Add more descriptive variable name.
2024-10-20 12:54:13 +02:00
Dave Davenport
df7d8b65f0 [textbox] Fix aliasing variable name. (thanks to xsy420)
Issue: #2036
2024-10-18 22:01:09 +02:00
Onur
142e78071c Update rofi-sensible-terminal to include foot 2024-10-06 13:23:32 +02:00
Dave Davenport
186b0e7be0 [Textbox] Use FontMetrics font height (if available) to get height 2024-10-03 17:32:53 +02:00
Dave Davenport
f15aae9bd6 Merge remote-tracking branch 'origin/next' into next 2024-09-26 18:03:43 +02:00
Dave Davenport
35a4af12ff [Website] Update 1.7.3 docs.
Issue: #2033
2024-09-26 18:02:47 +02:00
Qball Cow
7402e451e2 [Theme] Fixes recursion in double_inside
fixes: #2021
2024-09-01 09:56:03 +02:00
Amos Bird
558ab34aa3 Try to support modifiers in XIM again (#2015) 2024-08-02 18:39:36 +02:00
Dave Davenport
21e57a6b7d [autoconf] Fix missing dependency. 2024-07-30 20:14:02 +02:00
Amos Bird
8eb8ff3b6f Better XIM interaction by filtering modifiers (#2000) 2024-07-09 20:51:23 +02:00
Amos Bird
8b612f08cf Fix ime and enable build option (#1999) 2024-07-09 17:53:02 +02:00
lbonn
8604addae2 [Autotools] Ship missing files for meson build 2024-07-08 23:17:40 +02:00
lbonn
a7c03695c4 Fix some compiler warnings
* -Wno-inline in autoconf builds (was already in meson builds)
* Use non-deprecated name for g_spawn_check_wait_status
* Update libgwater
2024-07-08 23:17:40 +02:00
Dave Davenport
8f06e0a370 #1995: Disable history in password mode, move disabling into create_view. 2024-07-07 20:34:24 +02:00
Dave Davenport
3b0f2b43f9 [config] Set filebrowser as default completer. 2024-06-27 21:32:39 +02:00
lbonn
d88b475bad [Wayland] Add missing methods in wl_data_device_listener 2024-06-24 23:26:56 +02:00
giomatfois62
75ae2a41f0 [WIP] xdg thumbnails fetching with fallback on mimetype icons (#1939)
* implemented xdg thumbnails fetching with fallback on mimetype icons for menu entries in filebrowser mode

* included original license text

* added md5 header and source file

* implemented xdg compatible thumbnail's creation

* added -preview-cmd string option to program settings

* support custom command to create images for entries with thumbnail:// prefix

* fix custom thumbnailer command crash caused by null uri when entry is not a valid filename

* check entry_name is not NULL or empty when generating thumbnails;
use snprintf to avoid static analyzer complains

* avoid using gstrvbuilder to build thumbnailer command args

* fixed static analyzer complain about always wrong condition

* use g_spawn_check_exit_status to avoid bump to glib 2.70

* removed md5-c dependency and use glib checksum implementation

* fixed meson build after md5-c library removal

* support thumbnail generation in recursivebrowser mode

* restored check rofi_icon_fetcher_file_is_image

* create thumbnail directories if not existing

* use g_malloc0, g_strdup and g_strdup_printf

* fixed formatting with clang-format

* don't wait for jobs in execution when finalizing the icon fetcher worker threadpool

* destroy and rebuild the icon fetcher worker threadpool when the current page is changed

* added query_started boolean member to IconFetcherEntry;
check if an icon fetcher query was started on an IconFetcherEntry and submit the query again otherwise

* force icon cache lookup even if the item has a valid icon_fetch_uid (the fetching job could have been discarded before starting)

* search binaries in PATH when executing thumbnailer command

* mark icon query as not started in threadpool item free_func

* added listview page_changed_callback; rebuild icon fetcher threadpool in page_changed_callback

* [listview] Add missing code documentation param

* Create rofi-thumbnails.5.markdown

* Updated documentation with apparmor issues and workaround

* [Doc] Ship rofi-thumbnails.5

With some formatting fixes

* use a more compact thumbnailer example

---------

Co-authored-by: giomatfois62 <giomatfois62@yahoo.it>
Co-authored-by: Dave Davenport <DaveDavenport@users.noreply.github.com>
Co-authored-by: lbonn <github@lbonnans.net>
2024-06-21 18:47:38 +02:00
Istvan Petres
5133f50f30 Add -transient-window mode (#1988)
* Add -transient-window mode

This will add a new mode for the rofi window so when you run it with
-transient-window

instead of
-normal-window

it will get the currently focused window and then use that as the parent window and set itself as transient of that window.  It is useful so that when you  use a keyboard shortcut to start rofi it will always popup on the window you are working on and so it doesn't make you refocus/move your head on large monitors :)

* Fixed other windows to be focusable in transient mode

and added print_help_msg for this new -transient-window option.

* Added -transient-window option to doc too
2024-06-09 18:57:29 +02:00
lbonn
93ad86da10 [Wayland] Fix touchpad scrolling
Magic values were determined empirically...

Fixes #134
2024-06-07 00:14:29 +02:00
Nikita Zlobin
bd0ba45db8 Fix scrolling for vertical layout with horizontal packing
Current scrolling effect looks interesting, but impractical, when with
multiple columns.

Signed-off-by: Dave Davenport <qball@gmpclient.org>
2024-06-06 18:42:55 +02:00
Nikita Zlobin
753cd1e9e1 Place continuous scroll center in middle column
Signed-off-by: Dave Davenport <qball@gmpclient.org>
2024-06-06 18:42:55 +02:00
Qball Cow
dee97eb540 [Script] Fix keep-selection add keep-filter
Fixes: #1962
2024-05-12 21:35:26 +02:00
Qball Cow
9580c4a191 [RecursiveBrowser] Make implementation not recursive.
Do stat when DT_UNKNOWN is given back when reading directory.

Issue: #1954
2024-05-12 13:41:32 +02:00
Samuel Dionne-Riel
b04bedca44 wayland/display: Fix mmap use
> From version 7 onwards, the fd must be mapped with MAP_PRIVATE by the recipient, as MAP_SHARED may fail.

 - https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_keyboard

Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
2024-05-05 21:05:47 +02:00
lbonn
51dec9d65b Merge remote-tracking branch 'upstream/next' into wayland 2024-05-04 12:29:49 +02:00
ortango
5b9939b287 Add border_width to window coordinates (#1969)
* Update xcb.c

window coors relative to border_width.

* Add border_width to window coordinates

Normalize the geometry between reparenting and non- window managers.

* remove WM_ROOT_WINDOW_OFFSET

* remove WM_ROOT_WINDOW_OFFSET
* only translate reparent
2024-04-25 16:14:39 +02:00
Robin Candau
812ad0277f Update documentation with the new rofi-wayland Arch package 2024-04-23 07:45:18 +02:00
Dave Davenport
9b6e70b365 [IconFetcher] Don't check for extension for image file.
Issue: 1977
2024-04-18 22:32:50 +02:00
martinsifrar
4f098751cd [IconFetcher] Fix failing decode of animated GIFs. (#1975) 2024-04-15 12:56:09 +02:00
Dave Davenport
6c38a49d54 [Doc] Fix typo, thx to @Nickwiz 2024-03-16 11:53:12 +01:00
Dave Davenport
94f8c88336 [github] update lock config. 2024-03-15 10:29:04 +01:00
Qball Cow
81e06d7157 [github] bump lock-threads flow version 2024-03-13 07:18:08 +01:00
Dave Davenport
839ee0d7d9 [Doc] Fix copy/paste error in template. 2024-03-11 15:49:19 +01:00
Dave Davenport
76154cc1ff [Doc] Fix typo in issue template. 2024-03-11 15:48:25 +01:00
Dave Davenport
1063b6ec05 [Run] Store display and exec string 2024-03-11 12:32:12 +01:00
Dave Davenport
04f16052a9 [Run] Don't re-quote history items. 2024-03-11 12:04:08 +01:00
lbonn
9cae4a9b61 [Modes] Remove dead code in mode implems (#1960)
NEXT, PREVIOUS and QUICK_SWITCH are handled in mode.c since
96cd34d24f (#1184)
2024-03-11 11:07:29 +01:00
Dave Davenport
af6fb83a51 [View] Work around GThreadPool 1 pointer bug.
* Also fix typo in icon fetcher.
2024-03-08 09:38:15 +01:00
Dave Davenport
0bf0c51827 [Github] Bump checkout to v4 2024-03-08 09:16:29 +01:00
lbonn
47ae31eb5d [Wayland] Fix CodeQL overflow warning 2024-03-06 11:54:20 +01:00
lbonn
d8ba203f6e [Wayland] Handle clipboard pasting more securely
Only receive clipboard offers when pasting instead of storing the data
indefinitely.

This is also more performant by default as it is not doing unnecessary
work.
2024-03-06 10:19:24 +01:00
lbonn
1c41373f52 Set -dev version 2024-03-05 17:37:56 +01:00
lbonn
32d229bb47 Bump to 1.7.5+wayland3 2024-03-05 17:15:44 +01:00
lbonn
433f9664e9 [Doc] Switch to pandoc and remove generated files (#1955)
* [Build] Add missing dist files from libnkutils

* [Doc] Switch to pandoc and remove generated files

* [Doc] Rewrite markdown for conversion to man

* convert existing markup to use definition list (a bit hacky...)
* rewrite title to pandoc man metadata
* reduce heading nesting to match most man pages
* inline code displayed as bold, also common man style

* [Doc] New installation with autoconf and meson

- autoconf:
  * generate in source directory if pandoc found
  * install from source directory

- meson:
  * generate and install with build directory if pandoc found
  * try to install from source directory if pandoc not found
  * bail otherwise

* [Doc] Make pandoc filter 2.9 compatible

Man pages look better with pandoc >= 2.17
2024-03-05 16:22:47 +01:00
Dave Davenport
3d29715e1e [IconFetcher] Don't free on removal from thread-pool 2024-03-02 19:38:05 +01:00
lbonn
be7c088eea [Doc] Fix -global-kb docs
And revert erroneous change in historical docs
2024-03-01 18:40:17 +01:00
lbonn
ccea31234a [WaylandWindow] Remove a scary log
Happens when destroy() is called without previous init()
2024-03-01 18:26:23 +01:00
Dave Davenport
8061e4e7c2 Add an item-free method to the thread-pool 2024-03-01 15:28:48 +01:00
lbonn
37b8e9fb99 [Wayland] Fix axis events handling
This was very buggy, we were counting the events twice...

* always use pointer frame, it's available since v5
* drop axis handler
* use axis_discrete or axis_120 (v >= 8) instead
* fail on some protocol minimum version checks
* simplify output protocol version check

Fixes #120
2024-03-01 11:27:45 +01:00
lbonn
217d6c46d4 [Wayland] Fix last missing non-strict prototype 2024-02-29 10:30:52 +01:00
Qball Cow
42d6bb9af4 [Window] write code so clang-check does not complain about leak.
Does not solve the possible, but very unlikely leak, but keeps
clang-check happy.
2024-02-29 00:00:36 +01:00
Dave Davenport
afc65ac125 [script|dmenu] Add option to make row permanent.
fixes: #1952
2024-02-28 20:47:18 +01:00
lbonn
2a8380f260 [Config] Rename global-kbindings to global-kb 2024-02-28 12:02:53 +01:00
lbonn
1d9819fe50 [Build] Fix deprecated format() in meson.build
In Wayland builds
2024-02-28 09:32:55 +01:00
lbonn
ccb8385d93 Merge remote-tracking branch 'upstream/next' into wayland 2024-02-28 09:31:31 +01:00
lbonn
0cec298f91 [Wayland] Make bindings inhibitor opt-in
Fixes #119
2024-02-28 09:29:04 +01:00
Qball Cow
f2c0f75fd2 [run] fix missing doxygen and add explanation. 2024-02-28 00:54:23 +01:00
Qball Cow
ee1b68aea6 [Run] When passing raw entry, pass it unquoted to history
fixes: #1951
2024-02-28 00:46:23 +01:00
Dave Davenport
eae65b2c07 Replace deprecated g_memdup by g_memdup2 2024-02-27 20:53:26 +01:00
Dave Davenport
3a97e0cb91 Replace deprecated by g_memdup to g_memdup2 2024-02-27 20:47:51 +01:00
Dave Davenport
1c41c36488 Bump glib version to 2.72 2024-02-27 20:46:34 +01:00
lbonn
aa193c3be6 [Build] Bump minimal meson version to 0.59.0 (#1947)
To remove some deprecated invocations.

0.47.0 (2018-07-02) -> 0.59.0 (2021-07-18)
2024-02-27 20:42:50 +01:00
lbonn
b847cb35f1 [Wayland] Update layer shell protocol
version 2 -> 5
2024-02-27 15:28:35 +01:00
lbonn
d53738170c [Wayland] Inhibit compositor shortcuts
... with the dedicated wayland protocol.

This way, rofi can re-use compositor bindings. The canonical example is
window switching with Alt-Tab.
2024-02-27 14:09:18 +01:00
lbonn
2ddef0f8ac [Wayland] Fix implicit deps in view-internal.h 2024-02-27 13:41:03 +01:00
lbonn
d2ad9fe828 [Wayland] Fix remaining non-strict C prototypes 2024-02-27 13:34:41 +01:00
lbonn
6c1a425d87 [WaylandWindow] Fix missing escaping 2024-02-27 13:31:02 +01:00
lbonn
54a2c45120 Merge remote-tracking branch 'upstream/next' into wayland 2024-02-27 13:29:54 +01:00
Aleksei Bavshin
cb6fd22118 [WaylandWindow] Unmap surface before sending activation request
Fixes lbonn/rofi#117
2024-02-26 19:32:40 +01:00
Qball Cow
43790b3eda Fix compiler warnings in window mode. 2024-02-25 23:39:05 +01:00
Qball Cow
2bbaa36b7a Fix some compiler warnings. 2024-02-25 23:33:22 +01:00
Qball Cow
058aac887f Small indent 2024-02-25 22:24:58 +01:00
Qball Cow
2d35397195 [RUN] shell escape command before processing it further. 2024-02-22 09:13:05 +01:00
Qball Cow
118e3a4df4 Revert "[config] By default escape run command."
This reverts commit 83ecbfe127.
2024-02-22 08:51:04 +01:00
Qball Cow
83ecbfe127 [config] By default escape run command. 2024-02-22 08:45:04 +01:00
lbonn
a4c8135533 Merge remote-tracking branch 'upstream/next' into wayland 2024-02-18 11:40:11 +01:00
Dave Davenport
1c8159c4c8 [DRun] Drun read url field from cache. 2024-02-18 11:35:39 +01:00
lbonn
f539a08222 [Build] Reduce amount of warnings (#1944)
* one unused parameter in recursivebrowser.c
* overlength strings are overly pedantic, modern compilers support large
  strings
* __FUNCTION__ creeped back in after #288
2024-02-16 18:41:07 +01:00
lbonn
070c830a92 Merge remote-tracking branch 'upstream/next' into wayland 2024-02-16 17:54:10 +01:00
Dave Davenport
3a5f95d69e [View] Don't use xcb surface to render to png, but create surface. 2024-02-16 13:36:21 +01:00
Jay Faulkner
9dbbf70468 Document ebuild for Gentoo in GURU
Linking to the GURU installation instructions in gentoo wiki instead
of enumerating them here to ensure it is less likely to bitrot.
2024-02-16 09:51:43 +01:00
Dave Davenport
831bddc68b [Box] When estimating height, set correct width on children
Issue: #1943
2024-02-15 09:13:37 +01:00
Qball Cow
13c2a61766 [ThreadPool] Sort items in the queue based on priority 2024-02-11 14:00:03 +01:00
Dave Davenport
3dc3e2d616 [Doc] Fix broken ``` guards. 2024-02-10 22:14:08 +01:00
Dave Davenport
dc43ee7d5b [Doc] Remove reddit link from config.yml. 2024-02-10 21:52:20 +01:00
Dave Davenport
c3023b399b [Doc] Clarify in build instructions what release to use. 2024-02-10 21:41:40 +01:00
Dave Davenport
1c7ff16add Add extra documentation issue template. 2024-02-10 21:36:27 +01:00
Igor
689d72f1dc Fix typo in dynamic_themes.md (#1941)
Add missing "P" in "PREVIEW=true"
2024-01-29 16:29:52 +01:00
Dave Davenport
e74c2dc253 [DOC] Add explanation to PATTERN of brackets
Fixes: #1933
2024-01-09 11:46:25 +01:00
Aleksei Bavshin
b88dddd1a1 [Wayland] Compositor-side cursors via cursor-shape-v1 2024-01-08 16:08:01 +01:00
Aleksei Bavshin
8f259ce9b0 [Wayland] Cursor types support 2024-01-08 16:08:01 +01:00
Aleksei Bavshin
1592525edb [Wayland] Clear frame_cb after destroying resources 2024-01-08 16:08:01 +01:00
Aleksei Bavshin
5bc2f09241 Re-indent Wayland sources with clang-format 2024-01-07 14:02:17 +01:00
lbonn
2520c1ea16 [Wayland] Fix crash during layer shell destruction
Rofi will no longer crash if the current output is disconnected but
will respawn on the next output chosen by the compositor

Fixes #50
2024-01-06 16:30:19 +01:00
lbonn
813ef6a0cc [Doc] Update wayland limitations list 2024-01-05 17:46:05 +01:00
Aleksei Bavshin
8ea79da037 [Wayland] Implement config.dpi support.
The correct value of `config.dpi` is required to support physical units
in the themes (e.g. `mm` `in sidebar-v2`).
2024-01-05 17:10:52 +01:00
Aleksei Bavshin
ecdd2b2347 [Wayland] Support -m/-monitor <name>.
Defer layer surface creation until we read the configuration and know
the value of `config.monitor`. Wait for Wayland output details and try
to select a matching output by name.

Numeric values of -5..n are intentionally not supported, because
* the order of `wl_output` globals is not defined and may change between
  sessions
* the best we can do for -5..-1 is to let the compositor decide

`wid:` in theory can be emulated via `xdg-foreign`, but that requires a
regular `xdg_toplevel` instead of a layer surface.
2024-01-05 17:10:52 +01:00
Aleksei Bavshin
22ec839f27 [Wayland] Print monitor layout 2024-01-05 17:10:52 +01:00
Aleksei Bavshin
53d99c49ad [Wayland] Support wl_output version 4.
- Double-buffer the properties.
 - Fetch name, geometry and transform properties - we need these to
   calculate DPI and to implement `monitor` configuration field.
2024-01-05 17:10:52 +01:00
Aleksei Bavshin
ad784f1f0d [Window] Set mode type for Wayland implementation.
Reformat to match other Mode definitions.

The `.type` is required after d27cee8.
2024-01-05 17:10:52 +01:00
Aleksei Bavshin
9e09a0729d Restrict WM detection to XCB backend
Fixes `rofi --help` after e409322
2024-01-05 17:10:52 +01:00
Dave Davenport
1a5e9e9af6 [Doc] Update manpage to clarify meta property. 2024-01-04 11:26:07 +01:00
Liao Junxuan
b29518f034 Enable pango markup for -window-format in wayland
Strings are already escaped when necessary. The x11 counterpart was implemented
in davatorium/rofi#1288.
2023-12-20 15:52:05 +01:00
Qball Cow
11d801ea9e [View] On mode switch force refilter instead of queuing.
issue: #1928
2023-12-17 17:26:34 +01:00
Dave Davenport
d042e20fff [View] Allow float delay
fixes: #1926
2023-12-08 13:51:04 +01:00
MoetaYuko
36621af0e4 [IconFetcher] Re-introduce icon scaling on wayland
This time, preserving ABI compatibility with upstream rofi

Fixes #96
2023-11-30 16:49:47 +01:00
lbonn
102e6de7a9 Revert "[IconFetcher] Apply scaling when loading images and icons"
This reverts commit 2c0fcf9da9.
2023-11-30 16:49:47 +01:00
ddmetz
78888dd80d hover select 2023-11-30 10:36:47 +01:00
Dave Davenport
b43a82f86d [View] Always forward motion to the grabbed widget first. 2023-11-24 12:26:24 +01:00
Dave Davenport
24c3258379 [IconFetcher] If last step fails to load icon, don't error out make warning 2023-11-16 15:25:40 +01:00
Dave Davenport
272c1ab231 Update releasenotes. 2023-11-10 17:47:27 +01:00
Dave Davenport
9aaa0a83ee [Script] Update theme property clarification a bit. 2023-11-10 14:45:26 +01:00
Dave Davenport
90edb60c4f [Script] Add clarification to theme property. 2023-11-10 14:41:48 +01:00
Dave Davenport
dbc1f8dcb4 [Dmenu][Script] Add 'display' row option to override whats displayed. 2023-11-06 20:02:48 +01:00
Dave Davenport
3c87321258 [DRun] Allow url field to be searched and fix c/p error
Issue: #1914
2023-10-31 13:24:37 +01:00
Dave Davenport
1481030947 [DRUN] Add {url} to drun-display-format.
Escape exec.

fixes: #1914
2023-10-31 11:28:45 +01:00
Qball Cow
cf8fb53be6 Update releasenotes. 2023-10-20 19:44:30 +02:00
Wim Looman
5cd1e3ca2b Pass the xkb group (a.k.a. layout) to nk_bindings
The `group` is used by xkb to support switching between multiple
layouts, without telling `nk_bindings` about this rofi always sees key
presses as if they're in the first layout.
2023-10-11 21:24:16 +02:00
lbonn
b4f91d5687 [Doc] Fix github issue templates 2023-10-11 00:30:39 +02:00
Dave Davenport
9cea843b4d [ReleaseNotes] Start working on notes 2023-10-07 10:56:05 +02:00
Dave Davenport
4feb278ad0 Change version as optional. 2023-10-06 19:34:28 +02:00
Dave Davenport
c78179dcc8 [lexer] Add dmenu as enabled option for media type.
fixes: #1903
2023-10-03 21:06:53 +02:00
Dave Davenport
a6d297591e [XCB] Make sure that window maker is 0 terminated before usage.
Thanks to Omar Polo and bsdmp
2023-09-30 15:58:31 +02:00
vE5li
05327773d9 Fix text color when cursor-color is set (#1901)
* Fix text color when cursor color is set

* Add comment
2023-09-27 18:23:18 +02:00
Quentin Glidic
1243dca65b gitmodules: Update libnkutils
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2023-09-25 18:04:32 +02:00
lbonn
9d11a2b4a9 [CI] Better test xcb and wayland-only builds 2023-09-25 15:52:39 +02:00
Dave Davenport
b5f1e97e0f [XCB] Try to be smarter with where mouse click started.
fixes: #1896
2023-09-24 20:06:08 +02:00
lbonn
b8dedc8836 Doc: Clarify issue template and CONTRIBUTING 2023-09-24 01:57:11 +02:00
lbonn
7c79169309 Wayland: fix wayland-only mode again 2023-09-24 01:57:11 +02:00
lbonn
bb85634182 Merge remote-tracking branch 'upstream/next' into wayland 2023-09-14 17:37:40 +02:00
Nikita Zlobin
a53daa68c4 [View|Textbox] cleanups to drawing code 2023-08-29 21:36:03 +02:00
Nikita Zlobin
9b2b52b13e Clip text with extents rectangle
Fonts are not ideal, some characters have mismatch between reported and
painted size.
2023-08-27 21:10:00 +02:00
Dave Davenport
51a8df9da5 [Rofi] Expand cache-dir
Fixes: #1892
2023-08-24 19:46:29 +02:00
Gutyina Gergő
b41654f903 Fix typos in dmenu docs (#1891) 2023-08-23 22:19:07 +02:00
Nikita Zlobin
c6f3cfb7d7 Support single quotes for strings as in CSS 2023-08-21 18:54:21 +02:00
Dave Davenport
664f1b9297 [Theme] Fix missing doxygen documentation 2023-08-15 19:34:11 +02:00
Dave Davenport
6caaf36df6 [Theme] Fix opening abs path if no/wrong extension (backward comp.) 2023-08-15 19:28:33 +02:00
Dave Davenport
a7aa8224cb [rofi-theme] fix typo 2023-08-15 19:16:26 +02:00
Dave Davenport
ad06fb9516 [Theme] Try to fix importing of theme.
- Fix the two place of resolving into one method.
- Do not accept file in CWD.
- Prefer file if it exists in same directory as parent file that
  imported it.

fixes: #1889
2023-08-15 19:12:14 +02:00
Nikita Zlobin
528419269e script: Let script handle empty custom input 2023-08-11 08:51:00 +02:00
Nikita Zlobin
82f9605c30 widget_draw: clean useless calls in corner drawing
Signed-off-by: Dave Davenport <qball@gmpclient.org>
2023-07-24 22:56:00 +02:00
Nikita Zlobin
45688b0a53 Fix border segments stitch
Signed-off-by: Dave Davenport <qball@gmpclient.org>
2023-07-24 22:56:00 +02:00
Nikita Zlobin
a383eb858e Fix mm type in description
Signed-off-by: Dave Davenport <qball@gmpclient.org>
2023-07-24 22:56:00 +02:00
Nikita Zlobin
386b92dace Remaining modi words in the code
Signed-off-by: Dave Davenport <qball@gmpclient.org>
2023-07-23 18:44:15 +02:00
Nikita Zlobin
81641d0f30 Better descriptions for sort options group
It's unobvious from documentation, that sort only works against filtered menu.

Signed-off-by: Dave Davenport <qball@gmpclient.org>
2023-07-23 18:44:15 +02:00
lbonn
ff2338c38f Set -dev version 2023-07-23 14:31:22 +02:00
Nikita Zlobin
c980139b7e update man pages without scripts
Signed-off-by: Dave Davenport <qball@gmpclient.org>
2023-07-22 14:15:54 +02:00
Dave Davenport
45c4a12daa [Lexer] Print some more debug info on error.
issue: #1865
2023-07-05 20:29:09 +02:00
Dave Davenport
64ceb85eed [Script] Set type on Mode object. 2023-07-03 18:10:22 +02:00
Dave Davenport
be6db24667 [window] Quick test of code scanning. 2023-07-03 13:40:23 +02:00
Dave Davenport
628d0b272c Merge remote-tracking branch 'github/next' into next 2023-07-03 12:35:47 +02:00
Jorge
f82fe90110 Add CodeQL workflow (#1863) 2023-07-03 12:35:00 +02:00
Qball Cow
a5301b35ad Remove unused variable. 2023-06-29 23:59:25 +02:00
Dave Davenport
7814da7ee4 [ROFI] -e '-' reads from stdin 2023-06-15 22:29:03 +02:00
Dave Davenport
635fbd0464 [ConfigParser] Don't pass commandline options with very long args.
This is a quick 'n dirty fix for this unexpected issue.

fixes: #1855
2023-06-15 19:36:19 +02:00
Dave Davenport
e203084647 [Build] Fix autotools build system. 2023-06-12 19:46:14 +02:00
Dave Davenport
47f37f2bbc [Doc] Fix some missing/wrong doxygen headers. 2023-06-12 19:40:25 +02:00
Dave Davenport
e409322faf Print window manager in -help output 2023-06-12 19:16:46 +02:00
Dave Davenport
96dabb4dd6 Merge remote-tracking branch 'github/next' into next 2023-06-12 19:08:03 +02:00
Dave Davenport
d27cee89fa Merging in the Recursive file browser.
Squashed commit of the following:

commit 92e730076d461622dc81e44e87ec456317514904
Author: Dave Davenport <qball@gmpclient.org>
Date:   Sun Jun 11 18:17:12 2023 +0200

    [Doc] Add regex filtering to recursivebrowser.

commit ee80c8487f9765b1e6e8ab8219a6baea089cf5af
Author: Dave Davenport <qball@gmpclient.org>
Date:   Sun Jun 11 17:49:29 2023 +0200

    [recursivebrowser] Update manpage.

commit a24b68f52362aaf1461935c2340e3bf5e31da59d
Author: Dave Davenport <qball@gmpclient.org>
Date:   Sun Jun 11 17:37:56 2023 +0200

    [Mode] Add some extra validating of the mode selected to complete.

commit cf497e8685e806521c0f61922827687adce268c9
Author: Dave Davenport <qball@gmpclient.org>
Date:   Sun Jun 4 15:12:31 2023 +0200

    [Recursive browser] Make completer selectable.

commit 722f07a803c28a406d8a610f31a24b3f7247b9ba
Author: Dave Davenport <qball@gmpclient.org>
Date:   Sun Jun 4 14:36:14 2023 +0200

    Add methods for completer to modes.

commit 7972420c30275514751802d1ed517a45bbd83da1
Author: Qball Cow <qball@blame.services>
Date:   Thu Jun 1 21:56:06 2023 +0200

    Prepare updates for new APIs.

commit dd3035a1a61f8196d394f6867701a0e1b3af30ac
Author: Dave Davenport <qball@gmpclient.org>
Date:   Wed May 10 19:24:48 2023 +0200

    [RB] Fix regex and cleanups

commit 4d2941caf32dfb946aee54c467c1319c7a89804a
Author: Dave Davenport <qball@blame.services>
Date:   Wed May 10 18:09:54 2023 +0200

    [RB] Add (unfinished regex test)

commit 848277001fc8cf9afc538067f2afa24a174f8c7f
Author: Dave Davenport <qball@blame.services>
Date:   Wed May 10 17:49:16 2023 +0200

    [RB] Pull the scanning into a separate thread.

commit f369a7f63f618bbcad10c18e73f7e2b117c515f1
Author: Dave Davenport <qball@gmpclient.org>
Date:   Wed May 3 18:35:15 2023 +0200

    [Recursive File Browser] First test version.
2023-06-12 19:07:00 +02:00
Yuta Katayama
b341ed01d2 Add wezterm to rofi-sensible-terminal (#1838) 2023-05-04 18:45:33 +02:00
Dave Davenport
21ac2d1930 [DRun] Add option to scan desktop directory for desktop files.
Squashed commit of the following:

commit ac12b66d86b36aaf349c15a5c8dab00a553a641f
Merge: 5c393fb4 98c213a6
Author: Dave Davenport <qball@gmpclient.org>
Date:   Sat Apr 22 21:48:24 2023 +0200

    Merge remote-tracking branch 'origin/next' into scan-desktop

commit 5c393fb4120e842d609e6d4366b1e0b822f66d7f
Author: Dave Davenport <qball@gmpclient.org>
Date:   Sat Apr 8 21:14:20 2023 +0200

    [DRun] Add option to scan desktop for desktop files
2023-04-22 21:50:20 +02:00
Quentin Glidic
98c213a634 gitmodules: Update libnkutils
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2023-04-22 17:40:23 +02:00
Dave Davenport
7328ac9802 [IconFetcher] Fix small memory leak. 2023-04-21 14:32:56 +02:00
Dave Davenport
b68f64ccee Small memory leaks fixed and other cleanups. 2023-04-21 12:50:55 +02:00
Dave Davenport
4de46aece6 [MKDocs] Move logo to top.
(testing).
2023-04-13 23:57:19 +02:00
Dave Davenport
d3d3a57691 [MKDocs] Add logo
(testing)
2023-04-13 23:54:45 +02:00
Dave Davenport
71570a92db [DMenu] Fix row initial tab if non-first column is shown first.
Issue: #1834
2023-04-12 20:24:09 +02:00
Dave Davenport
0133697fd2 [Doc] Update theme manpage with remark-lint hints. 2023-03-27 18:45:44 +02:00
Dave Davenport
586980aeaf [Doc] More small markdown fixes. 2023-03-27 12:40:59 +02:00
Dave Davenport
b23fc0fff4 [DOC] Update rofi-script update with remark-lint remarks. 2023-03-27 12:08:54 +02:00
Dave Davenport
3446e88cb8 Remove unneeded test and extra enforcement of 0 terminated buffer 2023-03-27 11:52:27 +02:00
Dave Davenport
ebae594c08 [Doc] Update rofi.1.markdown with markdown fixes. 2023-03-27 02:01:28 +02:00
Dave Davenport
127275c261 [DOC] update readme.md with remark-lint updates..
metastability issues in linter is fun.
2023-03-27 00:50:03 +02:00
Dave Davenport
feb173a4ea [DOC] Update INSTALL,md with remark-lint fixes. 2023-03-27 00:24:51 +02:00
Dave Davenport
9482f3c508 [DOC] Add some remark markdown fixes. 2023-03-27 00:09:25 +02:00
Dave Davenport
c1f63350f4 Fix to pointless or's. 2023-03-26 23:37:44 +02:00
Dave Davenport
e6af09a52c [UnitTest] Add more tests for environment parsing. 2023-03-26 21:52:50 +02:00
Dave Davenport
40ecbe018e [Doc] Mention location of scripts in manpage. 2023-03-26 13:57:50 +02:00
Dave Davenport
bb5868199f Re-indent the code using clang-format 2023-03-26 13:19:58 +02:00
Dave Davenport
7d3a365ccf Fix typo in template. 2023-03-24 12:35:00 +01:00
Dave Davenport
d706658ab0 Update issue template to include checkbox for version. 2023-03-24 12:32:01 +01:00
Dave Davenport
38c102d63b [Doc] Re-generate manpage 2023-03-05 11:18:30 +01:00
Christian Friedow
f5aa8f27a2 docs: element children theming (#1818)
* docs: element children theming

* docs: move element custom children docs

* docs: use relative link instead of absolute
2023-03-05 11:17:57 +01:00
notuxic
c870d512ff Add support for adding textbox widgets to listview elements (#1792)
* Add support for adding textbox-widgets to listview entries

* Add support for adding icons and buttons to listview elements
2023-03-05 11:17:25 +01:00
Dave Davenport
a5bd8bc630 [Textbox] cairo_save/restore does not store path.
Fix by moving cairo_move_to to after blink.
Also fix drawing outline.
2023-02-23 15:14:49 +01:00
Naïm Favier
f6248c6ea9 More Unicode normalization with -normalize-match (#1813)
Normalize the string to a fully decomposed form, then filter out mark/accent characters.
2023-02-16 19:34:24 +01:00
Dave Davenport
1b1aa37f20 #1802: Calc broken fix (#1803)
* [Theme] First move to double internal calculations.

* [Theme] Allow float numbers.

* [Theme] Fix unary - and tighten the grammar parser.

* [Theme] Rename % to modulo to fix compiler.

* [Theme] Dump right modulo syntax.

* [Test] add missing end_test

* [Grammar] Allow negative numbers as property value
2023-02-14 15:53:10 +01:00
Dave Davenport
ab1dfe7f61 [Dmenu] Small fix that disabled async mode when multi-select is enabled. 2023-02-11 18:53:31 +01:00
Dave Davenport
caa92637f1 [View] Fix wrong bitmask checking. (& not |) 2023-01-30 21:14:57 +01:00
Amith Mohanan
e65b90757f [rofi-theme-selector] prepend newline before specifying new theme (#1791)
* [rofi-theme-selector] prepend newline before specifying new theme

If the EOF is not a newline, new theme setting will fail.

* make sed substitution more readable

* simplify sed substitution
2023-01-30 11:44:28 +01:00
Dave Davenport
96633031db [MKDocs] Try to fix link. 2023-01-30 11:28:45 +01:00
Dave Davenport
360fb57c3d [MKDocs] Add downloads to side menu 2023-01-30 11:25:46 +01:00
Dave Davenport
12466beaf8 [MKDocs] Add a download page. 2023-01-30 11:24:31 +01:00
Tim Pope
215e55408f [Script] Strip pango markup when matching rows (#1795)
This is effectively the same fix that was made to DMenu in
a42e9f869f.
2023-01-29 21:30:36 +01:00
Dave Davenport
fb7c8c71ef [Doc] theme, spelling fix and more textual tweaks. 2023-01-25 23:20:06 +01:00
Dave Davenport
bc776fd67c [Doc] More tweaks to get the formulation right. 2023-01-25 23:15:30 +01:00
Dave Davenport
db16c63168 [Doc] themes manpage, small textual improvement. 2023-01-25 23:05:20 +01:00
Dave Davenport
b96b28ebde [Doc] Try to fix some markdown, themes.
seems fine in editor, not fine rendered in website.
2023-01-25 23:00:30 +01:00
Dave Davenport
7a1eb91329 [Doc] Try to clarify the children situation for the listview widget. 2023-01-25 22:55:04 +01:00
Dave Davenport
48e5478ceb [EntryHistory] Disable entry history when dmenu password is set. 2023-01-23 16:17:36 +01:00
Dave Davenport
c84f7f3bad Merge remote-tracking branch 'github/next' into next 2023-01-22 17:25:36 +01:00
Dave Davenport
6caece77d4 I785 (#1789)
* [Textbox] Add history to the entrybox.
* [Textbox] Add comments and move into sub functions.
* [doc] Add conflicting constraint section to manpage.
* [Script] Some small memory leak fixes.
* [Entry History] Add documentation.

fixes: #785
2023-01-22 17:25:17 +01:00
Dave Davenport
004f4ebd98 [doc] Add conflicting constraint section to manpage. 2023-01-22 12:54:45 +01:00
Dave Davenport
ebb4459a60 [mkdoc] add link to user scripts 2023-01-21 12:15:07 +01:00
Dave Davenport
a20f8280a7 [Textbox] Replace 'space' with a space
Issue: #1784
2023-01-18 09:25:39 +01:00
vE5li
8155b2c476 draw text after cursor (#1777) 2023-01-16 18:59:37 +01:00
Dave Davenport
b988efdb60 [Doc] Small tweak to markdown. 2023-01-16 18:42:48 +01:00
Dave Davenport
652be74b1b [Example] Small change in escaping for caday. 2023-01-16 18:19:30 +01:00
Dave Davenport
727d7c579d Update copyright dates. 2023-01-14 13:02:35 +01:00
Dave Davenport
f70b0ed3fd [Doc] Add manpage documentation for pango font string. 2023-01-14 12:44:55 +01:00
Dave Davenport
5b892ce86e [MKDocs] Add dynamic theme guide. 2023-01-13 20:35:12 +01:00
Dave Davenport
82b2ce9435 [FileBrowser] Allow command to be overwritten 2023-01-11 00:21:53 +01:00
Dave Davenport
b02a9d552b [theme] Small theme tweak. 2023-01-10 13:52:13 +01:00
Dave Davenport
b15bec8e6c [Theme] Add NO_IMAGE mode to theme. 2023-01-10 01:01:49 +01:00
Dave Davenport
d90ef45b7d [Themes] add fullscreen theme with preview part. 2023-01-10 00:48:52 +01:00
Dave Davenport
be4eeda3a5 [window] When no window title set, handle this more gracefully 2023-01-08 12:23:24 +01:00
Dave Davenport
9fda280be1 [DMenu|Script] Add per row urgent/active option.
Instead of having a global list of entries to highlight urgent/active,
you can now to it per row.
2023-01-08 12:10:40 +01:00
Rasmus Steinke
236c12bfb2 Merge pull request #1775 from nomoo/next
sed & realpath workaround for BSD and Darwin OS
2023-01-08 00:33:16 +01:00
nomoo
6bc7735d14 sed & realpath workaround for BSD and Darwin OS 2023-01-08 00:30:14 +03:00
Dave Davenport
5a29565fc8 [filebrowser] Add option to return 1 on cancel.
Fixes: #1732
2023-01-06 11:54:43 +01:00
Dave Davenport
d786129fd1 [Theme] Small tweak to fancy2 theme 2023-01-01 18:39:35 +01:00
Dave Davenport
d70210bcec update issue template
Expand option text.
2023-01-01 02:11:57 +01:00
Dave Davenport
96f1a562d1 update issue template
It seems No is a reserved keyword.
2023-01-01 02:10:32 +01:00
Dave Davenport
9b997e123f update issue template
If only github tells me before commit it is wrong, not after.
2023-01-01 02:09:35 +01:00
Dave Davenport
39f3bd21b4 update issue template with check 2023-01-01 02:08:45 +01:00
Dave Davenport
88d351a403 [MKDocs] Link to rasi files in theme page. 2023-01-01 00:04:14 +01:00
Dave Davenport
18ae8a0eb3 [Themes] Add fancy2 theme. 2022-12-31 23:54:14 +01:00
Dave Davenport
be3e3ed8dd [Themes] Add material theme 2022-12-31 23:21:03 +01:00
Dave Davenport
da713a8ec0 Merge remote-tracking branch 'origin/next' into next 2022-12-31 20:12:04 +01:00
Dave Davenport
de849b2587 Fix header theme 2022-12-31 20:10:52 +01:00
Dave Davenport
578cb391e4 [Helper] Quick fix for wrong dereference. 2022-12-31 14:37:56 +01:00
Dave Davenport
3d62bb32c9 MKDoc website (#1772)
* Add initial documentation page using mkdocs

* Test action

* Add notes to mkdoc site.

* Add installation guide

* Add installation and config guide to mkdocs.

* Add installation manual

* Add image to main page

* [mkdocs] Add plugin guide.

* [mkdocs] Add plugin to main page and some small fixes.

* Add shipped themes page

* [actions] Also rebuild website on the next branch
2022-12-31 13:15:01 +01:00
Dave Davenport
9143d291d4 [themes] don't use screenshot transparency in shipped themes 2022-12-31 00:23:48 +01:00
Dave Davenport
9da2c12c8a [IconFetcher] Fix for api change 2022-12-30 15:01:17 +01:00
Dave Davenport
d464822505 [Theme] support rasinc for theme include files. 2022-12-30 11:54:15 +01:00
Dave Davenport
d47b1515b5 [listview] Don't calculate infinite rows on empty height.
Issue: #1769
2022-12-29 18:41:51 +01:00
TonCherAmi
34810e72be [CI] Maintenance. (#1767)
* [CI] Bump actions/upload-artifact version.

* [CI] Bump actions/checkout version.

* [CI] Bump actions/setup-python version.

* [CI] Adjust doxy redirection order.
2022-12-25 13:02:44 +01:00
Dave Davenport
09b9039718 [Theme] Move some definitions header around for plugin. 2022-12-24 11:46:03 +01:00
Dave Davenport
3d73cf2554 [Textbox] Cursor goes over, not under. allow cursor outline. 2022-12-23 22:11:22 +01:00
Dave Davenport
0ff6ff21c3 [Textbox] Add text-outline to style 2022-12-23 13:38:09 +01:00
Dave Davenport
a1943bab1f [Doc] Clarify documentation on require-input further. 2022-12-20 21:21:14 +01:00
Dave Davenport
356e9a98bb [Doc] Clarify that require-input only hides it. 2022-12-20 16:35:47 +01:00
vE5li
23de9e9d2c make cursor more customizable by adding cursor-width and cursor-color (#1753)
* make cursor more customizable by adding cursor-width and cursor-color to the theme

* fix placeholder color

* add doc entry

* more documentation
2022-11-25 10:28:34 +01:00
Dave Davenport
54aa148a5e [XIM] Fix an unitialized value problem. 2022-11-21 21:15:51 +01:00
Martin Weinelt
ee2ab5b7f9 [Doc] Add example run command with cgroup support (#1752)
Adds an example command to launch processes via systemd-run into a
dedicated systemd scope within the users slice, which allows using
systemd-oomd, that evaluates memory consumption on a per cgroup basis.

The systemd-run arguments are chosen in alignment with systemds
desktop environment integration recommendations¹.

[1] https://systemd.io/DESKTOP_ENVIRONMENTS/

Co-Authored-By: Dave Davenport <qball@blame.services>

Co-authored-by: Dave Davenport <qball@blame.services>
2022-11-21 17:20:11 +01:00
Dave Davenport
ffe3289999 [Build] Fix test building in makefile. 2022-11-19 22:04:25 +01:00
Dave Davenport
bdeede53e4 [Doc] Add documentation for new functions. 2022-11-19 21:56:12 +01:00
Dave Davenport
d9935e594e [Doc] Fix some missing docu. 2022-11-19 21:50:34 +01:00
Dave Davenport
063195922f [DMenu] Add -ellipsize-mode option. 2022-11-19 21:03:22 +01:00
Dave Davenport
66d782e0e7 Move config.h
small updates

Tweak header a bit

[CI] Add lto build to sh ci.

[CI] Fix artifact upload

[CI] no wildcard for artifact
2022-11-19 20:35:52 +01:00
Dave Davenport
30d50e3bdc Move doxy-coverage to davatorium version 2022-11-18 17:02:42 +01:00
Dave Davenport
c6ba962673 [listview] Set ellipsize mode on creation of textbox
So if rows are added, they behave correctily.

Issue: #1746
2022-11-18 08:46:16 +01:00
Dave Davenport
96e81d1b56 Disable imdkit by default 2022-11-17 17:49:16 +01:00
cognitiond
0bbccc3137 Build documentation (#1744)
* explain how to pass options to meson

* fix typo in INSTALL.md
2022-11-17 15:36:13 +01:00
Dave Davenport
c9faa69a1b [Build] Use built-in lto option. 2022-11-17 12:13:14 +01:00
Dave Davenport
c82754307c [Window] Fix reloading windowcd from xserver request 2022-11-17 12:03:01 +01:00
Dave Davenport
fb80595725 [Build] Add option to build with lto to meson.
Fix error in test.

Issue: #1743
2022-11-17 11:25:45 +01:00
Dave Davenport
53391da45a [Build] Add option to disable imdkit at compile time.
Issue: #1742
2022-11-15 17:18:51 +01:00
Dave Davenport
690924c270 [Doc] Update support links.
Remove reddit.
2022-11-11 21:53:20 +01:00
duarm
6d02648d3a input method (#1735)
* input method draft

* restoring relese event

* using unused macro, removing debug code, handling disconnection

* review fixes, new update_im_window_pos method

* initializing variables correctly

* initializing im pos queue correctly

* ime window positioning

* add widget_get_y_pos() position

* [Build] Update makefile with imdkit

* [CI] Add imdkit as dependency.

* [XCB] rofi_view_paste don't throw warning, print debug.

* [XCB] rofi_view_paste lower 'failed to convert selection'

* [Build] Add minimum version check to imdkit

* new macro XCB_IMDKIT_1_0_3_LOWER

* [Build] Try to support old version of imdkit in meson/makefile.

* [Build] Fix typo in meson.build

* [XIM] Don't set use compound/set use utf8 when on old version.

* [Build] Allow building without imdkit.

* [Doc] Add imdkit to dependency list.

Co-authored-by: Dave Davenport <qball@gmpclient.org>
2022-11-08 19:18:45 +01:00
Dave Davenport
579902deff [Window] Make sure their is a trailing 0 on the workspace strings.
Issue: #1739
2022-11-02 20:15:38 +01:00
Dave Davenport
804eb908bd [FileBrowser] Bind kb-delete-entry to toggle show-hidden. 2022-10-31 21:28:17 +01:00
Dave Davenport
62ebb863ed [Textbox] Add a 'get_cursor_x_pos' function. 2022-10-27 22:22:11 +02:00
Dave Davenport
3d3af82b54 [man] re-gen manpage. 2022-10-25 19:14:54 +02:00
Fabian Winter
fba6aee46d [DOC] Add parsing row options to dmenu manpage (#1734) 2022-10-25 19:14:25 +02:00
Dave Davenport
cf2cf27336 [Build] Fix icon install path for makefile.
fixes: #1733
2022-10-24 19:20:03 +02:00
Dave Davenport
60fcbbb10e [Window] Small fixes to prefer-icon-theme option
Thanks to Kafva (https://github.com/Kafva) for the original patch.

Issue: #1702
2022-10-22 11:10:35 +02:00
Dave Davenport
96a69a54c3 [Window] Add -window-prefer-icon-theme option.
Fixes: #1702
2022-10-22 11:03:11 +02:00
Dave Davenport
baba41cbd2 [drun] Only pass path on launch, if one is set 2022-10-13 20:26:00 +02:00
aloispichler
19de3075e7 The mode is filebrowser (not file-browser) (#1723) 2022-10-11 22:13:07 +02:00
Dave Davenport
fedd6be715 [DOC] Rerun update-manpages. 2022-10-11 16:10:48 +02:00
Dimitris Triantafyllidis
c1a540c57e [filebrowser] Add an option to show hidden files. (#1716)
Add an option to show hidden files by looking up the "show-hidden" filebrowser property and modifying the relevant logic in "filebrowser.c".

Co-authored-by: Dave Davenport <DaveDavenport@users.noreply.github.com>
2022-10-11 16:04:18 +02:00
Dave Davenport
0ed09e6b5e gitmodules: fix submodule again. 2022-10-11 09:27:47 +02:00
Dave Davenport
524d804663 [Doc] Update rofi-keys manpage with unset section 2022-10-11 09:19:35 +02:00
284 changed files with 45943 additions and 8302 deletions

View File

@@ -2,6 +2,8 @@ image: ubuntu/lts
packages: packages:
- meson - meson
- ninja-build - ninja-build
- autoconf
- automake
- build-essential - build-essential
- libpango1.0-dev - libpango1.0-dev
- libstartup-notification0-dev - libstartup-notification0-dev
@@ -13,10 +15,14 @@ packages:
- libxcb-xkb-dev - libxcb-xkb-dev
- libxcb-xrm-dev - libxcb-xrm-dev
- libxcb-cursor-dev - libxcb-cursor-dev
- libxcb-imdkit-dev
- libxcb-keysyms1
- libxkbcommon-dev - libxkbcommon-dev
- libxkbcommon-dev - libxkbcommon-dev
- libxkbcommon-x11-dev - libxkbcommon-x11-dev
- libgdk-pixbuf2.0-dev - libgdk-pixbuf2.0-dev
- ninja-build
- pandoc
- check - check
- flex - flex
- bison - bison
@@ -27,7 +33,7 @@ sources:
tasks: tasks:
- setup: | - setup: |
cd rofi cd rofi
meson setup builddir . meson setup builddir . -Db_lto=true
- build: | - build: |
ninja -C rofi/builddir ninja -C rofi/builddir
- test: | - test: |
@@ -38,4 +44,4 @@ tasks:
- dist: | - dist: |
ninja -C rofi/builddir dist ninja -C rofi/builddir dist
artifacts: artifacts:
- rofi/builddir/meson-dist/rofi-1.7.3-dev.tar.xz - rofi/builddir/meson-dist/rofi-1.7.8-dev.tar.xz

12
.gitattributes vendored
View File

@@ -1,9 +1,11 @@
*gitignore export-ignore .build.yml export-ignore
.gitattributes export-ignore .gitattributes export-ignore
.gitmodules export-ignore .gitignore export-ignore
.gitlab-ci.yml export-ignore .mailmap export-ignore
.travis.yml export-ignore
.github export-ignore .github export-ignore
.gitlab-ci.yml export-ignore
.gitmodules export-ignore
.travis.yml export-ignore
releasenotes export-ignore releasenotes export-ignore
doc/*.png export-ignore doc/*.png export-ignore
doc/help-output.txt export-ignore doc/help-output.txt export-ignore
@@ -12,5 +14,5 @@ doc/Notes export-ignore
doc/old-theme-convert-output.rasi export-ignore doc/old-theme-convert-output.rasi export-ignore
doc/test_xr.txt export-ignore doc/test_xr.txt export-ignore
doc/create_screenshot.sh export-ignore doc/create_screenshot.sh export-ignore
doc/README.md export-ignore mkdocs export-ignore
script/*.jpg export-ignore script/*.jpg export-ignore

View File

@@ -79,6 +79,6 @@ For example, should it be a configuration option or a hot-key.
Requesting a feature is no guarantee it will be added. Requesting a feature is no guarantee it will be added.
**Please do not submit reports related to wayland, see **Please check that you are using this fork when reporting Wayland bugs
[here](https://github.com/DaveDavenport/rofi/wiki/Wayland) for more and do not report them to upstream Rofi,
information.** [here](https://github.com/DaveDavenport/rofi/wiki/Wayland) for more information.**

View File

@@ -7,13 +7,16 @@ body:
- type: markdown - type: markdown
attributes: attributes:
value: | value: |
First read the [guidelines](https://github.com/DaveDavenport/rofi/blob/next/.github/CONTRIBUTING.md)! This is not optional for any report. People must be able to understand the full context of the report when reading it, at any time. This fork follows the bug report template from upstream rofi with the obvious exception for Wayland-related issues.
Please do NOT report such issues to [upstream rofi](https://github.com/davatorium/rofi/discussions).
First read the [guidelines](https://github.com/lbonn/rofi/blob/next/.github/CONTRIBUTING.md)! This is not optional for any report. People must be able to understand the full context of the report when reading it, at any time.
If you feel like you “it is simple and requires no explanation”, please If you feel like you “it is simple and requires no explanation”, please
consider youre wrong and still fill the full report. Any report consider youre wrong and still fill the full report. Any report
missing required informations will be labeled as “Incomplete Report - missing required informations will be labeled as “Incomplete Report -
Please follow the guidelines” and will be closed. If you ask a Please follow the guidelines” and will be closed. If you ask a
question, enter dummy information in required fields to get passed the question, enter dummy information in required fields to get past the
checks or in general completely ignore the guidelines, the issue will checks or in general completely ignore the guidelines, the issue will
be closed and locked as spam. be closed and locked as spam.
@@ -24,34 +27,36 @@ body:
If you report problems with speed in rofi, attach a [timing If you report problems with speed in rofi, attach a [timing
trace](https://github.com/davatorium/rofi/blob/next/doc/rofi-debugging.5.markdown#timing-traces). trace](https://github.com/davatorium/rofi/blob/next/doc/rofi-debugging.5.markdown#timing-traces).
**Please do not submit reports related to wayland, see
[here](https://github.com/DaveDavenport/rofi/wiki/Wayland) for more
information.**
- type: input - type: input
attributes: attributes:
label: "Rofi version (rofi -v)" label: "Rofi version (rofi -v or git commit in case of build issue)"
placeholder: "Version: 1.7.5" placeholder: "Version: 1.7.5"
validations: validations:
required: true required: true
- type: input - type: input
attributes: attributes:
label: "Configuration" label: "Configuration"
description: "Please use https://gist.github.com and include output of `rofi -dump-config`." description: |
Please use https://gist.github.com and include output of `rofi -dump-config`.
n/a is not a valid config.
placeholder: "Gist URL" placeholder: "Gist URL"
validations: validations:
required: true required: true
- type: input - type: input
attributes: attributes:
label: "Theme" label: "Theme"
description: "Please use https://gist.github.com and include output of `rofi -dump-theme`." description: |
Please use https://gist.github.com and include output of `rofi -dump-theme`.
n/a is not a valid theme.
placeholder: "Gist URL" placeholder: "Gist URL"
validations: validations:
required: true required: true
- type: input - type: input
attributes: attributes:
label: "Timing report" label: "Timing report"
description: "Please use https://gist.github.com and include output of your command with G_MESSAGES_DEBUG=Timings set." description: |
Please use https://gist.github.com and include output of your command with G_MESSAGES_DEBUG=Timings set.
placeholder: "Gist URL" placeholder: "Gist URL"
validations: validations:
required: false required: false
@@ -88,5 +93,19 @@ body:
label: "Additional information" label: "Additional information"
validations: validations:
required: false required: false
- type: checkboxes
id: wayland
attributes:
label: Using wayland display server protocol
description: I have checked and confirm that I am using [rofi with wayland support enabled](https://github.com/lbonn/rofi)
options:
- label: "Yes, I use rofi with wayland support"
required: true
- type: checkboxes
id: latestversion
attributes:
label: I've checked if the issue exists in the latest stable release
description: I confirm that I verified the issue still exists in the latest stable release.
options:
- label: "Yes, I have checked the problem exists in the latest stable version"
required: false

View File

@@ -1,11 +1 @@
blank_issues_enabled: false blank_issues_enabled: false
contact_links:
- name: discussion forum
url: https://github.com/davatorium/rofi/discussions
about: Please ask and answer questions here.
- name: Rofi subreddit
url: https://www.reddit.com/r/qtools/
about: Please ask and answer questions here.
- name: Rofi IRC channel
url: https://web.libera.chat/?channels=#rofi
about: Please ask and answer question in real time here.

View File

@@ -0,0 +1,81 @@
name: Documentation Bug Report
description: Report a problem in Rofi Documentation
labels: [Documentation]
title: "[Doc] "
body:
- type: markdown
attributes:
value: |
First read the
[guidelines](https://github.com/DaveDavenport/rofi/blob/next/.github/CONTRIBUTING.md)!
This is not optional for any report. People must be able to understand
the full context of the report when reading it, at any time.
If you feel like you “it is simple and requires no explanation”, please
consider youre wrong and still fill the full report. Any report
missing required informations will be labeled as “Incomplete Report -
Please follow the guidelines” and will be closed. If you ask a
question, enter dummy information in required fields to get passed the
checks or in general completely ignore the guidelines, the issue will
be closed and locked as spam.
If you are unsure, please use the
[discussion](https://github.com/davatorium/rofi/discussions) forum
first. It is easy to upgrade a question to an issue in github.
**Please do not submit reports related to wayland, see
[here](https://github.com/DaveDavenport/rofi/wiki/Wayland) for more
information.**
- type: input
attributes:
label: "Rofi version (rofi -v)"
placeholder: "Version: 1.7.5"
validations:
required: true
- type: input
attributes:
label: "URL"
description: "Please provide a link to the relevant documentation."
placeholder: "link to page on https://davatorium.github.io/rofi/ or file on https://github.com/davatorium/rofi/"
validations:
required: true
- type: textarea
attributes:
label: "Explain the issue with the documentation, please be verbose."
placeholder: |
* What am I trying to achieve
..
* What instructions are unclear, wrong or missing
..
* Suggestions for improving the current documentation
..
validations:
required: true
- type: textarea
attributes:
label: "Optional fixed text"
description: "Suggested new and or improved text for documentation."
validations:
required: false
- type: checkboxes
id: wayland
attributes:
label: Using wayland display server protocol
description: I have checked and confirm that my issue is not related to running rofi using wayland as display server protocol. See [here](https://github.com/DaveDavenport/rofi/wiki/Wayland) for more information.
options:
- label: "No, my documentation issue is not about running rofi using the wayland display server protocol"
required: true
- type: checkboxes
id: latestversion
attributes:
label: I've checked if the issue exists in the latest stable release
description: I confirm that I verified the issue still exists in the latest stable release.
options:
- label: "Yes, I have checked the problem exists in the latest stable version"
required: false

View File

@@ -2,6 +2,9 @@ name: Autotools Build
description: Builds Rofi using Autotools description: Builds Rofi using Autotools
inputs: inputs:
do-release:
description: Do a make dist and upload
required: true
cc: cc:
description: Compiler to use description: Compiler to use
required: true required: true
@@ -30,7 +33,7 @@ runs:
run: cd builddir && make distcheck run: cd builddir && make distcheck
shell: bash shell: bash
- id: doxy - id: doxy
run: cd builddir && make doxy 2>&1 > doxygen.log run: cd builddir && make doxy > doxygen.log 2>&1
shell: bash shell: bash
- id: doxycheck - id: doxycheck
uses: ./.github/actions/doxycheck uses: ./.github/actions/doxycheck
@@ -45,9 +48,10 @@ runs:
make make
make check make check
- id: upload - id: upload
uses: actions/upload-artifact@v2 if: ${{ inputs.do-release == 'true' }}
uses: actions/upload-artifact@v4
with: with:
name: tarballs name: tarballs ${{ github.sha }}
path: | path: |
builddir/*.tar.gz builddir/*.tar.gz
builddir/*.tar.xz builddir/*.tar.xz

View File

@@ -20,5 +20,5 @@ runs:
exit 1 exit 1
fi fi
python2 ./doxy-coverage/doxy-coverage.py builddir/doc/html/xml/ python ./doxy-coverage/doxy-coverage.py builddir/doc/html/xml/
shell: bash shell: bash

View File

@@ -8,14 +8,14 @@ runs:
run: meson dist -C builddir --include-subprojects --formats xztar,gztar --no-tests run: meson dist -C builddir --include-subprojects --formats xztar,gztar --no-tests
shell: bash shell: bash
- id: upload - id: upload
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v4
with: with:
name: tarballs name: release_tarballs-${{ github.ref_name }}
path: | path: |
builddir/meson-dist/*.tar.xz builddir/meson-dist/*.tar.xz
builddir/meson-dist/*.tar.gz builddir/meson-dist/*.tar.gz
- id: create_release - id: create_release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v2
with: with:
draft: true draft: true
files: | files: |

View File

@@ -1,11 +1,19 @@
name: CI Build Setup name: CI Build Setup
description: Sets up build dependencies description: Sets up build dependencies
inputs:
xcb:
description: Install xcb dependencies
default: 'true'
wayland:
description: Install wayland dependencies
default: 'true'
runs: runs:
using: composite using: composite
steps: steps:
- id: python - id: python
uses: actions/setup-python@v1 uses: actions/setup-python@v4
with: with:
python-version: '3.x' python-version: '3.x'
- id: apt - id: apt
@@ -21,8 +29,34 @@ runs:
jq \ jq \
lcov \ lcov \
libpango1.0-dev \ libpango1.0-dev \
libstartup-notification0-dev \ libxkbcommon-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libgdk-pixbuf-2.0-dev \
ninja-build \
pandoc \
python3-pip \
python3-setuptools \
python3-wheel \
texi2html \
texinfo \
xdotool \
xfonts-base \
xterm \
xutils-dev
shell: bash
- id: apt-wayland
if: ${{ inputs.wayland == 'true' }}
run: |
sudo apt-get install -y \
libwayland-dev \ libwayland-dev \
wayland-protocols
shell: bash
- id: apt-xcb
if: ${{ inputs.xcb == 'true' }}
run: |
sudo apt-get install -y \
libstartup-notification0-dev \
libxcb-ewmh-dev \ libxcb-ewmh-dev \
libxcb-icccm4-dev \ libxcb-icccm4-dev \
libxcb-randr0-dev \ libxcb-randr0-dev \
@@ -31,20 +65,7 @@ runs:
libxcb-xkb-dev \ libxcb-xkb-dev \
libxcb-xrm-dev \ libxcb-xrm-dev \
libxcb-cursor-dev \ libxcb-cursor-dev \
libxkbcommon-dev \ libxcb-imdkit-dev
libxkbcommon-dev \
libxkbcommon-x11-dev \
ninja-build \
python3-pip \
python3-setuptools \
python3-wheel \
texi2html \
texinfo \
wayland-protocols \
xdotool \
xfonts-base \
xterm \
xutils-dev
shell: bash shell: bash
- id: check - id: check
run: | run: |

View File

@@ -18,7 +18,7 @@ jobs:
build-meson-gcc: build-meson-gcc:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
submodules: recursive submodules: recursive
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
@@ -28,7 +28,7 @@ jobs:
build-meson-clang: build-meson-clang:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
submodules: recursive submodules: recursive
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
@@ -38,10 +38,12 @@ jobs:
build-meson-gcc-wayland: build-meson-gcc-wayland:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
submodules: recursive submodules: recursive
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
with:
xcb: false
- uses: ./.github/actions/meson - uses: ./.github/actions/meson
with: with:
cc: gcc cc: gcc
@@ -49,10 +51,12 @@ jobs:
build-meson-gcc-xcb: build-meson-gcc-xcb:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
with:
wayland: false
- uses: ./.github/actions/meson - uses: ./.github/actions/meson
with: with:
cc: gcc cc: gcc

57
.github/workflows/codeql.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: "CodeQL"
on:
push:
branches: [ 'next', 'master' ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ 'next' ]
schedule:
- cron: '59 13 * * 3'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- uses: ./.github/actions/setup
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- uses: ./.github/actions/meson
with:
cc: gcc
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

20
.github/workflows/mkdocs.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Publish docs via GitHub Pages
on:
push:
branches:
- sphinx
- next
jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v1
- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
CONFIG_FILE: mkdocs/mkdocs.yml
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

4
.gitignore vendored
View File

@@ -1,4 +1,6 @@
/build/ /build*/
/.cache/
/.vscode/
# autotools generated files # autotools generated files
/missing /missing

134
CONFIG.md
View File

@@ -1,42 +1,32 @@
> # :warning: This page does not describe all of **ROFI**'s configuration options, just the most common usecase. For the full configuration options, check the manpages. > This page does not describe all of **ROFI**'s configuration options, just the
> most common usecase. For the full configuration options, check the manpages.
<br /> <br />
## Where does the configuration live
## :exclamation: Upgrade from old configuration format to new :exclamation:
In release after '2 Jan 2020' you can convert to the new configuration format by using the following command: Rofi's configurations, custom themes live in `${XDG_CONFIG_HOME}/rofi/`, on
most systems this is `~/.config/rofi/`.
```bash
rofi -upgrade-config
```
This will create `~/.config/rofi/config.rasi` (or the default location for your system) with the previously configured options.
From 1.7.0 the old configuration format is no longer supported and the `-upgrade-config` option is no longer available.
<br />
# Where does the configuration live
Rofi's configurations, custom themes live in `${XDG_CONFIG_HOME}/rofi/`, on most systems this is `~/.config/rofi/`.
The name of the main configuration file is `config.rasi`. (`~/.config/rofi/config.rasi`). The name of the main configuration file is `config.rasi`. (`~/.config/rofi/config.rasi`).
# Create an empty configuration file ## Create an empty configuration file
Open `~/.config/rofi/config.rasi` in your favorite text editor and add the following block: Open `~/.config/rofi/config.rasi` in your favorite text editor and add the
following block:
```css ```css
configuration { configuration {
} }
``` ```
You can now set the options in the `configuration` block.
# Create a configuration file from current setup You can now set the options in the `configuration` block.
If you do not want to start from scratch, or want to migrate from older configuration format, you can get tell rofi to dumps it configuration: ## Create a configuration file from current setup
If you do not want to start from scratch, or want to migrate from older
configuration format, you can get tell rofi to dumps it configuration:
```bash ```bash
rofi -dump-config > ~/.config/rofi/config.rasi rofi -dump-config > ~/.config/rofi/config.rasi
@@ -46,6 +36,7 @@ This will have all the possible settings and their current value.
If a value is the default value, the entry will be commented. If a value is the default value, the entry will be commented.
For example: For example:
```css ```css
configuration { configuration {
/* modes: "window,run,ssh,drun";*/ /* modes: "window,run,ssh,drun";*/
@@ -62,60 +53,68 @@ configuration {
} }
``` ```
# Configuration file format To create a copy of the current theme, you can run:
## Encoding ```bash
rofi -dump-theme > ~/.config/rofi/current.rasi
```
The encoding of the file is utf-8. Both Unix (`\n`) and windows (`\r\n`) newlines format are supported. But Unix is preferred. ## Configuration file format
## Comments ### Encoding
The encoding of the file is utf-8. Both Unix (`\n`) and windows (`\r\n`)
newlines format are supported. But Unix is preferred.
### Comments
C and C++ file comments are supported. C and C++ file comments are supported.
* Anything after `// ` and before a newline is considered a comment. - Anything after `//` and before a newline is considered a comment.
* Everything between `/*` and `*/` is a comment. - Everything between `/*` and `*/` is a comment.
Comments can be nested and the C comments can be inline. Comments can be nested and the C comments can be inline.
The following is valid: The following is valid:
``` ```css
// Magic comment. // Magic comment.
property: /* comment */ value; property: /* comment */ value;
``` ```
However, this is not: However, this is not:
``` ```css
prop/*comment*/erty: value; prop/*comment*/erty: value;
``` ```
## White space ### White space
White space and newlines, like comments, are ignored by the parser. White space and newlines, like comments, are ignored by the parser.
This: This:
``` ```css
property: name; property: name;
``` ```
Is identical to: Is identical to:
``` ```css
property : property :
name name
; ;
``` ```
## Data types ### Data types
**ROFI**'s configuration supports several data formats: **ROFI**'s configuration supports several data formats:
### String #### String
A string is always surrounded by double quotes (`"`). Between the quotes there can be any printable character. A string is always surrounded by double quotes (`"`). Between the quotes there
can be any printable character.
For example: For example:
@@ -124,17 +123,17 @@ For example:
ml-row-down: "ScrollDown"; ml-row-down: "ScrollDown";
``` ```
### Number #### Number
An integer may contain any full number. An integer may contain any full number.
For example:
```
eh: 2;
```
### Boolean For example:
```css
eh: 2;
```
#### Boolean
Boolean value is either `true` or `false`. This is case-sensitive. Boolean value is either `true` or `false`. This is case-sensitive.
@@ -144,48 +143,44 @@ For example:
show-icons: true; show-icons: true;
``` ```
This is equal to the `-show-icons` option on the commandline, and `show-icons: false;` is equal to `-no-show-icons`. This is equal to the `-show-icons` option on the commandline, and `show-icons:
false;` is equal to `-no-show-icons`.
### Character #### List
Character value is always surrounded by single quotes (') and should contain a single character. This is not supported by the old configuration system, but can be used in the
It supports escaping. **rasi** format.
```css A list starts with a '[' and ends with a ']'. The entries in the list are
matching-negate-char: '-'; comma-separated. The entry in the list single ASCII words.
```
### List
This is not supported by the old configuration system, but can be used in the **rasi** format.
A list starts with a '[' and ends with a ']'. The entries in the list are comma-separated.
The entry in the list single ASCII words.
```css ```css
combi-modes: [window,drun]; combi-modes: [window,drun];
``` ```
For older versions you have : For older versions you have :
```css ```css
combi-modes: "window,drun"; combi-modes: "window,drun";
``` ```
# Get a list of all possible options ## Get a list of all possible options
There are 2 ways to get a list of all options: There are 2 ways to get a list of all options:
1. Dump the configuration file explained above. (`rofi -dump-config`) 1. Dump the configuration file explained above. (`rofi -dump-config`)
2. Look at output of `rofi -h`. 1. Look at output of `rofi -h`.
To see what values an option support check the manpage, it describes most of them. To see what values an option support check the manpage, it describes most of
them.
NOTE: not all options might be in the manpage, as options can be added at run-time. (f.e. by plugins). NOTE: not all options might be in the manpage, as options can be added at
run-time. (f.e. by plugins).
## Splitting configuration over multiple files
# Splitting configuration over multiple files It is possible to split configuration over multiple files using imports. For
example in `~/.config/rofi/config.rasi`
It is possible to split configuration over multiple files using imports. For example in `~/.config/rofi/config.rasi`
```css ```css
configuration { configuration {
@@ -195,6 +190,7 @@ configuration {
``` ```
Rofi will first parse the config block in `~/.config/rofi/config.rasi`, then parse `~/.config/rofi/myConfig.rasi` and then load the theme `myTheme`.\ Rofi will first parse the config block in `~/.config/rofi/config.rasi`, then
More information can be obtained from **Themes** section\ parse `~/.config/rofi/myConfig.rasi` and then load the theme `myTheme`. More
Imports can be nested. information can be obtained from the **rofi-theme(5)** manpage. Imports can be
nested.

View File

@@ -1,5 +1,5 @@
MIT/X11 License MIT/X11 License
Modified 2013-2022 Qball Cow <qball@gmpclient.org> Modified 2013-2024 Qball Cow <qball@gmpclient.org>
Copyright (c) 2012 Sean Pringle <sean.pringle@gmail.com> Copyright (c) 2012 Sean Pringle <sean.pringle@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining

View File

@@ -1,3 +1,5 @@
For newer release ChangeLogs please see the releasenotes.
v1.7.3: Sturtled! v1.7.3: Sturtled!
- [Help] Print out the parsed config/theme files in -help output. - [Help] Print out the parsed config/theme files in -help output.
- [Keybindings] Fix keybindings being modified by -theme-str - [Keybindings] Fix keybindings being modified by -theme-str

View File

@@ -1,31 +1,29 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [ "$*" = "quit" ] if [ "$*" = "quit" ]; then
then exit 0
exit 0
fi fi
if [ "$@" ] if [ "$@" ]; then
then # Override the previously set prompt.
# Override the previously set prompt. echo -en "\x00prompt\x1fChange prompt\n"
echo -en "\x00prompt\x1fChange prompt\n" for a in {1..10}; do
for a in {1..10} echo "$a"
do done
echo "$a" echo "quit"
done
echo "quit"
else else
echo -en "\x00prompt\x1ftesting\n" echo -en "\x00prompt\x1ftesting\n"
echo -en "\0urgent\x1f0,2\n" echo -en "\0urgent\x1f0,2\n"
echo -en "\0active\x1f1\n" echo -en "\0active\x1f1\n"
echo -en "\0markup-rows\x1ftrue\n" echo -en "\0markup-rows\x1ftrue\n"
echo -en "\0message\x1fSpecial <b>bold</b>message\n" echo -en "\0message\x1fSpecial <b>bold</b>message\n"
echo -en "aap\0icon\x1ffolder\n" echo -en "aap\0icon\x1ffolder\n"
echo "noot" echo -en "blob\0icon\x1ffolder\x1fdisplay\x1fblub\n"
echo "mies" echo "noot"
echo -en "-------------\0nonselectable\x1ftrue\n" echo "mies"
echo "testing" echo -en "-------------\0nonselectable\x1ftrue\x1fpermanent\x1ftrue\n"
echo "<b>Bold</b>" echo "testing"
echo "quit" echo "<b>Bold</b>"
echo "quit"
fi fi

View File

@@ -8,7 +8,7 @@ fi
if [ "$@" ] if [ "$@" ]
then then
# Override the previously set prompt. # Override the previously set prompt.
echo -en "\0theme\x1felement-text { background-color: "$@";}\n" echo -en "\0theme\x1felement-text { background-color: $@;}\n"
echo -en "\0keep-selection\x1ftrue\n" echo -en "\0keep-selection\x1ftrue\n"
# echo -en "\0new-selection\x1f2\n" # echo -en "\0new-selection\x1f2\n"
echo "red" echo "red"

View File

@@ -1,16 +1,17 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [ "$@" = "quit" ] if [[ "$@" = "quit" ]]
then then
exit 0 exit 0
fi fi
# Override the previously set prompt. # Override the previously set prompt.
# We only want to do this on first call of script. # We only want to do this on first call of script.
if [ $ROFI_RETV = 0 ] if [[ $ROFI_RETV = 0 ]]
then then
echo -en "\x00delim\x1f\\x1\n" echo -en "\x00delim\x1f\\x1\n"
fi fi
echo -en "\x00message\x1fmy line1\nmyline2\nmy line3\x1"
echo -en "\x00prompt\x1fChange prompt\x1" echo -en "\x00prompt\x1fChange prompt\x1"
for a in {1..10} for a in {1..10}
do do

View File

@@ -1,6 +1,7 @@
# Installation guide # Installation guide
This guide explains how to install rofi using its build system and how you can make debug builds. This guide explains how to install rofi using its build system and how you can
make debug builds.
Rofi uses autotools (GNU Build system), for more information see Rofi uses autotools (GNU Build system), for more information see
[here](https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html). [here](https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html).
@@ -8,40 +9,64 @@ You can also use [Meson](https://mesonbuild.com/) as an alternative.
## DEPENDENCY ## DEPENDENCY
### For building: ### For building
* C compiler that supports the c99 standard. (gcc or clang) - C compiler that supports the c99 standard. (gcc or clang)
* make
* autoconf - make
* automake (1.11.3 or up)
* pkg-config - autoconf
* flex 2.5.39 or higher
* bison - automake (1.11.3 or up)
* check (Can be disabled using the `--disable-check` configure flag)
- pkg-config
- flex 2.5.39 or higher
- bison
- check (Can be disabled using the `--disable-check` configure flag)
check is used for build-time tests and does not affect functionality. check is used for build-time tests and does not affect functionality.
* Developer packages of the external libraries
* glib-compile-resources - Developer packages of the external libraries
- glib-compile-resources
### External libraries ### External libraries
* libpango >= 1.50 - libpango >= 1.50
* libpangocairo
* libcairo
* libcairo-xcb
* libglib2.0 >= 2.68
* gmodule-2.0
* gio-unix-2.0
* libgdk-pixbuf-2.0
* libstartup-notification-1.0
* libxkbcommon >= 0.4.1
* libxkbcommon-x11
* libxcb (sometimes split, you need libxcb, libxcb-xkb and libxcb-randr libxcb-xinerama)
* xcb-util
* xcb-util-wm (sometimes split as libxcb-ewmh and libxcb-icccm)
* xcb-util-cursor
On debian based systems, the developer packages are in the form of: `<package>-dev` on rpm based - libpangocairo
`<package>-devel`.
- libcairo
- libcairo-xcb
- libglib2.0 >= 2.72
- gmodule-2.0
- gio-unix-2.0
- libgdk-pixbuf-2.0
- libstartup-notification-1.0
- libxkbcommon >= 0.4.1
- libxkbcommon-x11
- libxcb (sometimes split, you need libxcb, libxcb-xkb and libxcb-randr
libxcb-xinerama)
- xcb-util
- xcb-util-wm (sometimes split as libxcb-ewmh and libxcb-icccm)
- xcb-util-cursor
- xcb-imdkit (optional, 1.0.3 or up preferred)
On debian based systems, the developer packages are in the form of:
`<package>-dev` on rpm based `<package>-devel`.
For wayland support: For wayland support:
@@ -50,98 +75,136 @@ For wayland support:
## Install from a release ## Install from a release
When downloading from the github release page, make sure to grab the archive
`rofi-{version}.tar.[g|x]z`. The auto-attached files `source code (zip|tar.gz)`
by github do not contain a valid release. It misses a setup build system and
includes irrelevant files.
### Autotools ### Autotools
Create a build directory and enter it: Create a build directory and enter it:
```bash
mkdir build && cd build mkdir build && cd build
```
Check dependencies and configure build system: Check dependencies and configure build system:
```bash
../configure ../configure
```
Build Rofi: Build Rofi:
```bash
make make
```
The actual install, execute as root (if needed): The actual install, execute as root (if needed):
```bash
make install make install
```
The default installation prefix is: `/usr/local/` use `./configure --prefix={prefix}` to install into another location. The default installation prefix is: `/usr/local/` use `./configure
--prefix={prefix}` to install into another location.
### Meson ### Meson
Check dependencies and configure build system: Check dependencies and configure build system:
```bash
meson setup build meson setup build
```
Build Rofi: Build Rofi:
```bash
ninja -C build ninja -C build
```
The actual install, execute as root (if needed): The actual install, execute as root (if needed):
```bash
ninja -C build install ninja -C build install
```
The default installation prefix is: `/usr/local/` use `meson setup build --prefix={prefix}` to install into another location. The default installation prefix is: `/usr/local/` use `meson setup build
--prefix={prefix}` to install into another location.
## Install a checkout from git ## Install a checkout from git
The GitHub Pages version of these directions may be out of date. Please use The GitHub Pages version of these directions may be out of date. Please use
[INSTALL.md from the online repo][master-install] or your local repository. [INSTALL.md from the online repo][master-install] or your local repository.
[master-install]: https://github.com/DaveDavenport/rofi/blob/master/INSTALL.md#install-a-checkout-from-git
If you don't have a checkout: If you don't have a checkout:
git clone --recursive https://github.com/DaveDavenport/rofi ```bash
git clone --recursive https://github.com/lbonn/rofi
cd rofi/ cd rofi/
```
If you already have a checkout: If you already have a checkout:
```bash
cd rofi/ cd rofi/
git pull git pull
git submodule update --init git submodule update --init
```
For Autotools you have an extra step, to generate build system: For Autotools you have an extra step, to generate build system:
```bash
autoreconf -i autoreconf -i
```
From this point, use the same steps you use for a release. From this point, use the same steps you use for a release.
## Options for configure ## Options for configure
When you run the configure step there are several options you can configure. When you run the configure step there are several options you can configure.
For Autotools, you can see the full list with `./configure --help`. For Autotools, you can see the full list with `./configure --help`.
For Meson, before the initial setup, you can see rofi options in `meson_options.txt` and Meson options with `meson setup --help`.
After the initial setup, use `meson configure build`.
The most useful one to set the installation prefix: For Meson, before the initial setup, you can see rofi options in
`meson_options.txt` and Meson options with `meson setup --help`. Meson's
built-in options can be set using regular command line arguments, like so:
`meson setup build --option=value`. Rofi-specific options can be set using the
`-D` argument, like so: `meson setup build -Doption=value`. After the build dir
is set up by `meson setup build`, the `meson configure build` command can be
used to configure options, by the same means.
The most useful one to set is the installation prefix:
```bash
# Autotools # Autotools
../configure --prefix=<installation path> ../configure --prefix=<installation path>
# Meson # Meson
meson setup build --prefix <installation path> meson setup build --prefix <installation path>
```
f.e. f.e.
```bash
# Autotools # Autotools
../configure --prefix=/usr/ ../configure --prefix=/usr/
# Meson # Meson
meson setup build --prefix /usr meson setup build --prefix /usr
```
### Install locally ### Install locally
or to install locally: or to install locally:
```bash
# Autotools # Autotools
../configure --prefix=${HOME}/.local/ ../configure --prefix=${HOME}/.local/
# Meson # Meson
meson setup build --prefix ${HOME}/.local meson setup build --prefix ${HOME}/.local
```
## Options for make ## Options for make
@@ -151,38 +214,47 @@ When you run make you can tweak the build process a little.
Show the commands called: Show the commands called:
```bash
# Autotools # Autotools
make V=1 make V=1
# Meson # Meson
ninja -C build -v ninja -C build -v
```
### Debug build ### Debug build
Compile with debug symbols and no optimization, this is useful for making backtraces: Compile with debug symbols and no optimization, this is useful for making
backtraces:
```bash
# Autotools # Autotools
make CFLAGS="-O0 -g3" clean rofi make CFLAGS="-O0 -g3" clean rofi
# Meson # Meson
meson configure build --debug meson configure build --debug
ninja -C build ninja -C build
```
### Get a backtrace ### Get a backtrace
Getting a backtrace using GDB is not very handy. Because if rofi get stuck, it grabs keyboard and Getting a backtrace using GDB is not very handy. Because if rofi get stuck, it
mouse. So if it crashes in GDB you are stuck. grabs keyboard and mouse. So if it crashes in GDB you are stuck. The best way
The best way to go is to enable core file. (ulimit -c unlimited in bash) then make rofi crash. You to go is to enable core file. (ulimit -c unlimited in bash) then make rofi
can then load the core in GDB. crash. You can then load the core in GDB.
```bash
# Autotools # Autotools
gdb rofi core gdb rofi core
# Meson (because it uses a separate build directory) # Meson (because it uses a separate build directory)
gdb build/rofi core gdb build/rofi core
```
> Where the core file is located and what its exact name is different on each distributions. Please consult the > Where the core file is located and what its exact name is different on each
> relevant documentation. > distributions. Please consult the relevant documentation.
For more information see the rofi-debugging(5) manpage.
## Install distribution ## Install distribution
@@ -198,12 +270,18 @@ https://pkgs.alpinelinux.org/packages?name=rofi-wayland
### ArchLinux ### ArchLinux
https://aur.archlinux.org/packages/rofi-lbonn-wayland-git/ https://archlinux.org/packages/extra/x86_64/rofi-wayland
### Fedora ### Fedora
https://packages.fedoraproject.org/pkgs/rofi-wayland/rofi-wayland/ https://packages.fedoraproject.org/pkgs/rofi-wayland/rofi-wayland/
### Gentoo
`gui-apps/rofi-wayland` exists in the [GURU](https://wiki.gentoo.org/wiki/Project:GURU/Information_for_End_Users) overlay.
https://gitweb.gentoo.org/repo/proj/guru.git/tree/gui-apps/rofi-wayland
### NixOS ### NixOS
rofi-wayland is integrated in nixpkgs master ([PR](https://github.com/NixOS/nixpkgs/pull/150169)) rofi-wayland is integrated in nixpkgs master ([PR](https://github.com/NixOS/nixpkgs/pull/150169))

View File

@@ -89,6 +89,7 @@ SOURCES=\
source/modes/script.c\ source/modes/script.c\
source/modes/help-keys.c\ source/modes/help-keys.c\
source/modes/filebrowser.c\ source/modes/filebrowser.c\
source/modes/recursivebrowser.c\
include/display.h\ include/display.h\
include/xcb.h\ include/xcb.h\
include/xcb-internal.h\ include/xcb-internal.h\
@@ -126,6 +127,7 @@ SOURCES=\
include/modes/modes.h\ include/modes/modes.h\
include/modes/help-keys.h\ include/modes/help-keys.h\
include/modes/filebrowser.h\ include/modes/filebrowser.h\
include/modes/recursivebrowser.h\
include/modes/dmenuscriptshared.h\ include/modes/dmenuscriptshared.h\
resources/resources.c\ resources/resources.c\
resources/resources.h resources/resources.h
@@ -145,6 +147,7 @@ rofi_CFLAGS=\
$(libsn_CFLAGS)\ $(libsn_CFLAGS)\
$(cairo_CFLAGS)\ $(cairo_CFLAGS)\
$(gdkpixbuf_CFLAGS)\ $(gdkpixbuf_CFLAGS)\
$(imdclient_CFLAGS)\
-DMANPAGE_PATH="\"$(mandir)/\""\ -DMANPAGE_PATH="\"$(mandir)/\""\
-I$(top_srcdir)/include/\ -I$(top_srcdir)/include/\
-I$(top_builddir)/lexer/\ -I$(top_builddir)/lexer/\
@@ -165,25 +168,65 @@ rofi_LDADD=\
$(pango_LIBS)\ $(pango_LIBS)\
$(cairo_LIBS)\ $(cairo_LIBS)\
$(gdkpixbuf_LIBS)\ $(gdkpixbuf_LIBS)\
$(imdclient_LIBS)\
$(LIBS) $(LIBS)
## ##
# Manpage # Manpages
## ##
.PHONY: generate-manpage
if FOUND_PANDOC
generate-manpage: doc/rofi.1\
doc/rofi-sensible-terminal.1\
doc/rofi-theme-selector.1\
doc/rofi-actions.5\
doc/rofi-debugging.5\
doc/rofi-dmenu.5\
doc/rofi-keys.5\
doc/rofi-script.5\
doc/rofi-theme.5 \
doc/rofi-thumbnails.5
doc/rofi.1: doc/rofi.1.markdown
pandoc --standalone --to=man --lua-filter=$(top_srcdir)/doc/man_filter.lua -f markdown-tex_math_dollars -o ./$@ ./$<
doc/rofi-sensible-terminal.1: doc/rofi-sensible-terminal.1.markdown
pandoc --standalone --to=man --lua-filter=$(top_srcdir)/doc/man_filter.lua -f markdown-tex_math_dollars -o ./$@ ./$<
doc/rofi-theme-selector.1: doc/rofi-theme-selector.1.markdown
pandoc --standalone --to=man --lua-filter=$(top_srcdir)/doc/man_filter.lua -f markdown-tex_math_dollars -o ./$@ ./$<
doc/rofi-debugging.5: doc/rofi-debugging.5.markdown
pandoc --standalone --to=man --lua-filter=$(top_srcdir)/doc/man_filter.lua -f markdown-tex_math_dollars -o ./$@ ./$<
doc/rofi-dmenu.5: doc/rofi-dmenu.5.markdown
pandoc --standalone --to=man --lua-filter=$(top_srcdir)/doc/man_filter.lua -f markdown-tex_math_dollars -o ./$@ ./$<
doc/rofi-keys.5: doc/rofi-keys.5.markdown
pandoc --standalone --to=man --lua-filter=$(top_srcdir)/doc/man_filter.lua -f markdown-tex_math_dollars -o ./$@ ./$<
doc/rofi-script.5: doc/rofi-script.5.markdown
pandoc --standalone --to=man --lua-filter=$(top_srcdir)/doc/man_filter.lua -f markdown-tex_math_dollars -o ./$@ ./$<
doc/rofi-theme.5: doc/rofi-theme.5.markdown
pandoc --standalone --to=man --lua-filter=$(top_srcdir)/doc/man_filter.lua -f markdown-tex_math_dollars -o ./$@ ./$<
doc/rofi-thumbnails.5: doc/rofi-thumbnails.5.markdown
pandoc --standalone --to=man --lua-filter=$(top_srcdir)/doc/man_filter.lua -f markdown-tex_math_dollars -o ./$@ ./$<
endif
dist_man1_MANS=\ dist_man1_MANS=\
doc/rofi.1\ doc/rofi.1\
doc/rofi-theme-selector.1\ doc/rofi-sensible-terminal.1\
doc/rofi-sensible-terminal.1 doc/rofi-theme-selector.1
dist_man5_MANS=\ dist_man5_MANS=\
doc/rofi-theme.5\
doc/rofi-debugging.5\ doc/rofi-debugging.5\
doc/rofi-keys.5\
doc/rofi-dmenu.5\ doc/rofi-dmenu.5\
doc/rofi-script.5 doc/rofi-keys.5\
doc/rofi-script.5\
doc/rofi-theme.5\
doc/rofi-thumbnails.5
EXTRA_DIST += \ EXTRA_DIST += \
doc/rofi-theme.5.markdown \ doc/rofi-theme.5.markdown \
doc/rofi-thumbnails.5.markdown \
doc/rofi-debugging.5.markdown \ doc/rofi-debugging.5.markdown \
doc/rofi-script.5.markdown \ doc/rofi-script.5.markdown \
doc/rofi-keys.5.markdown \ doc/rofi-keys.5.markdown \
@@ -212,7 +255,7 @@ theme_DATA=\
themes/dmenu.rasi\ themes/dmenu.rasi\
themes/docu.rasi\ themes/docu.rasi\
themes/glue_pro_blue.rasi\ themes/glue_pro_blue.rasi\
themes/gruvbox-common.rasi\ themes/gruvbox-common.rasinc\
themes/gruvbox-dark-hard.rasi\ themes/gruvbox-dark-hard.rasi\
themes/gruvbox-dark-soft.rasi\ themes/gruvbox-dark-soft.rasi\
themes/gruvbox-dark.rasi\ themes/gruvbox-dark.rasi\
@@ -227,7 +270,10 @@ theme_DATA=\
themes/solarized.rasi\ themes/solarized.rasi\
themes/solarized_alternate.rasi\ themes/solarized_alternate.rasi\
themes/fancy.rasi\ themes/fancy.rasi\
themes/fancy2.rasi\
themes/iggy.rasi\ themes/iggy.rasi\
themes/material.rasi\
themes/fullscreen-preview.rasi\
themes/iggy.jpg themes/iggy.jpg
## ##
@@ -247,19 +293,7 @@ EXTRA_DIST+=\
doc/default_configuration.rasi\ doc/default_configuration.rasi\
doc/default_theme.rasi\ doc/default_theme.rasi\
Changelog Changelog
##
# 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 $(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
go-md2man -in $(top_srcdir)/doc/rofi-sensible-terminal.1.markdown -out $(top_srcdir)/doc/rofi-sensible-terminal.1
## ##
# Rofi test program # Rofi test program
@@ -285,6 +319,7 @@ history_test_CFLAGS=\
$(NKUTILS_CFLAGS)\ $(NKUTILS_CFLAGS)\
$(libsn_CFLAGS)\ $(libsn_CFLAGS)\
$(cairo_CFLAGS)\ $(cairo_CFLAGS)\
$(pango_CFLAGS)\
-DTHEME_DIR=\"$(themedir)\"\ -DTHEME_DIR=\"$(themedir)\"\
-DPLUGIN_PATH=\"${libdir}/rofi\"\ -DPLUGIN_PATH=\"${libdir}/rofi\"\
-I$(top_srcdir)/include/\ -I$(top_srcdir)/include/\
@@ -293,6 +328,7 @@ history_test_CFLAGS=\
history_test_LDADD=\ history_test_LDADD=\
$(glib_LIBS)\ $(glib_LIBS)\
$(pango_LIBS)\
$(NKUTILS_LIBS) $(NKUTILS_LIBS)
history_test_SOURCES=\ history_test_SOURCES=\
@@ -314,6 +350,7 @@ textbox_test_CFLAGS=\
$(cairo_CFLAGS)\ $(cairo_CFLAGS)\
$(libsn_CFLAGS)\ $(libsn_CFLAGS)\
$(gdkpixbuf_CFLAGS)\ $(gdkpixbuf_CFLAGS)\
$(pango_CFLAGS)\
-DPLUGIN_PATH=\"${libdir}/rofi\"\ -DPLUGIN_PATH=\"${libdir}/rofi\"\
-DTHEME_DIR=\"$(themedir)\"\ -DTHEME_DIR=\"$(themedir)\"\
-I$(top_srcdir)/include/\ -I$(top_srcdir)/include/\
@@ -329,6 +366,7 @@ textbox_test_LDADD=\
$(NKUTILS_LIBS)\ $(NKUTILS_LIBS)\
$(GW_XCB_LIBS)\ $(GW_XCB_LIBS)\
$(cairo_LIBS)\ $(cairo_LIBS)\
$(pango_LIBS)\
$(libsn_LIBS) $(libsn_LIBS)
helper_pidfile_CFLAGS=$(textbox_test_CFLAGS) helper_pidfile_CFLAGS=$(textbox_test_CFLAGS)
@@ -626,7 +664,7 @@ coverage-clean:
.PHONY: .FORCE .PHONY: .FORCE
.FORCE: .FORCE:
icondir=$(datadir)/icons/hicolor/apps/ icondir=$(datadir)/icons/hicolor/scalable/apps/
icon_DATA=\ icon_DATA=\
data/rofi.svg data/rofi.svg
@@ -636,6 +674,7 @@ desktop_DATA=\
data/rofi-theme-selector.desktop data/rofi-theme-selector.desktop
EXTRA_DIST += \ EXTRA_DIST += \
doc/man_filter.lua \
doc/meson.build \ doc/meson.build \
subprojects/libgwater/mpd/meson.build \ subprojects/libgwater/mpd/meson.build \
subprojects/libgwater/nl/meson.build \ subprojects/libgwater/nl/meson.build \
@@ -645,6 +684,8 @@ EXTRA_DIST += \
subprojects/libgwater/wayland-server/meson.build \ subprojects/libgwater/wayland-server/meson.build \
subprojects/libgwater/meson.build \ subprojects/libgwater/meson.build \
subprojects/libgwater/win/meson.build \ subprojects/libgwater/win/meson.build \
subprojects/libnkutils/bindings/meson.build \
subprojects/libnkutils/core/meson.build \
subprojects/libnkutils/meson.build \ subprojects/libnkutils/meson.build \
subprojects/libnkutils/meson_options.txt \ subprojects/libnkutils/meson_options.txt \
subprojects/libgwater/wayland/libgwater-wayland.h \ subprojects/libgwater/wayland/libgwater-wayland.h \
@@ -657,8 +698,8 @@ EXTRA_DIST += \
subprojects/libgwater/nl/libgwater-nl.c \ subprojects/libgwater/nl/libgwater-nl.c \
subprojects/libgwater/alsa-mixer/libgwater-alsa-mixer.h \ subprojects/libgwater/alsa-mixer/libgwater-alsa-mixer.h \
subprojects/libgwater/alsa-mixer/libgwater-alsa-mixer.c \ subprojects/libgwater/alsa-mixer/libgwater-alsa-mixer.c \
doc/meson_build_manpages.sh \
data/rofi.png\ data/rofi.png\
meson-dist-script \
meson_options.txt \ meson_options.txt \
meson.build meson.build

254
README.md
View File

@@ -7,101 +7,133 @@
<a href="https://repology.org/metapackage/rofi-wayland/versions"><img src="https://repology.org/badge/tiny-repos/rofi-wayland.svg"></a> <a href="https://repology.org/metapackage/rofi-wayland/versions"><img src="https://repology.org/badge/tiny-repos/rofi-wayland.svg"></a>
</p> </p>
<h1 align="center"> <h1 align="center"> Rofi </h1>
Rofi
</h1>
<p align="center"><i>A window switcher, Application launcher and dmenu replacement</i>.</p> <p align="center"><i>A window switcher, Application launcher and dmenu replacement</i>.</p>
https://user-images.githubusercontent.com/84911063/139428874-fe182dd6-82c6-49b8-8da1-920ddda3d1ed.mp4 <https://user-images.githubusercontent.com/84911063/139428874-fe182dd6-82c6-49b8-8da1-920ddda3d1ed.mp4>
**This is a fork of [Rofi](https://github.com/davatorium/rofi) with added support for Wayland via the [layer shell protocol](https://github.com/swaywm/wlr-protocols).** **This is a fork of [Rofi](https://github.com/davatorium/rofi) with added support for Wayland via the [layer shell protocol](https://github.com/swaywm/wlr-protocols).**
**For more information, see the [Wayland support section](#wayland-support)** **For more information, see the [Wayland support section](#wayland-support)**
**Rofi** started as a clone of simpleswitcher, written by [Sean Pringle](http://github.com/seanpringle/simpleswitcher) - a **Rofi** started as a clone of simpleswitcher, written by [Sean
popup window switcher roughly based on [superswitcher](http://code.google.com/p/superswitcher/). Pringle](http://github.com/seanpringle/simpleswitcher) - a popup window
Simpleswitcher laid the foundations, and therefore Sean Pringle deserves most of the credit for this tool. **Rofi** switcher roughly based on
(renamed, as it lost the *simple* property) has been extended with extra features, like an application launcher and [superswitcher](http://code.google.com/p/superswitcher/). Simpleswitcher laid
ssh-launcher, and can act as a drop-in dmenu replacement, making it a very versatile tool. the foundations, and therefore Sean Pringle deserves most of the credit for
this tool. **Rofi** (renamed, as it lost the *simple* property) has been
extended with extra features, like an application launcher and ssh-launcher,
and can act as a drop-in dmenu replacement, making it a very versatile tool.
**Rofi**, like dmenu, will provide the user with a textual list of options where one or more can be selected. **Rofi**, like dmenu, will provide the user with a textual list of options
This can either be running an application, selecting a window, or options provided by an external script. where one or more can be selected.
This can either be running an application, selecting a window, or options
provided by an external script.
### What is rofi not?
## What is rofi not?
Rofi is not: Rofi is not:
* A UI toolkit. - A UI toolkit.
* A library to be used in other applications.
* An application that can support every possible use-case. It tries to be generic enough to be usable by everybody.
* Specific functionality can be added using scripts or plugins, many exists.
* Just a dmenu replacement. The dmenu functionality is a nice 'extra' to **rofi**, not its main purpose.
- A library to be used in other applications.
# Table of Contents - An application that can support every possible use-case. It tries to be
generic enough to be usable by everybody.
- Specific functionality can be added using scripts or plugins, many exists.
- Just a dmenu replacement. The dmenu functionality is a nice 'extra' to
**rofi**, not its main purpose.
## Table of Contents
- [Features](#features) - [Features](#features)
- [Modes](#modes) - [Modes](#modes)
- [Manpages](#manpage) - [Manpages](#manpage)
- [Installation](#installation) - [Installation](#installation)
- [Quickstart](#quickstart) - [Quickstart](#quickstart)
- [Usage](#usage) - [Usage](#usage)
- [Configuration](#configuration) - [Configuration](#configuration)
- [Themes](#themes) - [Themes](#themes)
- [Screenshots](#screenshots) - [Screenshots](#screenshots)
- [Wiki](#wiki) - [Wiki](#wiki)
# Features ## Features
Its main features are: Its main features are:
* Fully configurable keyboard navigation - Fully configurable keyboard navigation
* Type to filter
* Tokenized: type any word in any order to filter
* Case insensitive (togglable)
* Support for fuzzy-, regex-, and glob matching
* UTF-8 enabled
* UTF-8-aware string collating
* International keyboard support (\`e -> è)
* RTL language support
* Cairo drawing and Pango font rendering
* Built-in modes:
* Window switcher mode
* EWMH compatible WM
* Application launcher
* Desktop file application launcher
* SSH launcher mode
* Combi mode, allowing several modes to be merged into one list
* History-based ordering — last 25 choices are ordered on top based on use (optional)
* Levenshtein distance or fzf like sorting of matches (optional)
* Drop-in dmenu replacement
* Many added improvements
* Easily extensible using scripts and plugins
* Advanced Theming
# Modes - Type to filter
- Tokenized: type any word in any order to filter
- Case insensitive (togglable)
- Support for fuzzy-, regex-, prefix-, and glob-matching
**Rofi** has several built-in modes implementing common use cases and can be extended by scripts (either called from - UTF-8 enabled
- UTF-8-aware string collating
- International keyboard support (\`e -> è)
- RTL language support
- Cairo drawing and Pango font rendering
- Built-in modes:
- Window switcher mode
- EWMH compatible WM
- Work arounds for i3,bspwm
- Application launcher
- Desktop file application launcher
- SSH launcher mode
- File browser
- Combi mode, allowing several modes to be merged into one list
- History-based ordering — last 25 choices are ordered on top based on use
(optional)
- Levenshtein distance or fzf like sorting of matches (optional)
- Drop-in dmenu replacement
- Many added improvements
- Easily extensible using scripts and plugins
- Advanced Theming
## Modes
**Rofi** has several built-in modes implementing common use cases and can be
extended by scripts (either called from
**Rofi** or calling **Rofi**) or plugins. **Rofi** or calling **Rofi**) or plugins.
Below is a list of the different modes: Below is a list of the different modes:
* **run**: launch applications from $PATH, with option to launch in terminal. - **run**: launch applications from $PATH, with option to launch in terminal.
* **drun**: launch applications based on desktop files. It tries to be compliant to the XDG standard.
* **window**: Switch between windows on an EWMH compatible window manager. - **drun**: launch applications based on desktop files. It tries to be
* **ssh**: Connect to a remote host via ssh. compliant to the XDG standard.
* **file-browser**: A basic file-browser for opening files.
* **keys**: list internal keybindings. - **window**: Switch between windows on an EWMH compatible window manager.
* **script**: Write (limited) custom mode using simple scripts.
* **combi**: Combine multiple modes into one. - **ssh**: Connect to a remote host via ssh.
- **filebrowser**: A basic file-browser for opening files.
- **keys**: list internal keybindings.
- **script**: Write (limited) custom mode using simple scripts.
- **combi**: Combine multiple modes into one.
**Rofi** is known to work on Linux and BSD. **Rofi** is known to work on Linux and BSD.
# Wayland support ## Wayland support
## Build ### Build
Please follow the [meson build instructions](INSTALL.md#meson) to build this fork, as autotools builds are not yet supported. Please follow the [meson build instructions](INSTALL.md#meson) to build this fork, as autotools builds are not yet supported.
@@ -111,7 +143,7 @@ rofi can also be built _without_ XCB:
meson build -Dxcb=disabled meson build -Dxcb=disabled
## Usage ### Usage
**Rofi** options an configurations are compatible with this fork. It should automatically select the xcb or wayland backend depending on the environment it is run on. **Rofi** options an configurations are compatible with this fork. It should automatically select the xcb or wayland backend depending on the environment it is run on.
@@ -119,84 +151,98 @@ To force the use of the xcb backend (if enabled during build), the `-x11` option
rofi -x11 ... rofi -x11 ...
## Differences with rofi (in wayland mode) ### Missing features in Wayland mode
* `-normal-window` flag in Wayland mode. Though it is also considered as a toy/deprecated feature in Upstream rofi Due to the different architecture and available APIs in Wayland mode, some original rofi features are difficult or impossible to replicate
* selecting which monitor to run rofi on in Wayland mode, rofi only shows up on the currently focused monitor
* `-normal-window` flag. Though it is also considered as a toy/deprecated feature in Upstream rofi. Not impossible but would require some work.
* `-monitor -n` for fine-grained selection of monitor to display rofi on
* some window locations parameters work partially, `x-offset` and `y-offset` are only working from screen edges * some window locations parameters work partially, `x-offset` and `y-offset` are only working from screen edges
* some X11-specific options like `-dpi` or fake transparency * fake transparency
* window mode on KWin which implements different protocols than the wlr familiy
Window switcher mode is now ready to use on compositors with support for wlr-foreign-toplevel-management. ## Manpage
# 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 from upstream rofi](https://github.com/davatorium/rofi/discussions) and [issue tracker](https://github.com/lbonn/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 from upstream rofi](https://github.com/davatorium/rofi/discussions) and [issue tracker](https://github.com/lbonn/rofi/issues?q=) before filing new issue.
* Manpages: - Manpages:
* [rofi](doc/rofi.1.markdown) - [rofi](doc/rofi.1.markdown)
* [rofi-theme](doc/rofi-theme.5.markdown) - [rofi-theme](doc/rofi-theme.5.markdown)
* [rofi-debugging](doc/rofi-debugging.5.markdown) - [rofi-debugging](doc/rofi-debugging.5.markdown)
* [rofi-script](doc/rofi-script.5.markdown) - [rofi-script](doc/rofi-script.5.markdown)
* [rofi-theme-selector](doc/rofi-theme-selector.1.markdown) - [rofi-theme-selector](doc/rofi-theme-selector.1.markdown)
* [rofi-keys](doc/rofi-keys.5.markdown) - [rofi-thumbnails](doc/rofi-thumbnails.5.markdown)
* [rofi-dmenu](doc/rofi-dmenu.5.markdown) - [rofi-keys](doc/rofi-keys.5.markdown)
- [rofi-dmenu](doc/rofi-dmenu.5.markdown)
# Installation ## Installation
Please see the [installation guide](INSTALL.md) for instructions on how to Please see the [installation guide](INSTALL.md) for instructions on how to
install **Rofi**. install **Rofi**.
# Quickstart ## Quickstart
## Usage ### Usage
> **This section just gives a brief overview of the various options. To get the full set of options see the _manpages_ section above** > **This section just gives a brief overview of the various options. To get the
> full set of options see the [manpages](#manpage) section above**
#### Running rofi #### Running rofi
To launch **rofi** directly in a certain mode, specify a mode with `rofi -show <mode>`. To launch **rofi** directly in a certain mode, specify a mode with `rofi -show <mode>`.
To show the `run` dialog: To show the `run` dialog:
```bash
rofi -show run rofi -show run
```
Or get the options from a script: Or get the options from a script:
```bash
~/my_script.sh | rofi -dmenu ~/my_script.sh | rofi -dmenu
```
Specify an ordered, comma-separated list of modes to enable. Specify an ordered, comma-separated list of modes to enable. Enabled modes can
Enabled modes can be changed at runtime. Default key is `Ctrl+Tab`. be changed at runtime. Default key is `Ctrl+Tab`. If no modes are specified,
If no modes are specified, all configured modes will be enabled. all configured modes will be enabled. To only show the `run` and `ssh`
To only show the `run` and `ssh` launcher: launcher:
```bash
rofi -modes "run,ssh" -show run rofi -modes "run,ssh" -show run
```
The modes to combine in combi mode. The modes to combine in combi mode.
For syntax to `-combi-modes `, see `-modes`. For syntax to `-combi-modes`, see `-modes`.
To get one merge view, of `window`,`run`, and `ssh`: To get one merge view, of `window`,`run`, and `ssh`:
rofi -show combi -combi-modes "window,run,ssh" -modes combi ```bash
rofi -show combi -combi-modes "window,run,ssh" -modes combi
```
## Configuration ### Configuration
Generate a default configuration file Generate a default configuration file
```
```bash
mkdir -p ~/.config/rofi mkdir -p ~/.config/rofi
rofi -dump-config > ~/.config/rofi/config.rasi rofi -dump-config > ~/.config/rofi/config.rasi
``` ```
This creates a file called `config.rasi` in the `~/.config/rofi/` folder. You can modify this file to set configuration settings and modify themes. `config.rasi` is the file rofi looks to by default. This creates a file called `config.rasi` in the `~/.config/rofi/` folder. You
can modify this file to set configuration settings and modify themes.
`config.rasi` is the file rofi looks to by default.
Please see the [configuration guide](https://github.com/lbonn/rofi/blob/wayland/CONFIG.md) for a summary of configuration options. More detailed options are provided in the manpages. Please see the [configuration guide](https://github.com/lbonn/rofi/blob/wayland/CONFIG.md) for a summary of configuration options. More detailed options are provided in the manpages.
## Themes ### Themes
Please see the [themes manpages](https://github.com/lbonn/rofi/blob/wayland/doc/rofi-theme.5.markdown) for a detailed description. Please see the [themes manpages](https://github.com/lbonn/rofi/blob/wayland/doc/rofi-theme.5.markdown) for a detailed description.
The latest bundled themes can be found [here](https://github.com/lbonn/rofi/tree/wayland/themes). The latest bundled themes can be found
[here](https://github.com/lbonn/rofi/tree/next/themes).
# Screenshots ## Screenshots
Rezlooks: Rezlooks:
@@ -210,20 +256,20 @@ Default theme:
![default](https://raw.githubusercontent.com/davatorium/rofi/next/releasenotes/1.4.0/rofi-no-fzf.png) ![default](https://raw.githubusercontent.com/davatorium/rofi/next/releasenotes/1.4.0/rofi-no-fzf.png)
# Wiki ## Wiki
| ❗ **The upstream rofi Wiki is currently unmaintained and might contain outdated data ** | | ❗ **The upstream rofi Wiki is currently unmaintained and might contain outdated data** |
| --- | | --- |
[Go to upstream rofi wiki](https://github.com/davatorium/rofi/wiki) . [Go to upstream rofi wiki](https://github.com/davatorium/rofi/wiki) .
#### Contents ### Contents
* [User scripts](https://github.com/davatorium/rofi/wiki/User-scripts) - [User scripts](https://github.com/davatorium/rofi/wiki/User-scripts)
* [Examples](https://github.com/davatorium/rofi/wiki#examples) - [Examples](https://github.com/davatorium/rofi/wiki#examples)
* [dmenu Specs](https://github.com/davatorium/rofi/wiki/dmenu_specs) - [dmenu Specs](https://github.com/davatorium/rofi/wiki/dmenu_specs)
* [mode Specs](https://github.com/davatorium/rofi/wiki/mode-Specs) - [mode Specs](https://github.com/davatorium/rofi/wiki/mode-Specs)
* [F.A.Q.](https://github.com/davatorium/rofi/wiki/Frequently-Asked-Questions). - [F.A.Q.](https://github.com/davatorium/rofi/wiki/Frequently-Asked-Questions).
* [Script mode](https://github.com/davatorium/rofi/wiki/rfc-script-mode) - [Script mode](https://github.com/davatorium/rofi/wiki/rfc-script-mode)
* [Creating an issue](https://github.com/davatorium/rofi/blob/master/.github/CONTRIBUTING.md) - [Creating an issue](https://github.com/davatorium/rofi/blob/master/.github/CONTRIBUTING.md)
* [Creating a Pull request](https://github.com/davatorium/rofi/wiki/Creating-a-pull-request) - [Creating a Pull request](https://github.com/davatorium/rofi/wiki/Creating-a-pull-request)

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -46,6 +46,21 @@ Settings config = {
/** Whether to load and show icons */ /** Whether to load and show icons */
.show_icons = FALSE, .show_icons = FALSE,
/** Custom command to generate preview icons */
.preview_cmd = NULL,
/** Custom command to call when menu selection changes */
.on_selection_changed = NULL,
/** Custom command to call when menu mode changes */
.on_mode_changed = NULL,
/** Custom command to call when menu entry is accepted */
.on_entry_accepted = NULL,
/** Custom command to call when menu is canceled */
.on_menu_canceled = NULL,
/** Custom command to call when menu finds errors */
.on_menu_error = NULL,
/** Custom command to call when menu screenshot is taken */
.on_screenshot_taken = NULL,
/** Terminal to use. (for ssh and open in terminal) */ /** Terminal to use. (for ssh and open in terminal) */
.terminal_emulator = "rofi-sensible-terminal", .terminal_emulator = "rofi-sensible-terminal",
.ssh_client = "ssh", .ssh_client = "ssh",
@@ -89,6 +104,8 @@ Settings config = {
.sorting_method = "normal", .sorting_method = "normal",
/** Case sensitivity of the search */ /** Case sensitivity of the search */
.case_sensitive = FALSE, .case_sensitive = FALSE,
/** Case smart of the search */
.case_smart = FALSE,
/** Cycle through in the element list */ /** Cycle through in the element list */
.cycle = TRUE, .cycle = TRUE,
/** Height of an element in #chars */ /** Height of an element in #chars */
@@ -111,6 +128,8 @@ Settings config = {
.drun_match_fields = "name,generic,exec,categories,keywords", .drun_match_fields = "name,generic,exec,categories,keywords",
/** Only show entries in this category */ /** Only show entries in this category */
.drun_categories = NULL, .drun_categories = NULL,
/** Exclude entries in this category */
.drun_exclude_categories = NULL,
/** Desktop entry show actions */ /** Desktop entry show actions */
.drun_show_actions = FALSE, .drun_show_actions = FALSE,
/** Desktop format display */ /** Desktop format display */
@@ -130,6 +149,7 @@ Settings config = {
.scroll_method = 0, .scroll_method = 0,
.window_format = "{w} {c} {t}", .window_format = "{w} {c} {t}",
.click_to_exit = TRUE, .click_to_exit = TRUE,
.global_kb = FALSE,
.theme = NULL, .theme = NULL,
.plugin_path = PLUGIN_PATH, .plugin_path = PLUGIN_PATH,
.max_history_size = 25, .max_history_size = 25,
@@ -158,4 +178,8 @@ Settings config = {
.refilter_timeout_limit = 300, .refilter_timeout_limit = 300,
/** workaround for broken xserver (#300 on xserver, #611) */ /** workaround for broken xserver (#300 on xserver, #611) */
.xserver_i300_workaround = FALSE, .xserver_i300_workaround = FALSE,
/** What browser to use for completion */
.completer_mode = "filebrowser",
/** Whether to enable imdkit, see #2123 */
.enable_imdkit = TRUE,
}; };

View File

@@ -1,4 +1,4 @@
AC_INIT([rofi], [1.7.5-dev], [https://github.com/davatorium/rofi/],[],[https://reddit.com/r/qtools/]) AC_INIT([rofi], [1.7.9], [https://github.com/davatorium/rofi/],[],[https://github.com/davatorium/rofi/discussions])
AC_CONFIG_SRCDIR([source/rofi.c]) AC_CONFIG_SRCDIR([source/rofi.c])
AC_CONFIG_HEADER([config.h]) AC_CONFIG_HEADER([config.h])
@@ -74,7 +74,7 @@ AM_PROG_AR
dnl --------------------------------------------------------------------- dnl ---------------------------------------------------------------------
dnl Base CFLAGS dnl Base CFLAGS
dnl --------------------------------------------------------------------- dnl ---------------------------------------------------------------------
AM_CFLAGS="-Wall -Wextra -Wparentheses -Winline -pedantic -Wunreachable-code" AM_CFLAGS="-Wall -Wextra -Wparentheses -Wno-inline -pedantic -Wno-overlength-strings -Wunreachable-code"
dnl --------------------------------------------------------------------- dnl ---------------------------------------------------------------------
dnl Enable source code coverage reporting for GCC dnl Enable source code coverage reporting for GCC
@@ -139,13 +139,23 @@ dnl ---------------------------------------------------------------------
dnl PKG_CONFIG based dependencies dnl PKG_CONFIG based dependencies
dnl --------------------------------------------------------------------- dnl ---------------------------------------------------------------------
glib_min_major="2" glib_min_major="2"
glib_min_minor="40" glib_min_minor="72"
glib_min_version="${glib_min_major}.${glib_min_minor}" glib_min_version="${glib_min_major}.${glib_min_minor}"
NK_INIT([bindings xdg-theme]) NK_INIT([bindings xdg-theme])
PKG_CHECK_MODULES([glib], [glib-2.0 >= ${glib_min_version} gio-unix-2.0 gmodule-2.0]) PKG_CHECK_MODULES([glib], [glib-2.0 >= ${glib_min_version} gio-unix-2.0 gmodule-2.0])
AC_DEFINE_UNQUOTED([GLIB_VERSION_MIN_REQUIRED], [(G_ENCODE_VERSION(${glib_min_major},${glib_min_minor}))], [The lower GLib version supported]) AC_DEFINE_UNQUOTED([GLIB_VERSION_MIN_REQUIRED], [(G_ENCODE_VERSION(${glib_min_major},${glib_min_minor}))], [The lower GLib version supported])
AC_DEFINE_UNQUOTED([GLIB_VERSION_MAX_ALLOWED], [(G_ENCODE_VERSION(${glib_min_major},${glib_min_minor}))], [The highest GLib version supported]) AC_DEFINE_UNQUOTED([GLIB_VERSION_MAX_ALLOWED], [(G_ENCODE_VERSION(${glib_min_major},${glib_min_minor}))], [The highest GLib version supported])
GW_CHECK_XCB([xcb-aux xcb-xkb xkbcommon xkbcommon-x11 xcb-ewmh xcb-icccm xcb-cursor xcb-randr xcb-xinerama]) GW_CHECK_XCB([xcb-aux xcb-xkb xkbcommon xkbcommon-x11 xcb-ewmh xcb-icccm xcb-cursor xcb-randr xcb-xinerama xcb-keysyms ])
AC_ARG_ENABLE([imdkit], AS_HELP_STRING([--enable-imdkit], [Build with checks using check library (default: disabled)]))
AS_IF([test "x${enable_imdkit}" = "xyes"], [
PKG_CHECK_MODULES([imdclient], [xcb-imdkit <= 1.0.2 ],
[AC_DEFINE([XCB_IMDKIT_1_0_3_LOWER], [1], [Indicate lower version of imdclient])
AC_DEFINE([XCB_IMDKIT],[1], [IMD Kit missing])],
[PKG_CHECK_MODULES([imdclient], [xcb-imdkit >= 1.0.3],[AC_DEFINE([XCB_IMDKIT],[1], [IMD Kit missing])],[HAVE_IMDKIT=0])])
])
PKG_CHECK_MODULES([pango], [pango pangocairo]) PKG_CHECK_MODULES([pango], [pango pangocairo])
PKG_CHECK_MODULES([cairo], [cairo cairo-xcb]) PKG_CHECK_MODULES([cairo], [cairo cairo-xcb])
PKG_CHECK_MODULES([libsn], [libstartup-notification-1.0 ]) PKG_CHECK_MODULES([libsn], [libstartup-notification-1.0 ])
@@ -159,6 +169,13 @@ AC_ARG_ENABLE([check], AS_HELP_STRING([--disable-check], [Build with checks usin
AS_IF([test "x${enable_check}" != "xno"], [ PKG_CHECK_MODULES([check],[check >= 0.11.0], [HAVE_CHECK=1]) ]) AS_IF([test "x${enable_check}" != "xno"], [ PKG_CHECK_MODULES([check],[check >= 0.11.0], [HAVE_CHECK=1]) ])
AM_CONDITIONAL([USE_CHECK], [test "x${enable_check}" != "xno" && test "$HAVE_CHECK" -eq 1]) AM_CONDITIONAL([USE_CHECK], [test "x${enable_check}" != "xno" && test "$HAVE_CHECK" -eq 1])
dnl ---------------------------------------------------------------------
dnl Build man pages
dnl ---------------------------------------------------------------------
AC_ARG_ENABLE([man], AS_HELP_STRING([--disable-man], [Build man pages (default: enabled)]))
AS_IF([test "x$enable_man" != "xno" ], [ AC_CHECK_PROG([pandoc], pandoc, [yes])])
AM_CONDITIONAL([FOUND_PANDOC], [test "x$pandoc" = xyes])
dnl --------------------------------------------------------------------- dnl ---------------------------------------------------------------------
dnl Gets the resource compile tool path. dnl Gets the resource compile tool path.
@@ -200,6 +217,11 @@ echo "Check based tests Enabled"
else else
echo "Check based tests Disabled" echo "Check based tests Disabled"
fi fi
if test "x${enable_man}" != "xno" && test "x$pandoc" = "xyes"; then
echo "Build man pages Enabled"
else
echo "Build man pages Disabled"
fi
echo "-------------------------------------" echo "-------------------------------------"
echo "Now type 'make' to build" echo "Now type 'make' to build"
echo "" echo ""

44
default.nix Normal file
View File

@@ -0,0 +1,44 @@
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
stdenv.mkDerivation {
pname = "rofi";
version = "1.7.5-unstable";
src = ./.;
depsBuildBuild = [
buildPackages.stdenv.cc
pkg-config
glib
];
nativeBuildInputs = [
meson
ninja
pkg-config
flex
bison
pandoc
wayland-protocols
wayland-scanner
];
buildInputs = [
libxkbcommon
pango
cairo
git
librsvg
check
libstartup_notification
xorg.libxcb
xcb-imdkit
xcb-util-cursor
xorg.xcbutilkeysyms
xorg.xcbutil
xorg.xcbutilwm
xcbutilxrm
wayland
wayland-protocols
which
];
mesonFlags = [ "-Dimdkit=true" ];
}

View File

@@ -1,7 +1,7 @@
Manpages are build using [go-md2man](https://github.com/cpuguy83/go-md2man) Manpages are build using [pandoc](https://pandoc.org/)
Manpages can be updated using the following make command: Manpages can be updated using the following make command:
``` ```
make update-manpage make generate-manpage
``` ```

View File

@@ -141,10 +141,17 @@ textbox-num-sep {
str: "/"; str: "/";
} }
inputbar { inputbar {
padding: 1px ; padding: 1px;
spacing: 0px ; spacing: 0px;
text-color: var(normal-foreground); text-color: var(normal-foreground);
children: [ prompt,textbox-prompt-colon,entry, num-filtered-rows, textbox-num-sep, num-rows, case-indicator ]; children: [ prompt,textbox-prompt-colon,entry, overlay,num-filtered-rows, textbox-num-sep, num-rows, case-indicator ];
}
overlay {
background-color: var(normal-foreground);
foreground-color: var(normal-background);
text-color: var(normal-background);
padding: 0 0.2em;
margin: 0 0.2em;
} }
case-indicator { case-indicator {
spacing: 0; spacing: 0;

237
doc/man_filter.lua Normal file
View File

@@ -0,0 +1,237 @@
local Def = {}
function Def:new(d)
-- init with empty def
if d == nil then
d = {
start_idx = nil,
end_idx = nil,
def_par = nil,
content = {},
}
end
setmetatable(d, self)
self.__index = self
return d
end
function Def:init(start_idx, el)
self.start_idx = start_idx
self.def_par = el
end
function Def:append(el)
if self.start_idx ~= nil then
table.insert(self.content, el)
end
end
function Def:stop(end_idx)
if self.start_idx == nil then
return nil
end
local out = self:new({
start_idx = self.start_idx,
end_idx = end_idx,
def_par = self.def_par,
content = self.content,
})
self.start_idx = nil
self.end_idx = nil
self.def_par = nil
self.content = {}
return out
end
function Def:to_string()
return string.format("start: %d, end: %d, def_par: %s", self.start_idx, self.end_idx, self.def_par)
end
function find_defs(doc)
local defs = {}
local idx = 0
local def = Def:new()
-- find defintions:
-- * start at paragraphs with `word` ...
-- * stop at next definition or next header
local filter = {
traverse = "topdown",
Para = function(el)
idx = idx + 1
local new_def_start = #el.content >= 1 and el.content[1].tag == "Code"
if new_def_start then
local newd = def:stop(idx - 1)
table.insert(defs, newd)
def:init(idx, el.content)
else
def:append(el)
end
return nil, false
end,
Block = function(el)
idx = idx + 1
def:append(el)
-- stop exploring after one nesting level
return nil, false
end,
Header = function(el)
idx = idx + 1
local newd = def:stop(idx - 1)
table.insert(defs, newd)
return nil, false
end,
}
doc:walk(filter)
local newd = def:stop(idx - 1)
table.insert(defs, newd)
return defs
end
function convert_defs(doc, defs)
local idx = 0
local out_blocks = {}
local convert_defs = {
traverse = "topdown",
Block = function(el)
idx = idx + 1
for _, d in ipairs(defs) do
if idx == d.end_idx then
local dl = pandoc.DefinitionList({ { d.def_par, { d.content } } })
table.insert(out_blocks, dl:walk())
return {}, false
end
if idx >= d.start_idx and idx < d.end_idx then
-- drop
return {}, false
end
end
table.insert(out_blocks, el:walk())
return nil, false
end,
}
doc:walk(convert_defs)
return pandoc.Pandoc(out_blocks, doc.meta)
end
-- for <2.17 compatibility
-- equivalent to `doc:walk(filter)`
local function walk_doc(doc, filter)
local div = pandoc.Div(doc.blocks)
local blocks = pandoc.walk_block(div, filter).content
return pandoc.Pandoc(blocks, doc.meta)
end
local function extract_title(doc)
local title = {}
local section
local filter = {
Header = function(el)
local f = {
Str = function(el)
if el.text:find("%(1%)") ~= nil then
section = "General Commands Manual"
elseif el.text:find("%(5%)") ~= nil then
section = "File Formats Manual"
end
table.insert(title, el)
end,
Inline = function(el)
table.insert(title, el)
end,
}
if el.level == 1 then
pandoc.walk_block(el, f)
return {} -- drop
end
return nil
end,
}
doc = walk_doc(doc, filter)
local to_inline = function(s)
local r = {}
for w in s:gmatch("%S+") do
table.insert(r, pandoc.Str(w))
table.insert(r, pandoc.Space())
end
table.remove(r, #r)
return r
end
if section ~= nil then
for _, e in ipairs({
pandoc.Space(),
pandoc.Str("rofi"),
pandoc.Space(),
pandoc.Str("|"),
table.unpack(to_inline(section)),
}) do
table.insert(title, e)
end
end
doc.meta = pandoc.Meta({
title = pandoc.MetaInlines(title),
})
return doc
end
local function decrement_heading(doc)
local filter = {
Header = function(el)
if el.level > 1 then
el.level = el.level - 1
return el
end
return nil
end,
}
doc = walk_doc(doc, filter)
return doc
end
local function code_in_strong(doc)
local filter = {
Code = function(el)
return pandoc.Strong(el.text)
end,
}
doc = walk_doc(doc, filter)
return doc
end
--- Run filtering function through whole document
--
-- * find argument definitions: paragraph starting with inline code (`-arg`)
-- * replace the paragraphs until the end of the definition with a DefinitionList
-- * extract metadata title from main heading
-- * decrement heading from 1 for better display
-- * convert inline code text to Strong as usual in man pages
function Pandoc(doc)
if PANDOC_VERSION >= pandoc.types.Version("2.17.0") then
-- 2.17 is required for topdown traversal
local defs = find_defs(doc)
doc = convert_defs(doc, defs)
end
doc = extract_title(doc)
doc = decrement_heading(doc)
doc = code_in_strong(doc)
return doc
end

View File

@@ -1,24 +1,61 @@
gomd2man = find_program('go-md2man', required: false) man_files = [
if gomd2man.found() 'rofi.1',
run_target('update-manpage', 'rofi-sensible-terminal.1',
command: [ 'meson_build_manpages.sh', files( 'rofi-theme-selector.1',
'rofi.1.markdown', 'rofi-actions.5',
'rofi-theme-selector.1.markdown', 'rofi-debugging.5',
'rofi-theme.5.markdown', 'rofi-dmenu.5',
'rofi-dmenu.5.markdown', 'rofi-keys.5',
'rofi-debugging.5.markdown', 'rofi-script.5',
'rofi-keys.5.markdown', 'rofi-theme.5',
'rofi-script.5.markdown', 'rofi-thumbnails.5',
'rofi-sensible-terminal.1.markdown' ]
)]
) fs = import('fs')
pandoc = find_program('pandoc', required: false, version: '>=2.9')
if pandoc.found()
man_targets = []
cp_cmds = []
foreach f: man_files
section_number = f.split('.')[1]
install_dest = join_paths(get_option('prefix'), get_option('mandir'), 'man' + section_number)
man_targets += custom_target(f,
input: ['.'.join([f, 'markdown']), 'man_filter.lua'],
output: f,
command: [ 'pandoc', '--standalone', '--to=man',
'--lua-filter', '@INPUT1@',
'-f', 'markdown-tex_math_dollars',
'@INPUT0@', '-o', '@OUTPUT@' ],
install: true,
install_dir: install_dest,
build_by_default: true,
)
endforeach
run_target('generate-manpage', command: ['true'], depends: man_targets)
else
man_missing = false
foreach f: man_files
if not fs.is_file(f)
man_missing = true
endif
endforeach
if man_missing
warning('Man files cannot be generated and not present in source directory, they will not be installed')
else
install_man(man_files)
endif
endif endif
doxy_conf = configuration_data() doxy_conf = configuration_data()
doxy_conf.set('PACKAGE', meson.project_name()) doxy_conf.set('PACKAGE', meson.project_name())
doxy_conf.set('VERSION', meson.project_version()) doxy_conf.set('VERSION', meson.project_version())
doxy_conf.set('abs_builddir', join_paths(meson.build_root(), meson.current_build_dir())) doxy_conf.set('abs_builddir', join_paths(meson.project_build_root(), meson.current_build_dir()))
doxy_conf.set('abs_top_srcdir', meson.source_root()) doxy_conf.set('abs_top_srcdir', meson.project_source_root())
doxyfile = configure_file( doxyfile = configure_file(
input: 'rofi.doxy.in', input: 'rofi.doxy.in',

View File

@@ -1,12 +0,0 @@
#!/usr/bin/env bash
## Did not get this working in meson directly.
## not via generator or custom_target.
pushd "${MESON_BUILD_ROOT}"
for a in $@
do
go-md2man -in $a -out ${a%.markdown}
done

View File

@@ -0,0 +1,89 @@
# rofi-actions(5)
## NAME
**rofi-actions** - Custom commands following interaction with rofi menus
## DESCRIPTION
**rofi** allows to set custom commands or scripts to be executed when some actions are performed in the menu, such as changing selection, accepting an entry or canceling.
This makes it possible for example to play sound effects or read aloud menu entries on selection.
## USAGE
Following is the list of rofi flags for specifying custom commands or scripts to execute on supported actions:
`-on-selection-changed` *cmd*
Command or script to run when the current selection changes. Selected text is forwarded to the command replacing the pattern *{entry}*.
`-on-entry-accepted` *cmd*
Command or script to run when a menu entry is accepted. Accepted text is forwarded to the command replacing the pattern *{entry}*.
`-on-mode-changed` *cmd*
Command or script to run when the menu mode (e.g. drun,window,ssh...) is changed.
`-on-menu-canceled` *cmd*
Command or script to run when the menu is canceled.
`-on-menu-error` *cmd*
Command or script to run when an error menu is shown (e.g. `rofi -e "error message"`). Error text is forwarded to the command replacing the pattern *{error}*.
`-on-screenshot-taken` *cmd*
Command or script to run when a screenshot of rofi is taken. Screenshot path is forwarded to the command replacing the pattern *{path}*.
### Example usage
Rofi command line:
```bash
rofi -on-selection-changed "/path/to/select.sh {entry}" \
-on-entry-accepted "/path/to/accept.sh {entry}" \
-on-menu-canceled "/path/to/exit.sh" \
-on-mode-changed "/path/to/change.sh" \
-on-menu-error "/path/to/error.sh {error}" \
-on-screenshot-taken "/path/to/camera.sh {path}" \
-show drun
```
Rofi config file:
```css
configuration {
on-selection-changed: "/path/to/select.sh {entry}";
on-entry-accepted: "/path/to/accept.sh {entry}";
on-menu-canceled: "/path/to/exit.sh";
on-mode-changed: "/path/to/change.sh";
on-menu-error: "/path/to/error.sh {error}";
on-screenshot-taken: "/path/to/camera.sh {path}";
}
```
### Play sound effects
Here's an example bash script that plays a sound effect using `aplay` when the current selection is changed:
```bash
#!/bin/bash
coproc aplay -q $HOME/Music/selecting_an_item.wav
```
The use of `coproc` for playing sounds is suggested, otherwise the rofi process will wait for sounds to end playback before exiting.
### Read aloud
Here's an example bash script that reads aloud currently selected entries using `espeak`:
```bash
#!/bin/bash
killall espeak
echo "selected: $@" | espeak
```

View File

@@ -1,19 +1,19 @@
# ROFI DEBUGGING 5 rofi debugging # rofi-debugging(5)
## NAME ## NAME
Debugging rofi. Debugging rofi.
When reporting an issue with rofi crashing, or misbehaving. It helps to do some small test When reporting an issue with rofi crashing, or misbehaving. It helps to do some
to help pin-point the problem. small test to help pin-point the problem.
First try disabling your custom configuration: `-no-config` First try disabling your custom configuration: `-no-config`
This disables the parsing of the configuration files. This runs rofi in *stock* mode. 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` If you run custom C plugins, you can disable the plugins using: `-no-plugins`
## Get the relevant information for an issue ## Get the relevant information for an issue
Please pastebin the output of the following commands: Please pastebin the output of the following commands:
@@ -24,15 +24,14 @@ rofi -dump-config
rofi -dump-theme rofi -dump-theme
``` ```
`rofi -help` provides us with the configuration files parsed, the exact version, monitor layout `rofi -help` provides us with the configuration files parsed, the exact
and more useful information. version, monitor layout and more useful information.
The `rofi -dump-config` and `rofi -dump-theme` output gives us `rofi` The `rofi -dump-config` and `rofi -dump-theme` output gives us `rofi`
interpretation of your configuration and theme. interpretation of your configuration and theme.
Please check the output for identifiable information and remove this. Please check the output for identifiable information and remove this.
## Timing traces ## Timing traces
To get a timing trace, enable the **Timings** debug domain. To get a timing trace, enable the **Timings** debug domain.
@@ -40,13 +39,12 @@ To get a timing trace, enable the **Timings** debug domain.
```bash ```bash
G_MESSAGES_DEBUG=Timings rofi -show drun G_MESSAGES_DEBUG=Timings rofi -show drun
``` ```
It will show a trace with (useful) timing information at relevant points during
It will show a trace with (useful) timing information at relevant points during the execution. the execution. This will help debugging when rofi is slow to start.
This will help debugging when rofi is slow to start.
Example trace: Example trace:
``` ```text
(process:14942): Timings-DEBUG: 13:47:39.335: 0.000000 (0.000000): Started (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.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.335: 0.000163 (0.000037): ../source/rofi.c:main:819
@@ -99,48 +97,49 @@ Example trace:
(process:14942): Timings-DEBUG: 13:47:39.428: 0.092864 (0.006741): ../source/view.c:rofi_view_update:1008 widgets (process:14942): Timings-DEBUG: 13:47:39.428: 0.092864 (0.006741): ../source/view.c:rofi_view_update:1008 widgets
``` ```
## Debug domains ## Debug domains
To further debug the plugin, you can get a trace with (lots of) debug information. This debug output can be enabled for To further debug the plugin, you can get a trace with (lots of) debug
multiple parts in rofi using the glib debug framework. Debug domains can be enabled by setting the G\_MESSAGES\_DEBUG information. This debug output can be enabled for multiple parts in rofi using
environment variable. At the time of creation of this page, the following debug domains exist: 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. - all: Show debug information from all domains.
* X11Helper: The X11 Helper functions. - X11Helper: The X11 Helper functions.
* View: The main window view functions. - View: The main window view functions.
* Widgets.Box: The Box widget. - Widgets.Box: The Box widget.
* Modes.DMenu: The dmenu mode. - Modes.DMenu: The dmenu mode.
* Modes.Run: The run mode. - Modes.Run: The run mode.
* Modes.DRun: The desktop file run mode. - Modes.DRun: The desktop file run mode.
* Modes.Window: The window mode. - Modes.Window: The window mode.
* Modes.Script: The script mode. - Modes.Script: The script mode.
* Modes.Combi: The script mode. - Modes.Combi: The script mode.
* Modes.Ssh: The ssh mode. - Modes.Ssh: The ssh mode.
* Rofi: The main application. - Rofi: The main application.
* Timings: Get timing output. - Timings: Get timing output.
* Theme: Theme engine debug output. (warning lots of output). - Theme: Theme engine debug output. (warning lots of output).
* Widgets.Icon: The Icon widget. - Widgets.Icon: The Icon widget.
* Widgets.Box: The box widget. - Widgets.Box: The box widget.
* Widgets.Container: The container widget. - Widgets.Container: The container widget.
* Widgets.Window: The window widget. - Widgets.Window: The window widget.
* Helpers.IconFetcher: Information about icon lookup. - Helpers.IconFetcher: Information about icon lookup.
For full list see `man rofi`. 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. Example: `G_MESSAGES_DEBUG=Dialogs.DRun rofi -show drun` To get specific output
from the Desktop file run dialog.
To redirect the debug output to a file (`~/rofi.log`) add: To redirect the debug output to a file (`~/rofi.log`) add:
``` ```bash
rofi -show drun -log ~/rofi.log rofi -show drun -log ~/rofi.log
``` ```
Specifying the logfile automatically enabled all log domains. Specifying the logfile automatically enabled all log domains.
This can be useful when rofi is launched from a window manager. This can be useful when rofi is launched from a window manager.
## Creating a backtrace
## Creating a backtrace.
First make sure you compile **rofi** with debug symbols: First make sure you compile **rofi** with debug symbols:
@@ -148,10 +147,10 @@ First make sure you compile **rofi** with debug symbols:
make CFLAGS="-O0 -g3" clean rofi make CFLAGS="-O0 -g3" clean rofi
``` ```
Getting a backtrace using GDB is not very handy. Because if rofi get stuck, it grabs keyboard and Getting a backtrace using GDB is not very handy. Because if rofi get stuck, it
mouse. So if it crashes in GDB you are stuck. grabs keyboard and mouse. So if it crashes in GDB you are stuck. The best way
The best way to go is to enable core file. (ulimit -c unlimited in bash) then make rofi crash. You to go is to enable core file. (ulimit -c unlimited in bash) then make rofi
can then load the core in GDB. crash. You can then load the core in GDB.
```bash ```bash
gdb rofi core gdb rofi core
@@ -159,17 +158,19 @@ gdb rofi core
Then type inside gdb: Then type inside gdb:
``` ```bash
thread apply all bt thread apply all bt
``` ```
The output trace is useful when reporting crashes. The output trace is useful when reporting crashes.
Some distribution have `systemd-coredump`, this way you can easily get a backtrace via `coredumpctl`. Some distribution have `systemd-coredump`, this way you can easily get a
backtrace via `coredumpctl`.
## SEE ALSO ## SEE ALSO
**rofi-sensible-terminal(1)**, **dmenu(1)**, **rofi-debugging(5)**, **rofi-theme(5)**, **rofi-script(5)**, **rofi-keys(5)**,**rofi-theme-selector(1)** rofi-sensible-terminal(1), dmenu(1), rofi-theme(5),
rofi-script(5), rofi-keys(5),rofi-theme-selector(1)
## AUTHOR ## AUTHOR

View File

@@ -1,334 +0,0 @@
.nh
.TH ROFI-DMENU 5 rofi-dmenu
.SH NAME
.PP
\fBrofi dmenu mode\fP - Rofi dmenu emulation
.SH DESCRIPTION
.PP
To integrate \fBrofi\fP into scripts as simple selection dialogs,
\fBrofi\fP supports emulating \fBdmenu(1)\fP (A dynamic menu for X11).
.PP
The website for \fB\fCdmenu\fR can be found here
\[la]http://tools.suckless.org/dmenu/\[ra]\&.
.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).
.SH BASIC CONCEPT
.PP
In \fB\fCdmenu\fR mode, \fBrofi\fP reads data from standard in, splits them into separate entries and displays them.
If the user selects an row, this is printed out to standard out, allow the script to process it further.
.PP
By default separation of rows is done on new lines, making it easy to pipe the output a one application into
\fBrofi\fP and the output of rofi into the next.
.SH USAGE
.PP
By launching \fBrofi\fP with the \fB\fC-dmenu\fR flag it will go into dmenu emulation mode.
.PP
.RS
.nf
ls | rofi -dmenu
.fi
.RE
.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\&.
.PP
.RS
.nf
ln -s /usr/bin/rofi /usr/bin/dmenu
.fi
.RE
.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.
.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
for more information about this syntax.
.PP
\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:
.PP
.RS
.nf
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
.fi
.RE
.PP
\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.
.PP
.RS
.nf
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey"
.fi
.RE
.PP
Default: \fIdmenu\fP
.PP
\fB\fC-l\fR \fInumber of lines to show\fP
.PP
Maximum number of lines the menu may show before scrolling.
.PP
.RS
.nf
rofi -dmenu -l 25
.fi
.RE
.PP
Default: \fI15\fP
.PP
\fB\fC-i\fR
.PP
Makes \fB\fCdmenu\fR searches case-insensitive
.PP
\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:
.RS
.IP \(bu 2
A single row: '5'
.IP \(bu 2
A range of (last 3) rows: '-3:'
.IP \(bu 2
4 rows starting from row 7: '7:11' (or in legacy notation: '7-10')
.IP \(bu 2
A set of rows: '2,0,-9'
.IP \(bu 2
Or any combination: '5,-3:,7:11,2,0,-9'
.RE
.PP
\fB\fC-u\fR \fIX\fP
.PP
Urgent row, mark \fIX\fP as urgent. See \fB\fC-a\fR option for details.
.PP
\fB\fC-only-match\fR
.PP
Only return a selected item, do not allow custom entry.
This mode always returns an entry. It will not return if no matching entry is
selected.
.PP
\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
.PP
Allows the output of dmenu to be customized (N is the total number of input entries):
.RS
.IP \(bu 2
\&'s' selected string
.IP \(bu 2
\&'i' index (0 - (N-1))
.IP \(bu 2
\&'d' index (1 - N)
.IP \(bu 2
\&'q' quote string
.IP \(bu 2
\&'p' Selected string stripped from Pango markup (Needs to be a valid string)
.IP \(bu 2
\&'f' filter string (user input)
.IP \(bu 2
\&'F' quoted filter string (user input)
.RE
.PP
Default: 's'
.PP
\fB\fC-select\fR \fIstring\fP
.PP
Select first line that matches the given string
.PP
\fB\fC-mesg\fR \fIstring\fP
.PP
Add a message line below the filter entry box. Supports Pango markup.
For more information on supported markup, see here
\[la]https://docs.gtk.org/Pango/pango_markup.html\[ra]
.PP
\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.
.PP
\fB\fC-input\fR \fIfile\fP
.PP
Reads from \fIfile\fP instead of stdin.
.PP
\fB\fC-password\fR
.PP
Hide the input text. This should not be considered secure!
.PP
\fB\fC-markup-rows\fR
.PP
Tell \fBrofi\fP that DMenu input is Pango markup encoded, and should be rendered.
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
.PP
Allow multiple lines to be selected. Adds a small selection indicator to the left of each entry.
.PP
\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\&.
.PP
\fB\fC-window-title\fR \fItitle\fP
.PP
Set name used for the window title. Will be shown as Rofi - \fItitle\fP
.PP
\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
.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'
.PP
\fB\fC-ballot-selected-str\fR \fIstring\fP
.PP
When multi-select is enabled, prefix this string when element is selected.
.PP
\fIdefault\fP: "☑ "
.PP
\fB\fC-ballot-unselected-str\fR \fIstring\fP
.PP
When multi-select is enabled, prefix this string when element is not selected.
.PP
\fIdefault\fP: "☐ "
.SH RETURN VALUE
.RS
.IP \(bu 2
\fB0\fP: Row has been selected accepted by user.
.IP \(bu 2
\fB1\fP: User cancelled the selection.
.IP \(bu 2
\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), ascii(7)
.SH AUTHOR
.PP
Qball Cow qball@gmpclient.org
\[la]mailto:qball@gmpclient.org\[ra]
.PP
Rasmus Steinke rasi@xssn.at
\[la]mailto:rasi@xssn.at\[ra]
.PP
Morgane Glidic sardemff7+rofi@sardemff7.net
\[la]mailto:sardemff7+rofi@sardemff7.net\[ra]
.PP
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

@@ -1,10 +1,9 @@
# ROFI-DMENU 5 rofi-dmenu # rofi-dmenu(5)
## NAME ## NAME
**rofi dmenu mode** - Rofi dmenu emulation **rofi dmenu mode** - Rofi dmenu emulation
## DESCRIPTION ## DESCRIPTION
To integrate **rofi** into scripts as simple selection dialogs, To integrate **rofi** into scripts as simple selection dialogs,
@@ -12,58 +11,67 @@ To integrate **rofi** into scripts as simple selection dialogs,
The website for `dmenu` can be found [here](http://tools.suckless.org/dmenu/). The website for `dmenu` can be found [here](http://tools.suckless.org/dmenu/).
**rofi** does not aim to be 100% compatible with `dmenu`. There are simply too many flavors of `dmenu`. **rofi** does not aim to be 100% compatible with `dmenu`. There are simply too
The idea is that the basic usage command-line flags are obeyed, theme-related flags are not. many flavors of `dmenu`. The idea is that the basic usage command-line flags
Besides, **rofi** offers some extended features (like multi-select, highlighting, message bar, extra key bindings). are obeyed, theme-related flags are not. Besides, **rofi** offers some extended
features (like multi-select, highlighting, message bar, extra key bindings).
## BASIC CONCEPT ## BASIC CONCEPT
In `dmenu` mode, **rofi** reads data from standard in, splits them into separate entries and displays them. In `dmenu` mode, **rofi** reads data from standard in, splits them into
If the user selects an row, this is printed out to standard out, allow the script to process it further. separate entries and displays them. If the user selects a row, this is printed
out to standard out, allowing the script to process it further.
By default separation of rows is done on new lines, making it easy to pipe the output a one application into By default separation of rows is done on new lines, making it easy to pipe the
**rofi** and the output of rofi into the next. output a one application into **rofi** and the output of rofi into the next.
## USAGE ## USAGE
By launching **rofi** with the `-dmenu` flag it will go into dmenu emulation mode. By launching **rofi** with the `-dmenu` flag it will go into dmenu emulation
mode.
```bash ```bash
ls | rofi -dmenu ls | rofi -dmenu
``` ```
### DMENU DROP-IN REPLACEMENT ### DMENU DROP-IN REPLACEMENT
If `argv[0]` (calling command) is dmenu, **rofi** will start in dmenu mode. If `argv[0]` (calling command) is dmenu, **rofi** will start in dmenu mode.
This way, it can be used as a drop-in replacement for dmenu. Just copy or symlink **rofi** to dmenu in `$PATH`. This way, it can be used as a drop-in replacement for dmenu. Just copy or
symlink **rofi** to dmenu in `$PATH`.
ln -s /usr/bin/rofi /usr/bin/dmenu
```bash
ln -s /usr/bin/rofi /usr/bin/dmenu
```
### DMENU VS SCRIPT MODE ### DMENU VS SCRIPT MODE
Script mode is used to extend **rofi**, dmenu mode is used to extend a script. Script mode is used to extend **rofi**, dmenu mode is used to extend a script.
The two do share much of the same input format. Please see the **rofi-script(5)** manpage for more information. The two do share much of the same input format. Please see the
**rofi-script(5)** manpage for more information.
### DMENU SPECIFIC COMMANDLINE FLAGS ### DMENU SPECIFIC COMMANDLINE FLAGS
A lot of these options can also be modified by the script using special input. See the **rofi-script(5)** manpage A lot of these options can also be modified by the script using special input.
for more information about this syntax. See the **rofi-script(5)** manpage for more information about this syntax.
`-sep` *separator* `-sep` *separator*
Separator for `dmenu`. Example: To show a list of 'a' to 'e' with '|' as a separator: Separator for `dmenu`. Example: To show a list of 'a' to 'e' with '|' as a
separator:
echo "a|b|c|d|e" | rofi -sep '|' -dmenu ```bash
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
```
`-p` *prompt* `-p` *prompt*
Specify the prompt to show in `dmenu` mode. For example, select 'monkey', a,b,c,d, or e. Specify the prompt to show in `dmenu` mode. For example, select 'monkey',
a,b,c,d, or e.
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey" ```bash
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey"
```
Default: *dmenu* Default: *dmenu*
@@ -71,7 +79,9 @@ Default: *dmenu*
Maximum number of lines the menu may show before scrolling. Maximum number of lines the menu may show before scrolling.
rofi -dmenu -l 25 ```bash
rofi -dmenu -l 25
```
Default: *15* Default: *15*
@@ -81,13 +91,16 @@ Makes `dmenu` searches case-insensitive
`-a` *X* `-a` *X*
Active row, mark *X* as active. Where *X* 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 *X* as active. Where *X* 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:
* A single row: '5' - A single row: '5'
* A range of (last 3) rows: '-3:' - A range of (last 3) rows: '-3:'
* 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')
* A set of rows: '2,0,-9' - A set of rows: '2,0,-9'
* Or any combination: '5,-3:,7:11,2,0,-9' - Or any combination: '5,-3:,7:11,2,0,-9'
`-u` *X* `-u` *X*
@@ -106,15 +119,16 @@ This mode returns directly when no entries given.
`-format` *format* `-format` *format*
Allows the output of dmenu to be customized (N is the total number of input entries): Allows the output of dmenu to be customized (N is the total number of input
entries):
* 's' selected string - 's' selected string
* 'i' index (0 - (N-1)) - 'i' index (0 - (N-1))
* 'd' index (1 - N) - 'd' index (1 - N)
* 'q' quote string - 'q' quote string
* 'p' Selected string stripped from Pango markup (Needs to be a valid string) - 'p' Selected string stripped from Pango markup (Needs to be a valid string)
* 'f' filter string (user input) - 'f' filter string (user input)
* 'F' quoted filter string (user input) - 'F' quoted filter string (user input)
Default: 's' Default: 's'
@@ -124,8 +138,9 @@ Select first line that matches the given string
`-mesg` *string* `-mesg` *string*
Add a message line below the filter entry box. Supports Pango markup. Add a message line below the filter entry box. Supports Pango markup. For more
For more information on supported markup, see [here](https://docs.gtk.org/Pango/pango_markup.html) information on supported markup, see
[here](https://docs.gtk.org/Pango/pango_markup.html)
`-dump` `-dump`
@@ -144,18 +159,21 @@ Hide the input text. This should not be considered secure!
`-markup-rows` `-markup-rows`
Tell **rofi** that DMenu input is Pango markup encoded, and should be rendered. Tell **rofi** that DMenu input is Pango markup encoded, and should be rendered.
See [here](https://developer.gnome.org/pygtk/stable/pango-markup-language.html) for details about Pango markup. See [here](https://docs.gtk.org/Pango/pango_markup.html)
for details about Pango markup.
`-multi-select` `-multi-select`
Allow multiple lines to be selected. Adds a small selection indicator to the left of each entry. Allow multiple lines to be selected. Adds a small selection indicator to the
left of each entry.
`-sync` `-sync`
Force **rofi** mode to first read all data from stdin before showing the selection window. This is original dmenu behavior. Force **rofi** mode to first read all data from stdin before showing the
selection window. This is original dmenu behavior.
Note: the default asynchronous mode will also be automatically disabled if used with conflicting options, Note: the default asynchronous mode will also be automatically disabled if used
with conflicting options,
such as `-dump`, `-only-match` or `-auto-select`. such as `-dump`, `-only-match` or `-auto-select`.
`-window-title` *title* `-window-title` *title*
@@ -192,16 +210,27 @@ When multi-select is enabled, prefix this string when element is not selected.
*default*: "☐ " *default*: "☐ "
`-ellipsize-mode` (start|middle|end)
Set ellipsize mode on the listview.
*default* "end"
## PARSING ROW OPTIONS
Extra options for individual rows can be also set. See the **rofi-script(5)**
manpage for details; the syntax and supported features are identical.
## RETURN VALUE ## RETURN VALUE
* **0**: Row has been selected accepted by user. - **0**: Row has been selected accepted by user.
* **1**: User cancelled the selection. - **1**: User cancelled the selection.
* **10-28**: Row accepted by custom keybinding. - **10-28**: Row accepted by custom keybinding.
## SEE ALSO ## SEE ALSO
rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-script(5), rofi-theme-selector(1), ascii(7) rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-script(5),
rofi-theme-selector(1), ascii(7)
## AUTHOR ## AUTHOR
@@ -211,7 +240,6 @@ Rasmus Steinke <rasi@xssn.at>
Morgane Glidic <sardemff7+rofi@sardemff7.net> Morgane Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com> Original code based on work by: Sean Pringle <sean.pringle@gmail.com>
For a full list of authors, check the AUTHORS file. For a full list of authors, check the AUTHORS file.

View File

@@ -1,647 +0,0 @@
.nh
.TH ROFI-KEYS 5 rofi-keys
.SH NAME
.PP
\fBrofi keys\fP - Rofi Key and Mouse bindings
.SH DESCRIPTION
.PP
\fBrofi\fP supports overriding of any of it key and mouse binding.
.SH Setting binding
.PP
Bindings can be done on the commandline (-{bindingname}):
.PP
.RS
.nf
rofi -show run -kb-accept-entry 'Control+Shift+space'
.fi
.RE
.PP
or via the configuration file:
.PP
.RS
.nf
configuration {
kb-accept-entry: "Control+Shift+space";
}
.fi
.RE
.PP
The key can be set by its name (see above) or its keycode:
.PP
.RS
.nf
configuration {
kb-accept-entry: "Control+Shift+[65]";
}
.fi
.RE
.PP
An easy way to look up keycode is xev(1).
.PP
Multiple keys can be specified for an action as a comma separated list:
.PP
.RS
.nf
configuration {
kb-accept-entry: "Control+Shift+space,Return";
}
.fi
.RE
.PP
By Default \fBrofi\fP reacts on pressing, to act on the release of all keys
prepend the binding with \fB\fC!\fR:
.PP
.RS
.nf
configuration {
kb-accept-entry: "!Control+Shift+space,Return";
}
.fi
.RE
.SH Keyboard Bindings
.SS \fBkb-primary-paste\fP:
.PP
Paste primary selection
.PP
\fBDefault\fP: Control+V,Shift+Insert
.SS \fBkb-secondary-paste\fP
.PP
Paste clipboard
.PP
\fBDefault\fP: Control+v,Insert
.SS \fBkb-secondary-copy\fP
.PP
Copy current selection to clipboard
.PP
\fBDefault\fP: Control+c
.SS \fBkb-clear-line\fP
.PP
Clear input line
.PP
\fBDefault\fP: Control+w
.SS \fBkb-move-front\fP
.PP
Beginning of line
.PP
\fBDefault\fP: Control+a
.SS \fBkb-move-end\fP
.PP
End of line
.PP
\fBDefault\fP: Control+e
.SS \fBkb-move-word-back\fP
.PP
Move back one word
.PP
\fBDefault\fP: Alt+b,Control+Left
.SS \fBkb-move-word-forward\fP
.PP
Move forward one word
.PP
\fBDefault\fP: Alt+f,Control+Right
.SS \fBkb-move-char-back\fP
.PP
Move back one char
.PP
\fBDefault\fP: Left,Control+b
.SS \fBkb-move-char-forward\fP
.PP
Move forward one char
.PP
\fBDefault\fP: Right,Control+f
.SS \fBkb-remove-word-back\fP
.PP
Delete previous word
.PP
\fBDefault\fP: Control+Alt+h,Control+BackSpace
.SS \fBkb-remove-word-forward\fP
.PP
Delete next word
.PP
\fBDefault\fP: Control+Alt+d
.SS \fBkb-remove-char-forward\fP
.PP
Delete next char
.PP
\fBDefault\fP: Delete,Control+d
.SS \fBkb-remove-char-back\fP
.PP
Delete previous char
.PP
\fBDefault\fP: BackSpace,Shift+BackSpace,Control+h
.SS \fBkb-remove-to-eol\fP
.PP
Delete till the end of line
.PP
\fBDefault\fP: Control+k
.SS \fBkb-remove-to-sol\fP
.PP
Delete till the start of line
.PP
\fBDefault\fP: Control+u
.SS \fBkb-accept-entry\fP
.PP
Accept entry
.PP
\fBDefault\fP: Control+j,Control+m,Return,KP_Enter
.SS \fBkb-accept-custom\fP
.PP
Use entered text as command (in ssh/run modes)
.PP
\fBDefault\fP: Control+Return
.SS \fBkb-accept-custom-alt\fP
.PP
Use entered text as command (in ssh/run modes)
.PP
\fBDefault\fP: Control+Shift+Return
.SS \fBkb-accept-alt\fP
.PP
Use alternate accept command.
.PP
\fBDefault\fP: Shift+Return
.SS \fBkb-delete-entry\fP
.PP
Delete entry from history
.PP
\fBDefault\fP: Shift+Delete
.SS \fBkb-mode-next\fP
.PP
Switch to the next mode.
.PP
\fBDefault\fP: Shift+Right,Control+Tab
.SS \fBkb-mode-previous\fP
.PP
Switch to the previous mode.
.PP
\fBDefault\fP: Shift+Left,Control+ISO_Left_Tab
.SS \fBkb-mode-complete\fP
.PP
Start completion for mode.
.PP
\fBDefault\fP: Control+l
.SS \fBkb-row-left\fP
.PP
Go to the previous column
.PP
\fBDefault\fP: Control+Page_Up
.SS \fBkb-row-right\fP
.PP
Go to the next column
.PP
\fBDefault\fP: Control+Page_Down
.SS \fBkb-row-up\fP
.PP
Select previous entry
.PP
\fBDefault\fP: Up,Control+p
.SS \fBkb-row-down\fP
.PP
Select next entry
.PP
\fBDefault\fP: Down,Control+n
.SS \fBkb-row-tab\fP
.PP
Go to next row, if one left, accept it, if no left next mode.
.PP
\fBDefault\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
.SS \fBkb-page-next\fP
.PP
Go to the next page
.PP
\fBDefault\fP: Page_Down
.SS \fBkb-row-first\fP
.PP
Go to the first entry
.PP
\fBDefault\fP: Home,KP_Home
.SS \fBkb-row-last\fP
.PP
Go to the last entry
.PP
\fBDefault\fP: End,KP_End
.SS \fBkb-row-select\fP
.PP
Set selected item as input text
.PP
\fBDefault\fP: Control+space
.SS \fBkb-screenshot\fP
.PP
Take a screenshot of the rofi window
.PP
\fBDefault\fP: Alt+S
.SS \fBkb-ellipsize\fP
.PP
Toggle between ellipsize modes for displayed data
.PP
\fBDefault\fP: Alt+period
.SS \fBkb-toggle-case-sensitivity\fP
.PP
Toggle case sensitivity
.PP
\fBDefault\fP: grave,dead_grave
.SS \fBkb-toggle-sort\fP
.PP
Toggle sort
.PP
\fBDefault\fP: Alt+grave
.SS \fBkb-cancel\fP
.PP
Quit rofi
.PP
\fBDefault\fP: Escape,Control+g,Control+bracketleft
.SS \fBkb-custom-1\fP
.PP
Custom keybinding 1
.PP
\fBDefault\fP: Alt+1
.SS \fBkb-custom-2\fP
.PP
Custom keybinding 2
.PP
\fBDefault\fP: Alt+2
.SS \fBkb-custom-3\fP
.PP
Custom keybinding 3
.PP
\fBDefault\fP: Alt+3
.SS \fBkb-custom-4\fP
.PP
Custom keybinding 4
.PP
\fBDefault\fP: Alt+4
.SS \fBkb-custom-5\fP
.PP
Custom Keybinding 5
.PP
\fBDefault\fP: Alt+5
.SS \fBkb-custom-6\fP
.PP
Custom keybinding 6
.PP
\fBDefault\fP: Alt+6
.SS \fBkb-custom-7\fP
.PP
Custom Keybinding 7
.PP
\fBDefault\fP: Alt+7
.SS \fBkb-custom-8\fP
.PP
Custom keybinding 8
.PP
\fBDefault\fP: Alt+8
.SS \fBkb-custom-9\fP
.PP
Custom keybinding 9
.PP
\fBDefault\fP: Alt+9
.SS \fBkb-custom-10\fP
.PP
Custom keybinding 10
.PP
\fBDefault\fP: Alt+0
.SS \fBkb-custom-11\fP
.PP
Custom keybinding 11
.PP
\fBDefault\fP: Alt+exclam
.SS \fBkb-custom-12\fP
.PP
Custom keybinding 12
.PP
\fBDefault\fP: Alt+at
.SS \fBkb-custom-13\fP
.PP
Custom keybinding 13
.PP
\fBDefault\fP: Alt+numbersign
.SS \fBkb-custom-14\fP
.PP
Custom keybinding 14
.PP
\fBDefault\fP: Alt+dollar
.SS \fBkb-custom-15\fP
.PP
Custom keybinding 15
.PP
\fBDefault\fP: Alt+percent
.SS \fBkb-custom-16\fP
.PP
Custom keybinding 16
.PP
\fBDefault\fP: Alt+dead_circumflex
.SS \fBkb-custom-17\fP
.PP
Custom keybinding 17
.PP
\fBDefault\fP: Alt+ampersand
.SS \fBkb-custom-18\fP
.PP
Custom keybinding 18
.PP
\fBDefault\fP: Alt+asterisk
.SS \fBkb-custom-19\fP
.PP
Custom Keybinding 19
.PP
\fBDefault\fP: Alt+parenleft
.SS \fBkb-select-1\fP
.PP
Select row 1
.PP
\fBDefault\fP: Super+1
.SS \fBkb-select-2\fP
.PP
Select row 2
.PP
\fBDefault\fP: Super+2
.SS \fBkb-select-3\fP
.PP
Select row 3
.PP
\fBDefault\fP: Super+3
.SS \fBkb-select-4\fP
.PP
Select row 4
.PP
\fBDefault\fP: Super+4
.SS \fBkb-select-5\fP
.PP
Select row 5
.PP
\fBDefault\fP: Super+5
.SS \fBkb-select-6\fP
.PP
Select row 6
.PP
\fBDefault\fP: Super+6
.SS \fBkb-select-7\fP
.PP
Select row 7
.PP
\fBDefault\fP: Super+7
.SS \fBkb-select-8\fP
.PP
Select row 8
.PP
\fBDefault\fP: Super+8
.SS \fBkb-select-9\fP
.PP
Select row 9
.PP
\fBDefault\fP: Super+9
.SS \fBkb-select-10\fP
.PP
Select row 10
.PP
\fBDefault\fP: Super+0
.SH Mouse Bindings
.SS \fBml-row-left\fP
.PP
Go to the previous column
.PP
\fBDefault\fP: ScrollLeft
.SS \fBml-row-right\fP
.PP
Go to the next column
.PP
\fBDefault\fP: ScrollRight
.SS \fBml-row-up\fP
.PP
Select previous entry
.PP
\fBDefault\fP: ScrollUp
.SS \fBml-row-down\fP
.PP
Select next entry
.PP
\fBDefault\fP: ScrollDown
.SS \fBme-select-entry\fP
.PP
Select hovered row
.PP
\fBDefault\fP: MousePrimary
.SS \fBme-accept-entry\fP
.PP
Accept hovered row
.PP
\fBDefault\fP: MouseDPrimary
.SS \fBme-accept-custom\fP
.PP
Accept hovered row with custom action
.PP
\fBDefault\fP: Control+MouseDPrimary
.SH SEE ALSO
.PP
rofi(1), rofi-sensible-terminal(1), rofi-theme(5), rofi-script(5)
.SH AUTHOR
.PP
Qball Cow qball@gmpclient.org
\[la]mailto:qball@gmpclient.org\[ra]
.PP
Rasmus Steinke rasi@xssn.at
\[la]mailto:rasi@xssn.at\[ra]
.PP
Morgane Glidic sardemff7+rofi@sardemff7.net
\[la]mailto:sardemff7+rofi@sardemff7.net\[ra]
.PP
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

@@ -1,9 +1,8 @@
# ROFI-KEYS 5 rofi-keys # rofi-keys(5)
## NAME ## NAME
**rofi keys** - Rofi Key and Mouse bindings **rofi keys** - Rofi Key and Mouse bindings
## DESCRIPTION ## DESCRIPTION
@@ -52,401 +51,529 @@ configuration {
} }
``` ```
## Unsetting a binding
To unset a binding, pass an empty string.
```css
configuration {
kb-clear-line: "";
}
```
## Keyboard Bindings ## Keyboard Bindings
### **kb-primary-paste**: `kb-primary-paste`
Paste primary selection Paste primary selection
**Default**: Control+V,Shift+Insert Default: Control+V,Shift+Insert
`kb-secondary-paste`
### **kb-secondary-paste**
Paste clipboard Paste clipboard
**Default**: Control+v,Insert Default: Control+v,Insert
### **kb-secondary-copy** `kb-secondary-copy`
Copy current selection to clipboard Copy current selection to clipboard
**Default**: Control+c Default: Control+c
`kb-clear-line`
### **kb-clear-line**
Clear input line Clear input line
**Default**: Control+w Default: Control+w
`kb-move-front`
### **kb-move-front**
Beginning of line Beginning of line
**Default**: Control+a Default: Control+a
`kb-move-end`
### **kb-move-end**
End of line End of line
**Default**: Control+e Default: Control+e
`kb-move-word-back`
### **kb-move-word-back**
Move back one word Move back one word
**Default**: Alt+b,Control+Left Default: Alt+b,Control+Left
`kb-move-word-forward`
### **kb-move-word-forward**
Move forward one word Move forward one word
**Default**: Alt+f,Control+Right Default: Alt+f,Control+Right
`kb-move-char-back`
### **kb-move-char-back**
Move back one char Move back one char
**Default**: Left,Control+b Default: Left,Control+b
`kb-move-char-forward`
### **kb-move-char-forward**
Move forward one char Move forward one char
**Default**: Right,Control+f Default: Right,Control+f
`kb-remove-word-back`
### **kb-remove-word-back**
Delete previous word Delete previous word
**Default**: Control+Alt+h,Control+BackSpace Default: Control+Alt+h,Control+BackSpace
`kb-remove-word-forward`
### **kb-remove-word-forward**
Delete next word Delete next word
**Default**: Control+Alt+d Default: Control+Alt+d
`kb-remove-char-forward`
### **kb-remove-char-forward**
Delete next char Delete next char
**Default**: Delete,Control+d Default: Delete,Control+d
`kb-remove-char-back`
### **kb-remove-char-back**
Delete previous char Delete previous char
**Default**: BackSpace,Shift+BackSpace,Control+h Default: BackSpace,Shift+BackSpace,Control+h
`kb-remove-to-eol`
### **kb-remove-to-eol**
Delete till the end of line Delete till the end of line
**Default**: Control+k Default: Control+k
`kb-remove-to-sol`
### **kb-remove-to-sol**
Delete till the start of line Delete till the start of line
**Default**: Control+u Default: Control+u
`kb-accept-entry`
### **kb-accept-entry**
Accept entry Accept entry
**Default**: Control+j,Control+m,Return,KP_Enter Default: Control+j,Control+m,Return,KP\_Enter
`kb-accept-custom`
### **kb-accept-custom**
Use entered text as command (in ssh/run modes) Use entered text as command (in ssh/run modes)
**Default**: Control+Return Default: Control+Return
`kb-accept-custom-alt`
### **kb-accept-custom-alt**
Use entered text as command (in ssh/run modes) Use entered text as command (in ssh/run modes)
**Default**: Control+Shift+Return Default: Control+Shift+Return
`kb-accept-alt`
### **kb-accept-alt**
Use alternate accept command. Use alternate accept command.
**Default**: Shift+Return Default: Shift+Return
`kb-delete-entry`
### **kb-delete-entry**
Delete entry from history Delete entry from history
**Default**: Shift+Delete Default: Shift+Delete
`kb-mode-next`
### **kb-mode-next**
Switch to the next mode. Switch to the next mode.
**Default**: Shift+Right,Control+Tab Default: Shift+Right,Control+Tab
`kb-mode-previous`
### **kb-mode-previous**
Switch to the previous mode. Switch to the previous mode.
**Default**: Shift+Left,Control+ISO_Left_Tab Default: Shift+Left,Control+ISO\_Left\_Tab
`kb-mode-complete`
### **kb-mode-complete**
Start completion for mode. Start completion for mode.
**Default**: Control+l Default: Control+l
`kb-row-left`
### **kb-row-left**
Go to the previous column Go to the previous column
**Default**: Control+Page_Up Default: Control+Page\_Up
`kb-row-right`
### **kb-row-right**
Go to the next column Go to the next column
**Default**: Control+Page_Down Default: Control+Page\_Down
`kb-row-up`
### **kb-row-up**
Select previous entry Select previous entry
**Default**: Up,Control+p Default: Up,Control+p
`kb-row-down`
### **kb-row-down**
Select next entry Select next entry
**Default**: Down,Control+n Default: Down,Control+n
`kb-row-tab`
### **kb-row-tab**
Go to next row, if one left, accept it, if no left next mode. Go to next row, if one left, accept it, if no left next mode.
**Default**: Default:
`kb-element-next`
### **kb-element-next**
Go to next row. Go to next row.
**Default**: Tab Default: Tab
`kb-element-prev`
### **kb-element-prev**
Go to previous row. Go to previous row.
**Default**: ISO_Left_Tab Default: ISO\_Left\_Tab
`kb-page-prev`
### **kb-page-prev**
Go to the previous page Go to the previous page
**Default**: Page_Up Default: Page\_Up
`kb-page-next`
### **kb-page-next**
Go to the next page Go to the next page
**Default**: Page_Down Default: Page\_Down
`kb-row-first`
### **kb-row-first**
Go to the first entry Go to the first entry
**Default**: Home,KP_Home Default: Home,KP\_Home
`kb-row-last`
### **kb-row-last**
Go to the last entry Go to the last entry
**Default**: End,KP_End Default: End,KP\_End
`kb-row-select`
### **kb-row-select**
Set selected item as input text Set selected item as input text
**Default**: Control+space Default: Control+space
`kb-screenshot`
### **kb-screenshot**
Take a screenshot of the rofi window Take a screenshot of the rofi window
**Default**: Alt+S Default: Alt+S
`kb-ellipsize`
### **kb-ellipsize**
Toggle between ellipsize modes for displayed data Toggle between ellipsize modes for displayed data
**Default**: Alt+period Default: Alt+period
`kb-toggle-case-sensitivity`
### **kb-toggle-case-sensitivity**
Toggle case sensitivity Toggle case sensitivity
**Default**: grave,dead_grave Default: grave,dead\_grave
### **kb-toggle-sort** `kb-toggle-sort`
Toggle sort
**Default**: Alt+grave Toggle filtered menu sort
Default: Alt+grave
`kb-cancel`
### **kb-cancel**
Quit rofi Quit rofi
**Default**: Escape,Control+g,Control+bracketleft Default: Escape,Control+g,Control+bracketleft
`kb-custom-1`
### **kb-custom-1**
Custom keybinding 1 Custom keybinding 1
**Default**: Alt+1 Default: Alt+1
`kb-custom-2`
### **kb-custom-2**
Custom keybinding 2 Custom keybinding 2
**Default**: Alt+2 Default: Alt+2
`kb-custom-3`
### **kb-custom-3**
Custom keybinding 3 Custom keybinding 3
**Default**: Alt+3 Default: Alt+3
`kb-custom-4`
### **kb-custom-4**
Custom keybinding 4 Custom keybinding 4
**Default**: Alt+4 Default: Alt+4
`kb-custom-5`
### **kb-custom-5**
Custom Keybinding 5 Custom Keybinding 5
**Default**: Alt+5 Default: Alt+5
`kb-custom-6`
### **kb-custom-6**
Custom keybinding 6 Custom keybinding 6
**Default**: Alt+6 Default: Alt+6
`kb-custom-7`
### **kb-custom-7**
Custom Keybinding 7 Custom Keybinding 7
**Default**: Alt+7 Default: Alt+7
`kb-custom-8`
### **kb-custom-8**
Custom keybinding 8 Custom keybinding 8
**Default**: Alt+8 Default: Alt+8
`kb-custom-9`
### **kb-custom-9**
Custom keybinding 9 Custom keybinding 9
**Default**: Alt+9 Default: Alt+9
`kb-custom-10`
### **kb-custom-10**
Custom keybinding 10 Custom keybinding 10
**Default**: Alt+0 Default: Alt+0
`kb-custom-11`
### **kb-custom-11**
Custom keybinding 11 Custom keybinding 11
**Default**: Alt+exclam Default: Alt+exclam
`kb-custom-12`
### **kb-custom-12**
Custom keybinding 12 Custom keybinding 12
**Default**: Alt+at Default: Alt+at
`kb-custom-13`
### **kb-custom-13**
Custom keybinding 13 Custom keybinding 13
**Default**: Alt+numbersign Default: Alt+numbersign
`kb-custom-14`
### **kb-custom-14**
Custom keybinding 14 Custom keybinding 14
**Default**: Alt+dollar Default: Alt+dollar
`kb-custom-15`
### **kb-custom-15**
Custom keybinding 15 Custom keybinding 15
**Default**: Alt+percent Default: Alt+percent
`kb-custom-16`
### **kb-custom-16**
Custom keybinding 16 Custom keybinding 16
**Default**: Alt+dead_circumflex Default: Alt+dead\_circumflex
`kb-custom-17`
### **kb-custom-17**
Custom keybinding 17 Custom keybinding 17
**Default**: Alt+ampersand Default: Alt+ampersand
`kb-custom-18`
### **kb-custom-18**
Custom keybinding 18 Custom keybinding 18
**Default**: Alt+asterisk Default: Alt+asterisk
`kb-custom-19`
### **kb-custom-19**
Custom Keybinding 19 Custom Keybinding 19
**Default**: Alt+parenleft Default: Alt+parenleft
`kb-select-1`
### **kb-select-1**
Select row 1 Select row 1
**Default**: Super+1 Default: Super+1
`kb-select-2`
### **kb-select-2**
Select row 2 Select row 2
**Default**: Super+2 Default: Super+2
`kb-select-3`
### **kb-select-3**
Select row 3 Select row 3
**Default**: Super+3 Default: Super+3
`kb-select-4`
### **kb-select-4**
Select row 4 Select row 4
**Default**: Super+4 Default: Super+4
`kb-select-5`
### **kb-select-5**
Select row 5 Select row 5
**Default**: Super+5 Default: Super+5
`kb-select-6`
### **kb-select-6**
Select row 6 Select row 6
**Default**: Super+6 Default: Super+6
`kb-select-7`
### **kb-select-7**
Select row 7 Select row 7
**Default**: Super+7 Default: Super+7
`kb-select-8`
### **kb-select-8**
Select row 8 Select row 8
**Default**: Super+8 Default: Super+8
`kb-select-9`
### **kb-select-9**
Select row 9 Select row 9
**Default**: Super+9 Default: Super+9
`kb-select-10`
### **kb-select-10**
Select row 10 Select row 10
**Default**: Super+0 Default: Super+0
`kb-entry-history-up`
Go up in the entry history.
Default: Control+Up
`kb-entry-history-down`
Go down in the entry history.
Default: Control+Down
`kb-matcher-up`
Select the next matcher.
Default: Super+equal
`kb-matcher-down`
Select the previous matcher.
Default: Super+minus
## Mouse Bindings ## Mouse Bindings
### **ml-row-left** `ml-row-left`
Go to the previous column Go to the previous column
**Default**: ScrollLeft Default: ScrollLeft
`ml-row-right`
### **ml-row-right**
Go to the next column Go to the next column
**Default**: ScrollRight Default: ScrollRight
`ml-row-up`
### **ml-row-up**
Select previous entry Select previous entry
**Default**: ScrollUp Default: ScrollUp
`ml-row-down`
### **ml-row-down**
Select next entry Select next entry
**Default**: ScrollDown Default: ScrollDown
`me-select-entry`
### **me-select-entry**
Select hovered row Select hovered row
**Default**: MousePrimary Default: MousePrimary
`me-accept-entry`
### **me-accept-entry**
Accept hovered row Accept hovered row
**Default**: MouseDPrimary Default: MouseDPrimary
`me-accept-custom`
### **me-accept-custom**
Accept hovered row with custom action Accept hovered row with custom action
**Default**: Control+MouseDPrimary Default: Control+MouseDPrimary
## Mouse key bindings
The following mouse buttons can be bound:
* `Primary`: Primary (Left) mouse button click.
* `Secondary`: Secondary (Right) mouse button click.
* `Middle`: Middle mouse button click.
* `Forward`: The forward mouse button.
* `Back`: The back mouse button.
* `ExtraN`: The N'the mouse button. (Depending on mouse support).
The Identifier is constructed as follow:
`Mouse<D><Button>`
* `D` indicates optional Double press.
* `Button` is the button name.
So `MouseDPrimary` is Primary (`Left`) mouse button double click.
## SEE ALSO ## SEE ALSO
rofi(1), rofi-sensible-terminal(1), rofi-theme(5), rofi-script(5) rofi(1), rofi-sensible-terminal(1), rofi-theme(5), rofi-script(5)
## AUTHOR ## AUTHOR
@@ -456,7 +583,6 @@ Rasmus Steinke <rasi@xssn.at>
Morgane Glidic <sardemff7+rofi@sardemff7.net> Morgane Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com> Original code based on work by: Sean Pringle <sean.pringle@gmail.com>
For a full list of authors, check the AUTHORS file. For a full list of authors, check the AUTHORS file.

View File

@@ -1,227 +0,0 @@
.nh
.TH ROFI-SCRIPT 5 rofi-script
.SH NAME
.PP
\fBrofi script mode\fP - Rofi format for scriptable mode.
.SH DESCRIPTION
.PP
\fBrofi\fP supports modes that use simple scripts in the background to generate a
list and process the result from user actions. This provide a simple interface
to make simple extensions to rofi.
.SH USAGE
.PP
To specify a script mode, set a mode with the following syntax: "{name}:{executable}"
.PP
For example:
.PP
.RS
.nf
rofi -show fb -modes "fb:file_browser.sh"
.fi
.RE
.PP
The name should be unique.
.SH API
.PP
Rofi calls the executable without arguments on startup. This should generate a
list of options, separated by a newline (\fB\fC\\n\fR) (This can be changed by the
script). If the user selects an option, rofi calls the executable with the text
of that option as the first argument. If the script returns no entries, rofi
quits.
.PP
A simple script would be:
.PP
.RS
.nf
#!/usr/bin/env bash
if [ x"$@" = x"quit" ]
then
exit 0
fi
echo "reload"
echo "quit"
.fi
.RE
.PP
This shows two entries, reload and quit. When the quit entry is selected, rofi closes.
.SH Environment
.PP
Rofi sets the following environment variable when executing the script:
.SS \fB\fCROFI_RETV\fR
.PP
An integer number with the current state:
.RS
.IP \(bu 2
\fB0\fP: Initial call of script.
.IP \(bu 2
\fB1\fP: Selected an entry.
.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 ).
.RE
.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.
Extra options are lines that start with a NULL character (\fB\fC\\0\fR) followed by a key, separator (\fB\fC\\x1f\fR) and value.
.PP
For example to set the prompt:
.PP
.RS
.nf
echo -en "\\0prompt\\x1fChange prompt\\n"
.fi
.RE
.PP
The following extra options exists:
.RS
.IP \(bu 2
\fBprompt\fP: Update the prompt text.
.IP \(bu 2
\fBmessage\fP: Update the message text.
.IP \(bu 2
\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
\fBactive\fP: Mark rows as active. (for syntax see the active option in dmenu mode)
.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.
.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.
.IP \(bu 2
\fBkeep-selection\fP: If set, the selection is not moved to the first entry, but the current position is maintained. The filter is cleared.
.IP \(bu 2
\fBnew-selection\fP: If \fB\fCkeep-selection\fR is set, this allows you to override the selected entry (absolute position).
.IP \(bu 2
\fBdata\fP: Passed data to the next execution of the script via \fBROFI_DATA\fP\&.
.IP \(bu 2
\fBtheme\fP: Small theme snippet to f.e. change the background color of a widget.
.RE
.SH Parsing row options
.PP
Extra options for individual rows can be set.
The extra option can be specified following the same syntax as mode option, but following the entry.
.PP
For example:
.PP
.RS
.nf
echo -en "aap\\0icon\\x1ffolder\\n"
.fi
.RE
.PP
The following options are supported:
.RS
.IP \(bu 2
\fBicon\fP: Set the icon for that row.
.IP \(bu 2
\fBmeta\fP: Specify invisible search terms.
.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.
.RE
.PP
multiple entries can be passed using the \fB\fC\\x1f\fR separator.
.PP
.RS
.nf
echo -en "aap\\0icon\\x1ffolder\\x1finfo\\x1ftest\\n"
.fi
.RE
.SH Executing external program
.PP
If you want to launch an external program from the script, you need to make sure it is launched in the background.
If not rofi will wait for its output (to display).
.PP
In bash the best way to do this is using \fB\fCcoproc\fR\&.
.PP
.RS
.nf
coproc ( myApp > /dev/null 2>&1 )
.fi
.RE
.SH DASH shell
.PP
If you use the \fB\fCdash\fR shell for your script, take special care with how dash handles escaped values for the separators.
See issue #1201 on github.
.SH SEE ALSO
.PP
rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-theme-selector(1)
.SH AUTHOR
.PP
Qball Cow qball@gmpclient.org
\[la]mailto:qball@gmpclient.org\[ra]
.PP
Rasmus Steinke rasi@xssn.at
\[la]mailto:rasi@xssn.at\[ra]
.PP
Morgane Glidic sardemff7+rofi@sardemff7.net
\[la]mailto:sardemff7+rofi@sardemff7.net\[ra]
.PP
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

@@ -1,24 +1,23 @@
# ROFI-SCRIPT 5 rofi-script # rofi-script(5)
## NAME ## NAME
**rofi script mode** - Rofi format for scriptable mode. **rofi script mode** - Rofi format for scriptable mode.
## DESCRIPTION ## DESCRIPTION
**rofi** supports modes that use simple scripts in the background to generate a **rofi** supports modes that use simple scripts in the background to generate a
list and process the result from user actions. This provide a simple interface list and process the result from user actions. This provide a simple interface
to make simple extensions to rofi. to make simple extensions to rofi.
## USAGE ## USAGE
To specify a script mode, set a mode with the following syntax: "{name}:{executable}" To specify a script mode, set a mode with the following syntax:
"{name}:{executable}"
For example: For example:
``` ```bash
rofi -show fb -modes "fb:file_browser.sh" rofi -show fb -modes "fb:file_browser.sh"
``` ```
@@ -46,7 +45,8 @@ echo "quit"
``` ```
This shows two entries, reload and quit. When the quit entry is selected, rofi closes. This shows two entries, reload and quit. When the quit entry is selected, rofi
closes.
## Environment ## Environment
@@ -56,14 +56,16 @@ Rofi sets the following environment variable when executing the script:
An integer number with the current state: An integer number with the current state:
* **0**: Initial call of script. - **0**: Initial call of script.
* **1**: Selected an entry. - **1**: Selected an entry.
* **2**: Selected a custom entry. - **2**: Selected a custom entry.
* **10-28**: Custom keybinding 1-19 ( need to be explicitly enabled by script ). - **3**: Deleted an entry.
- **10-28**: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
### `ROFI_INFO` ### `ROFI_INFO`
Environment get set when selected entry get set with the property value of the 'info' row option, if set. Environment get set when selected entry get set with the property value of the
'info' row option, if set.
### `ROFI_DATA` ### `ROFI_DATA`
@@ -71,8 +73,9 @@ Environment get set when script sets `data` option in header.
## Passing mode options ## Passing mode options
Extra options, like setting the prompt, can be set by the script. Extra options, like setting the prompt, can be set by the script. Extra options
Extra options are lines that start with a NULL character (`\0`) followed by a key, separator (`\x1f`) and value. are lines that start with a NULL character (`\0`) followed by a key, separator
(`\x1f`) and value.
For example to set the prompt: For example to set the prompt:
@@ -82,23 +85,50 @@ For example to set the prompt:
The following extra options exists: The following extra options exists:
* **prompt**: Update the prompt text. - **prompt**: Update the prompt text.
* **message**: Update the message text.
* **markup-rows**: If 'true' renders markup in the row. - **message**: Update the message text.
* **urgent**: Mark rows as urgent. (for syntax see the urgent option in dmenu mode)
* **active**: Mark rows as active. (for syntax see the active option in dmenu mode) - **markup-rows**: If 'true' renders markup in the row.
* **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. - **urgent**: Mark rows as urgent. (for syntax see the urgent option in
* **use-hot-keys**: If set to true, it enabled the Custom keybindings for script. Warning this breaks the normal rofi flow. dmenu mode)
* **keep-selection**: If set, the selection is not moved to the first entry, but the current position is maintained. The filter is cleared.
* **new-selection**: If `keep-selection` is set, this allows you to override the selected entry (absolute position). - **active**: Mark rows as active. (for syntax see the active option in
* **data**: Passed data to the next execution of the script via **ROFI_DATA**. dmenu mode)
* **theme**: Small theme snippet to f.e. change the background color of a widget.
- **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.
- **keep-selection**: If set, the selection is not moved to the first entry,
but the current position is maintained. The filter is cleared.
- **keep-filter**: If set, the filter is not cleared.
- **new-selection**: If `keep-selection` is set, this allows you to override
the selected entry (absolute position).
- **data**: Passed data to the next execution of the script via
**ROFI\_DATA**.
- **theme**: Small theme snippet to f.e. change the background color of
a widget.
The **theme** property cannot change the interface while running, it is only
usable for small changes in, for example background color, of widgets that get
updated during display like the row color of the listview.
## Parsing row options ## Parsing row options
Extra options for individual rows can be set. Extra options for individual rows can be set. The extra option can be specified
The extra option can be specified following the same syntax as mode option, but following the entry. following the same syntax as mode option, but following the entry.
For example: For example:
@@ -108,10 +138,22 @@ For example:
The following options are supported: The following options are supported:
* **icon**: Set the icon for that row. - **icon**: Set the icon for that row.
* **meta**: Specify invisible search terms.
* **nonselectable**: If true the row cannot activated. - **display**: Replace the displayed string. (Original string will still be used for filtering)
* **info**: Info that, on selection, gets placed in the `ROFI_INFO` environment variable. This entry does not get searched.
- **meta**: Specify invisible search terms used for filtering.
- **nonselectable**: If true the row cannot activated.
- **permanent**: If true the row always shows, independent of filter.
- **info**: Info that, on selection, gets placed in the `ROFI_INFO`
environment variable. This entry does not get searched for filtering.
- **urgent**: Set urgent flag on entry (true/false)
- **active**: Set active flag on entry (true/false)
multiple entries can be passed using the `\x1f` separator. multiple entries can be passed using the `\x1f` separator.
@@ -121,8 +163,9 @@ multiple entries can be passed using the `\x1f` separator.
## Executing external program ## Executing external program
If you want to launch an external program from the script, you need to make sure it is launched in the background. If you want to launch an external program from the script, you need to make
If not rofi will wait for its output (to display). sure it is launched in the background. If not rofi will wait for its output (to
display).
In bash the best way to do this is using `coproc`. In bash the best way to do this is using `coproc`.
@@ -130,16 +173,36 @@ In bash the best way to do this is using `coproc`.
coproc ( myApp > /dev/null 2>&1 ) coproc ( myApp > /dev/null 2>&1 )
``` ```
## DASH shell ## DASH shell
If you use the `dash` shell for your script, take special care with how dash handles escaped values for the separators. If you use the `dash` shell for your script, take special care with how dash
See issue #1201 on github. handles escaped values for the separators. See issue #1201 on github.
## Script locations
To specify a script there are the following options:
- Specify an absolute path to the script.
- The script is executable and located in your $PATH
Scripts located in the following location are **loaded** on startup
and can be directly launched based on the filename (without extension):
- The script is in `$XDG_CONFIG_HOME/rofi/scripts/`, this is usually
`~/.config/rofi/scripts/`.
If you have a script 'mymode.sh' in this folder you can open it using:
```bash
rofi -show mymode
```
See `rofi -h` output for a list of detected scripts.
## SEE ALSO ## SEE ALSO
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)
## AUTHOR ## AUTHOR
@@ -149,7 +212,6 @@ Rasmus Steinke <rasi@xssn.at>
Morgane Glidic <sardemff7+rofi@sardemff7.net> Morgane Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com> Original code based on work by: Sean Pringle <sean.pringle@gmail.com>
For a full list of authors, check the AUTHORS file. For a full list of authors, check the AUTHORS file.

View File

@@ -1,71 +0,0 @@
.nh
.TH rofi-sensible-terminal 1 rofi-sensible-terminal
.SH NAME
.PP
\fBrofi-sensible-terminal\fP - launches $TERMINAL with fallbacks
.SH SYNOPSIS
.PP
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
shipping this script in a way which is appropriate for the distribution.
.PP
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)
.IP \(bu 2
x-terminal-emulator
.IP \(bu 2
urxvt
.IP \(bu 2
rxvt
.IP \(bu 2
st
.IP \(bu 2
terminology
.IP \(bu 2
qterminal
.IP \(bu 2
Eterm
.IP \(bu 2
aterm
.IP \(bu 2
uxterm
.IP \(bu 2
xterm
.IP \(bu 2
roxterm
.IP \(bu 2
xfce4-terminal.wrapper
.IP \(bu 2
mate-terminal
.IP \(bu 2
lxterminal
.IP \(bu 2
konsole
.IP \(bu 2
alacritty
.IP \(bu 2
kitty
.RE
.SH SEE ALSO
.PP
rofi(1)
.SH AUTHORS
.PP
Dave Davenport and contributors
.PP
Copied script from i3:
Michael Stapelberg and contributors

View File

@@ -1,4 +1,4 @@
# rofi-sensible-terminal 1 rofi-sensible-terminal # rofi-sensible-terminal(1)
## NAME ## NAME
@@ -35,6 +35,8 @@ It tries to start one of the following (in that order):
* konsole * konsole
* alacritty * alacritty
* kitty * kitty
* wezterm
* foot
## SEE ALSO ## SEE ALSO

View File

@@ -1,45 +0,0 @@
.nh
.TH rofi-theme-selector 1 rofi-theme-selector
.SH NAME
.PP
\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\&.
It's part of any installation of \fBrofi\fP\&.
.SH USAGE
.SS Running rofi-theme-selector
.PP
\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:
.RS
.IP \(bu 2
${PREFIX}/share/rofi/themes
.IP \(bu 2
$XDG_CONFIG_HOME/rofi/themes
.IP \(bu 2
$XDG_DATA_HOME/share/rofi/themes
.RE
.PP
${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
rofi(1)
.SH AUTHORS
.PP
Qball Cow qball@gmpclient.org
Rasmus Steinke rasi@xssn.at

View File

@@ -1,4 +1,4 @@
# rofi-theme-selector 1 rofi-theme-selector # rofi-theme-selector(1)
## NAME ## NAME
@@ -6,27 +6,27 @@
## DESCRIPTION ## DESCRIPTION
**rofi-theme-selector** is a bash/rofi script to preview and apply themes for **rofi**. **rofi-theme-selector** is a bash/rofi script to preview and apply themes for
It's part of any installation of **rofi**. **rofi**. It's part of any installation of **rofi**.
## USAGE ## USAGE
### Running rofi-theme-selector ### Running rofi-theme-selector
**rofi-theme-selector** shows a list of all available themes in a **rofi** window. **rofi-theme-selector** shows a list of all available themes in a **rofi**
It lets you preview each theme with the Enter key and apply the theme to your window. It lets you preview each theme with the Enter key and apply the theme
**rofi** configuration file with Alt+a. to your **rofi** configuration file with Alt+a.
## Theme directories ## Theme directories
**rofi-theme-selector** searches the following directories for themes: **rofi-theme-selector** searches the following directories for themes:
* ${PREFIX}/share/rofi/themes - ${PREFIX}/share/rofi/themes
* $XDG_CONFIG_HOME/rofi/themes - $XDG_CONFIG_HOME/rofi/themes
* $XDG_DATA_HOME/share/rofi/themes - $XDG_DATA_HOME/share/rofi/themes
${PREFIX} reflects the install location of rofi. In most cases this will be "/usr".<br> ${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_CONFIG_HOME is normally unset. Default path is "$HOME/.config".<br>
$XDG_DATA_HOME is normally unset. Default path is "$HOME/.local/share". $XDG_DATA_HOME is normally unset. Default path is "$HOME/.local/share".

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,85 @@
# rofi-thumbnails(5)
## NAME
**rofi-thumbnails** - Rofi thumbnails system
## DESCRIPTION
**rofi** is now able to show thumbnails for all file types where an XDG compatible thumbnailer is present in the system.
This is done by default in filebrowser and recursivebrowser mode, if **rofi** is launched with the `-show-icons` argument.
In a custom user script or dmenu mode, it is possible to produce entry icons using XDG thumbnailers by adding the prefix `thumbnail://` to the filename
specified after `\0icon\x1f`, for example:
```bash
echo -en "EntryName\0icon\x1fthumbnail://path/to/file\n" | rofi -dmenu -show-icons
```
### XDG thumbnailers
XDG thumbnailers are files with a ".thumbnailer" suffix and a structure similar to ".desktop" files for launching applications. They are placed in `/usr/share/thumbnailers/` or `$HOME/.local/share/thumbnailers/`, and contain a list of mimetypes, for which is possible to produce the thumbnail image, and a string with the command to create said image. The example below shows the content of `librsvg.thumbnailer`, a thumbnailer for svg files using librsvg:
```
[Thumbnailer Entry]
TryExec=/usr/bin/gdk-pixbuf-thumbnailer
Exec=/usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
MimeType=image/svg+xml;image/svg+xml-compressed;
```
The images produced are named as the md5sum of the input files and placed, depending on their size, in the XDG thumbnails directories: `$HOME/.cache/thumbnails/{normal,large,x-large,xx-large}`. They are then loaded by **rofi** as entry icons and can also be used by file managers like Thunar, Caja or KDE Dolphin to show their thumbnails. Additionally, if a thumbnail for a file is found in the thumbnails directories (produced previously by **rofi** or a file manager), **rofi** will load it instead of calling the thumbnailer.
If a suitable thumbnailer for a given file is not found, **rofi** will try to use the corresponding mimetype icon from the icon theme.
### Custom command to create thumbnails
It is possible to use a custom command to generate thumbnails for generic entry names, for example a script that downloads an icon given its url or selects different icons depending on the input. This can be done providing the `-preview-cmd` argument followed by a string with the command to execute, with the following syntax:
```
rofi ... -preview-cmd 'path/to/script_or_cmd "{input}" "{output}" "{size}"'
```
**rofi** will call the script or command substituting `{input}` with the input entry icon name (the string after `\0icon\x1fthumbnail://`), `{output}` with the output filename of the thumbnail and `{size}` with the requested thumbnail size. The script or command is responsible of producing a thumbnail image (if possible respecting the requested size) and saving it in the given `{output}` filename.
### Issues with AppArmor
In Linux distributions using AppArmor (such as Ubuntu and Debian), the default rules shipped can cause issues with thumbnails generation. If that is the case, AppArmor can be disabled by issuing the following commands
```
sudo systemctl stop apparmor
sudo systemctl disable apparmor
```
In alternative, the following apparmor profile con be placed in a file named /etc/apparmor.d/usr.bin.rofi
```
#vim:syntax=apparmor
# AppArmor policy for rofi
#include <tunables/global>
/usr/bin/rofi {
#include <abstractions/base>
# TCP/UDP network access for NFS
network inet stream,
network inet6 stream,
network inet dgram,
network inet6 dgram,
/usr/bin/rofi mr,
@{HOME}/ r,
@{HOME}/** rw,
owner @{HOME}/.cache/thumbnails/** rw,
}
```
then run
```
apparmor_parser -r /etc/apparmor.d/usr.bin.rofi
```
to reload the rule. This assumes that **rofi** binary is in /usr/bin, that is the case of a standard package installation.

1608
doc/rofi.1

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -28,6 +28,7 @@
#ifndef ROFI_DISPLAY_INTERNAL_H #ifndef ROFI_DISPLAY_INTERNAL_H
#define ROFI_DISPLAY_INTERNAL_H #define ROFI_DISPLAY_INTERNAL_H
#include "display.h"
#include "helper.h" #include "helper.h"
#include "nkutils-bindings.h" #include "nkutils-bindings.h"
#include <glib.h> #include <glib.h>
@@ -48,8 +49,8 @@ typedef struct _display_proxy {
void (*set_input_focus)(guint window); void (*set_input_focus)(guint window);
void (*revert_input_focus)(void); void (*revert_input_focus)(void);
char *(*get_clipboard_data)(int type); void (*get_clipboard_data)(int type, ClipboardCb callback, void *user_data);
void (*set_fullscreen_mode)(); void (*set_fullscreen_mode)(void);
guint (*scale)(void); guint (*scale)(void);

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -127,7 +127,8 @@ enum clipboard_type {
CLIPBOARD_PRIMARY, CLIPBOARD_PRIMARY,
}; };
char *display_get_clipboard_data(enum clipboard_type); typedef void (* ClipboardCb)(char *clipboard_data, void *user_data);
void display_get_clipboard_data(enum clipboard_type, ClipboardCb callback, void* user_data);
void display_set_fullscreen_mode(void); void display_set_fullscreen_mode(void);

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -200,13 +200,15 @@ char *rofi_expand_path(const char *input);
* @param needlelen The length of the needle * @param needlelen The length of the needle
* @param haystack The string to match against * @param haystack The string to match against
* @param haystacklen The length of the haystack * @param haystacklen The length of the haystack
* @param case_sensitive Whether case is significant.
* *
* UTF-8 aware levenshtein distance calculation * UTF-8 aware levenshtein distance calculation
* *
* @returns the levenshtein distance between needle and haystack * @returns the levenshtein distance between needle and haystack
*/ */
unsigned int levenshtein(const char *needle, const glong needlelen, unsigned int levenshtein(const char *needle, const glong needlelen,
const char *haystack, const glong haystacklen); const char *haystack, const glong haystacklen,
const int case_sensitive);
/** /**
* @param data the unvalidated character array holding possible UTF-8 data * @param data the unvalidated character array holding possible UTF-8 data
@@ -234,6 +236,7 @@ char *rofi_latin_to_utf8_strdup(const char *input, gssize length);
* @param plen Pattern length. * @param plen Pattern length.
* @param str The input to match against pattern. * @param str The input to match against pattern.
* @param slen Length of str. * @param slen Length of str.
* @param case_sensitive Whether case is significant.
* *
* rofi_scorer_fuzzy_evaluate implements a global sequence alignment algorithm * rofi_scorer_fuzzy_evaluate implements a global sequence alignment algorithm
* to find the maximum accumulated score by aligning `pattern` to `str`. It * to find the maximum accumulated score by aligning `pattern` to `str`. It
@@ -263,7 +266,7 @@ char *rofi_latin_to_utf8_strdup(const char *input, gssize length);
* @returns the sorting weight. * @returns the sorting weight.
*/ */
int rofi_scorer_fuzzy_evaluate(const char *pattern, glong plen, const char *str, int rofi_scorer_fuzzy_evaluate(const char *pattern, glong plen, const char *str,
glong slen); glong slen, const int case_sensitive);
/*@}*/ /*@}*/
/** /**
@@ -319,7 +322,9 @@ gboolean helper_execute(const char *wd, char **args, const char *error_precmd,
* @param wd The work directory (optional) * @param wd The work directory (optional)
* @param cmd The cmd to execute * @param cmd The cmd to execute
* @param run_in_term Indicate if command should be run in a terminal * @param run_in_term Indicate if command should be run in a terminal
* @param context The startup notification context, if any * @param startup_notify True if the command is expected to notify on startup
* @param context Additional information about the application, such as its
* app_id. May be NULL.
* *
* Execute command. * Execute command.
* If needed members of context are NULL, they will be filled. * If needed members of context are NULL, they will be filled.
@@ -328,6 +333,7 @@ gboolean helper_execute(const char *wd, char **args, const char *error_precmd,
*/ */
gboolean helper_execute_command(const char *wd, const char *cmd, gboolean helper_execute_command(const char *wd, const char *cmd,
gboolean run_in_term, gboolean run_in_term,
gboolean startup_notify,
RofiHelperExecuteContext *context); RofiHelperExecuteContext *context);
/** /**
@@ -353,6 +359,13 @@ cairo_surface_t *cairo_image_surface_create_from_svg(const gchar *file,
*/ */
void parse_ranges(char *input, rofi_range_pair **list, unsigned int *length); void parse_ranges(char *input, rofi_range_pair **list, unsigned int *length);
/**
* @param input String to parse
*
* @returns String matching should be case sensitive or insensitive
*/
int parse_case_sensitivity(const char *input);
/** /**
* @param format The format string used. See below for possible syntax. * @param format The format string used. See below for possible syntax.
* @param string The selected entry. * @param string The selected entry.
@@ -393,11 +406,70 @@ char *helper_string_replace_if_exists(char *string, ...);
/** /**
* @param file File name passed to option. * @param file File name passed to option.
* @param ext File extension passed to option. * @param ext NULL terminated array of file extension passed to option.
* @param parent_dir The file that was used to import this file, or NULL.
*
* Get the full path to the theme, trying to resolve it over the possible
* locations.
* *
* @returns path to theme or copy of filename if not found. * @returns path to theme or copy of filename if not found.
*/ */
char *helper_get_theme_path(const char *file, const char *ext); char *helper_get_theme_path(const char *file, const char **ext,
const char *parent_dir)
__attribute__((nonnull(1, 2)));
/**
* @param name The name of the element to find.
* @param state The state of the element.
* @param exact If the match should be exact, or parent can be included.
*
* Find the configuration element. If not exact, the closest specified element
* is returned.
*
* @returns the ThemeWidget if found, otherwise NULL.
*/
ConfigEntry *rofi_config_find_widget(const char *name, const char *state,
gboolean exact);
/**
* @param widget The widget to find the property on.
* @param type The %PropertyType to find.
* @param property The property to find.
* @param exact If the property should only be found on this widget, or on
* parents if not found.
*
* Find the property on the widget. If not exact, the parents are searched
* recursively until match is found.
*
* @returns the Property if found, otherwise NULL.
*/
Property *rofi_theme_find_property(ConfigEntry *widget, PropertyType type,
const char *property, gboolean exact);
/**
* @returns get a human readable string with the current matching method.
*/
const char *helper_get_matching_mode_str(void);
/**
* Switch to the next matching method.
*/
void helper_select_next_matching_mode(void);
/**
* Switch to the previous matching method.
*/
void helper_select_previous_matching_mode(void);
/**
* Method to indicate fallthrough. This will help
* gcc/llvm warning/static code analysis.
*/
#if __has_attribute(__fallthrough__)
#define rofi_fallthrough __attribute__((__fallthrough__))
#else
#define rofi_fallthrough \
do { \
} while (0) /* fallthrough */
#endif
G_END_DECLS G_END_DECLS

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -143,6 +143,10 @@ typedef enum {
SELECT_ELEMENT_8, SELECT_ELEMENT_8,
SELECT_ELEMENT_9, SELECT_ELEMENT_9,
SELECT_ELEMENT_10, SELECT_ELEMENT_10,
ENTRY_HISTORY_UP,
ENTRY_HISTORY_DOWN,
MATCHER_UP,
MATCHER_DOWN
} KeyBindingAction; } KeyBindingAction;
/** /**
@@ -186,6 +190,9 @@ gboolean parse_keys_abe(NkBindings *bindings);
*/ */
void setup_abe(void); void setup_abe(void);
/**
* List all available key bindings to the terminal.
*/
void abe_list_all_bindings(gboolean is_term); void abe_list_all_bindings(gboolean is_term);
/** /**
* @param name Don't have the name. * @param name Don't have the name.

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -31,8 +31,20 @@
#include <gmodule.h> #include <gmodule.h>
G_BEGIN_DECLS G_BEGIN_DECLS
/** ABI version to check if loaded plugin is compatible. */ /**
#define ABI_VERSION 6u * Indicator what type of mode this is.
* For now it can be the classic switcher, or also implement a completer.
*/
typedef enum {
/** Mode type is not set */
MODE_TYPE_UNSET = 0x0,
/** A normal mode. */
MODE_TYPE_SWITCHER = 0x1,
/** A mode that can be used to completer */
MODE_TYPE_COMPLETER = 0x2,
/** DMenu mode. */
MODE_TYPE_DMENU = 0x4,
} ModeType;
/** /**
* @param data Pointer to #Mode object. * @param data Pointer to #Mode object.
@@ -61,7 +73,6 @@ typedef char *(*_mode_get_display_value)(const Mode *sw,
* @param sw The #Mode pointer * @param sw The #Mode pointer
* @param selected_line The selected line * @param selected_line The selected line
* @param height The height of the icon * @param height The height of the icon
* @param scale The scale of the icon
* *
* Obtains the icon if available * Obtains the icon if available
* *
@@ -69,8 +80,7 @@ typedef char *(*_mode_get_display_value)(const Mode *sw,
*/ */
typedef cairo_surface_t *(*_mode_get_icon)(const Mode *sw, typedef cairo_surface_t *(*_mode_get_icon)(const Mode *sw,
unsigned int selected_line, unsigned int selected_line,
unsigned int height, unsigned int height);
guint scale);
/** /**
* @param sw The #Mode pointer * @param sw The #Mode pointer
@@ -153,6 +163,29 @@ typedef char *(*_mode_preprocess_input)(Mode *sw, const char *input);
*/ */
typedef char *(*_mode_get_message)(const Mode *sw); typedef char *(*_mode_get_message)(const Mode *sw);
/**
* Create a new instance of this mode.
* Free (free) result after use, after using mode_destroy.
*
* @returns Instantiate a new instance of this mode.
*/
typedef Mode *(*_mode_create)(void);
/**
* @param sw The #Mode pointer
* @param menu_retv The return value
* @param input The input string
* @param selected_line The selected line
* @param path the path that was completed
*
* Handle the user accepting an entry in completion mode.
*
* @returns the next action to take
*/
typedef ModeMode (*_mode_completer_result)(Mode *sw, int menu_retv,
char **input,
unsigned int selected_line,
char **path);
/** /**
* Structure defining a switcher. * Structure defining a switcher.
* It consists of a name, callback and if enabled * It consists of a name, callback and if enabled
@@ -199,6 +232,17 @@ struct rofi_mode {
* And has data in `ed` * And has data in `ed`
*/ */
_mode_free free; _mode_free free;
/**
* Create mode.
*/
_mode_create _create;
/**
* If this mode is used as completer.
*/
_mode_completer_result _completer_result;
/** Extra fields for script */ /** Extra fields for script */
void *ed; void *ed;
@@ -208,6 +252,9 @@ struct rofi_mode {
/** Fallack icon.*/ /** Fallack icon.*/
uint32_t fallback_icon_fetch_uid; uint32_t fallback_icon_fetch_uid;
uint32_t fallback_icon_not_found; uint32_t fallback_icon_not_found;
/** type */
ModeType type;
}; };
G_END_DECLS G_END_DECLS
#endif // ROFI_MODE_PRIVATE_H #endif // ROFI_MODE_PRIVATE_H

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -29,7 +29,12 @@
#define ROFI_MODE_H #define ROFI_MODE_H
#include "rofi-types.h" #include "rofi-types.h"
#include <cairo.h> #include <cairo.h>
#include <gmodule.h>
G_BEGIN_DECLS G_BEGIN_DECLS
/** ABI version to check if loaded plugin is compatible. */
#define ABI_VERSION 7u
/** /**
* @defgroup MODE Mode * @defgroup MODE Mode
* *
@@ -133,14 +138,13 @@ char *mode_get_display_value(const Mode *mode, unsigned int selected_line,
* @param mode The mode to query * @param mode The mode to query
* @param selected_line The entry to query * @param selected_line The entry to query
* @param height The desired height of the icon. * @param height The desired height of the icon.
* @param scale The desired scale of the icon.
* *
* Returns the icon for the selected_line * Returns the icon for the selected_line
* *
* @returns allocated new cairo_surface_t if applicable * @returns allocated new cairo_surface_t if applicable
*/ */
cairo_surface_t *mode_get_icon(Mode *mode, unsigned int selected_line, cairo_surface_t *mode_get_icon(Mode *mode, unsigned int selected_line,
unsigned int height, guint scale); unsigned int height);
/** /**
* @param mode The mode to query * @param mode The mode to query
@@ -248,6 +252,58 @@ char *mode_preprocess_input(Mode *mode, const char *input);
* free). * free).
*/ */
char *mode_get_message(const Mode *mode); char *mode_get_message(const Mode *mode);
/**
* @param mode The mode to create an instance off.
*
* @returns a new instance of the mode.
*/
Mode *mode_create(const Mode *mode);
/**
* @param sw The mode to query
* @param menu_retv The menu return value.
* @param input Pointer to the user input string. [in][out]
* @param selected_line the line selected by the user.
* @param path get the path to the selected file. [out]
*
* Acts on the user interaction.
*
* @returns the next #ModeMode.
*/
ModeMode mode_completer_result(Mode *sw, int menu_retv, char **input,
unsigned int selected_line, char **path);
/**
* @param sw The mode to query.
*
* Check if mode is a valid completer.
*
* @returns TRUE if mode can be used as completer.
*/
gboolean mode_is_completer(const Mode *sw);
/**
* @param mode The mode to query
*
* @returns the modes ABI version.
*/
int mode_get_abi_version(Mode *const mode);
/**
* @param mode The mode to query
* @param mod The GModule used to load the mode
*
* Set GModule used to load this plugin, this is used to
* unload it on shutdown.
*/
void mode_plugin_set_module(Mode *mode, GModule *mod);
/**
* @param mode The mode to query
*
* @returns the GModule used to load this plugin. NULL if not a plugin.
*/
GModule *mode_plugin_get_module(Mode *mode);
/**@}*/ /**@}*/
G_END_DECLS G_END_DECLS
#endif #endif

View File

@@ -8,6 +8,10 @@
typedef struct { typedef struct {
/** Entry content. (visible part) */ /** Entry content. (visible part) */
char *entry; char *entry;
/** Display */
char *display;
/** Icon name to display. */ /** Icon name to display. */
char *icon_name; char *icon_name;
/** Async icon fetch handler. */ /** Async icon fetch handler. */
@@ -22,6 +26,14 @@ typedef struct {
/** non-selectable */ /** non-selectable */
gboolean nonselectable; gboolean nonselectable;
/** permanent */
gboolean permanent;
/** urgent */
gboolean urgent;
/** active */
gboolean active;
} DmenuScriptEntry; } DmenuScriptEntry;
/** /**
* @param sw Unused * @param sw Unused

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the

View File

@@ -39,6 +39,7 @@
#include "modes/dmenu.h" #include "modes/dmenu.h"
#include "modes/drun.h" #include "modes/drun.h"
#include "modes/filebrowser.h" #include "modes/filebrowser.h"
#include "modes/recursivebrowser.h"
#include "modes/help-keys.h" #include "modes/help-keys.h"
#include "modes/run.h" #include "modes/run.h"
#include "modes/script.h" #include "modes/script.h"

View File

@@ -0,0 +1,58 @@
/*
* rofi
*
* MIT/X11 License
* Copyright © 2013-2023 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
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef ROFI_MODE_RECURSIVE_BROWSER_H
#define ROFI_MODE_RECURSIVE_BROWSER_H
#include "mode.h"
/**
* @defgroup FileBrowserMode FileBrowser
* @ingroup MODES
*
*
* @{
*/
/** #Mode object representing the run dialog. */
extern Mode recursive_browser_mode;
/**
* Create a new filebrowser.
* @returns a new filebrowser structure.
*/
Mode *create_new_recursive_browser(void);
/**
* @param sw Mode object.
* @param mretv return value passed in.
* @param input The user input string.
* @param selected_line The user selected line.
* @param path The full path as output.
*
* @returns the state the user selected.
*/
ModeMode recursive_browser_mode_completer(Mode *sw, int mretv, char **input,
unsigned int selected_line, char **path);
/**@}*/
#endif // ROFI_MODE_RECURSIVE_BROWSER_H

View File

@@ -26,9 +26,8 @@ void rofi_icon_fetcher_destroy(void);
/** /**
* @param name The name of the icon to fetch. * @param name The name of the icon to fetch.
* @param size The size of the icon to fetch. * @param size The size of the icon to fetch.
* @param scale The scale of the icon to fetch.
* *
* Query the icon-theme for icon with name, size, and scale. * Query the icon-theme for icon with name and size.
* The returned icon will be the best match for the requested size, it should * The returned icon will be the best match for the requested size, it should
* still be resized to the actual size. * still be resized to the actual size.
* *
@@ -36,16 +35,14 @@ void rofi_icon_fetcher_destroy(void);
* *
* @returns the uid identifying the request. * @returns the uid identifying the request.
*/ */
uint32_t rofi_icon_fetcher_query(const char *name, const int size, uint32_t rofi_icon_fetcher_query(const char *name, const int size);
const guint scale);
/** /**
* @param name The name of the icon to fetch. * @param name The name of the icon to fetch.
* @param wsize The width of the icon to fetch. * @param wsize The width of the icon to fetch.
* @param hsize The height of the icon to fetch. * @param hsize The height of the icon to fetch.
* @param scale The scale of the icon to fetch.
* *
* Query the icon-theme for icon with name, size, and scale. * Query the icon-theme for icon with name and size.
* The returned icon will be the best match for the requested size, it should * The returned icon will be the best match for the requested size, it should
* still be resized to the actual size. For icons it will take the min of wsize * still be resized to the actual size. For icons it will take the min of wsize
* and hsize. * and hsize.
@@ -55,7 +52,7 @@ uint32_t rofi_icon_fetcher_query(const char *name, const int size,
* @returns the uid identifying the request. * @returns the uid identifying the request.
*/ */
uint32_t rofi_icon_fetcher_query_advanced(const char *name, const int wsize, uint32_t rofi_icon_fetcher_query_advanced(const char *name, const int wsize,
const int hsize, const guint scale); const int hsize);
/** /**
* @param uid The unique id representing the matching request. * @param uid The unique id representing the matching request.
@@ -66,6 +63,16 @@ uint32_t rofi_icon_fetcher_query_advanced(const char *name, const int wsize,
*/ */
cairo_surface_t *rofi_icon_fetcher_get(const uint32_t uid); cairo_surface_t *rofi_icon_fetcher_get(const uint32_t uid);
/**
* @param uid The unique id representing the matching request.
* @param surface [out] The surface found.
*
* If the surface is used, the user should reference the surface.
*
* @returns false if a query was done and failed.
*/
gboolean rofi_icon_fetcher_get_ex(const uint32_t uid,
cairo_surface_t **surface);
/** /**
* @param path the image path to check. * @param path the image path to check.
* *

View File

@@ -14,8 +14,6 @@ typedef enum {
P_DOUBLE, P_DOUBLE,
/** String */ /** String */
P_STRING, P_STRING,
/** Character */
P_CHAR,
/** Boolean */ /** Boolean */
P_BOOLEAN, P_BOOLEAN,
/** Color */ /** Color */
@@ -192,7 +190,6 @@ typedef struct {
RofiScaleType scaling; RofiScaleType scaling;
int wsize; int wsize;
int hsize; int hsize;
guint scale;
RofiDirection dir; RofiDirection dir;
double angle; double angle;
@@ -261,8 +258,6 @@ typedef union _PropertyValue {
double f; double f;
/** String */ /** String */
char *s; char *s;
/** Character */
char c;
/** boolean */ /** boolean */
gboolean b; gboolean b;
/** Color */ /** Color */
@@ -298,6 +293,57 @@ typedef struct Property {
PropertyValue value; PropertyValue value;
} Property; } Property;
/**
* Describe the media constraint type.
*/
typedef enum {
/** Minimum width constraint. */
THEME_MEDIA_TYPE_MIN_WIDTH,
/** Maximum width constraint. */
THEME_MEDIA_TYPE_MAX_WIDTH,
/** Minimum height constraint. */
THEME_MEDIA_TYPE_MIN_HEIGHT,
/** Maximum height constraint. */
THEME_MEDIA_TYPE_MAX_HEIGHT,
/** Monitor id constraint. */
THEME_MEDIA_TYPE_MON_ID,
/** Minimum aspect ratio constraint. */
THEME_MEDIA_TYPE_MIN_ASPECT_RATIO,
/** Maximum aspect ratio constraint. */
THEME_MEDIA_TYPE_MAX_ASPECT_RATIO,
/** Boolean option for use with env. */
THEME_MEDIA_TYPE_BOOLEAN,
/** Invalid entry. */
THEME_MEDIA_TYPE_INVALID,
} ThemeMediaType;
/**
* Theme Media description.
*/
typedef struct ThemeMedia {
ThemeMediaType type;
double value;
gboolean boolv;
} ThemeMedia;
/**
* ThemeWidget.
*/
typedef struct ThemeWidget {
int set;
char *name;
unsigned int num_widgets;
struct ThemeWidget **widgets;
ThemeMedia *media;
GHashTable *properties;
struct ThemeWidget *parent;
} ThemeWidget;
typedef ThemeWidget ConfigEntry;
/** /**
* Structure to hold a range. * Structure to hold a range.
*/ */
@@ -320,6 +366,8 @@ typedef struct rofi_int_matcher_t {
*/ */
typedef struct _thread_state { typedef struct _thread_state {
void (*callback)(struct _thread_state *t, gpointer data); void (*callback)(struct _thread_state *t, gpointer data);
void (*free)(void *);
int priority;
} thread_state; } thread_state;
extern GThreadPool *tpool; extern GThreadPool *tpool;

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -34,7 +34,6 @@
#include <glib.h> #include <glib.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <xcb/xcb.h>
#include <xkbcommon/xkbcommon.h> #include <xkbcommon/xkbcommon.h>
/** /**
@@ -103,6 +102,14 @@ void rofi_quit_main_loop(void);
* @return returns Mode * when found, NULL if not. * @return returns Mode * when found, NULL if not.
*/ */
Mode *rofi_collect_modes_search(const char *name); Mode *rofi_collect_modes_search(const char *name);
/**
* Query the configure file completer.
*
* @returns the Mode that can be used for file completion or NULL when not
* found.
*/
const Mode *rofi_get_completer(void);
/** Reset terminal */ /** Reset terminal */
#define color_reset "\033[0m" #define color_reset "\033[0m"
/** Set terminal text bold */ /** Set terminal text bold */

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -40,7 +40,8 @@ typedef enum {
MM_REGEX = 1, MM_REGEX = 1,
MM_GLOB = 2, MM_GLOB = 2,
MM_FUZZY = 3, MM_FUZZY = 3,
MM_PREFIX = 4 MM_PREFIX = 4,
MM_NUM_MATCHERS = 5
} MatchingMethod; } MatchingMethod;
/** /**
@@ -65,7 +66,22 @@ typedef struct {
/** Whether to load and show icons */ /** Whether to load and show icons */
gboolean show_icons; gboolean show_icons;
/** Custom command to generate preview icons */
char *preview_cmd;
/** Custom command to call when menu selection changes */
char *on_selection_changed;
/** Custom command to call when menu mode changes */
char *on_mode_changed;
/** Custom command to call when menu entry is accepted */
char *on_entry_accepted;
/** Custom command to call when menu is canceled */
char *on_menu_canceled;
/** Custom command to call when menu finds errors */
char *on_menu_error;
/** Custom command to call when menu screenshot is taken */
char *on_screenshot_taken;
/** Terminal to use */ /** Terminal to use */
char *terminal_emulator; char *terminal_emulator;
/** SSH client to use */ /** SSH client to use */
@@ -111,6 +127,8 @@ typedef struct {
char *drun_match_fields; char *drun_match_fields;
/** Only show entries in this category */ /** Only show entries in this category */
char *drun_categories; char *drun_categories;
/** Exclude entries in this category */
char *drun_exclude_categories;
/** Desktop entry show actions */ /** Desktop entry show actions */
unsigned int drun_show_actions; unsigned int drun_show_actions;
/** Desktop format display */ /** Desktop format display */
@@ -120,6 +138,8 @@ typedef struct {
/** Search case sensitivity */ /** Search case sensitivity */
unsigned int case_sensitive; unsigned int case_sensitive;
/** Smart case sensitivity like vim */
unsigned int case_smart;
/** Cycle through in the element list */ /** Cycle through in the element list */
unsigned int cycle; unsigned int cycle;
/** Height of an element in number of rows */ /** Height of an element in number of rows */
@@ -155,6 +175,9 @@ typedef struct {
/** Click outside the window to exit */ /** Click outside the window to exit */
int click_to_exit; int click_to_exit;
/** Try to take over compositor's global bindings (on Wayland) */
gboolean global_kb;
char *theme; char *theme;
/** Path where plugins can be found. */ /** Path where plugins can be found. */
char *plugin_path; char *plugin_path;
@@ -192,6 +215,10 @@ typedef struct {
/** workaround for broken xserver (#300 on xserver, #611) */ /** workaround for broken xserver (#300 on xserver, #611) */
gboolean xserver_i300_workaround; gboolean xserver_i300_workaround;
/** completer mode */
char *completer_mode;
/** Whether to enable imdkit, see #2123 */
gboolean enable_imdkit;
} Settings; } Settings;
/** Default number of lines in the list view */ /** Default number of lines in the list view */

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -32,61 +32,6 @@
#include <glib.h> #include <glib.h>
#include <widgets/widget.h> #include <widgets/widget.h>
/**
* Describe the media constraint type.
*/
typedef enum {
/** Minimum width constraint. */
THEME_MEDIA_TYPE_MIN_WIDTH,
/** Maximum width constraint. */
THEME_MEDIA_TYPE_MAX_WIDTH,
/** Minimum height constraint. */
THEME_MEDIA_TYPE_MIN_HEIGHT,
/** Maximum height constraint. */
THEME_MEDIA_TYPE_MAX_HEIGHT,
/** Monitor id constraint. */
THEME_MEDIA_TYPE_MON_ID,
/** Minimum aspect ratio constraint. */
THEME_MEDIA_TYPE_MIN_ASPECT_RATIO,
/** Maximum aspect ratio constraint. */
THEME_MEDIA_TYPE_MAX_ASPECT_RATIO,
/** Boolean option for use with env. */
THEME_MEDIA_TYPE_BOOLEAN,
/** Invalid entry. */
THEME_MEDIA_TYPE_INVALID,
} ThemeMediaType;
/**
* Theme Media description.
*/
typedef struct ThemeMedia {
ThemeMediaType type;
double value;
gboolean boolv;
} ThemeMedia;
/**
* ThemeWidget.
*/
typedef struct ThemeWidget {
int set;
char *name;
unsigned int num_widgets;
struct ThemeWidget **widgets;
ThemeMedia *media;
GHashTable *properties;
struct ThemeWidget *parent;
} ThemeWidget;
/**
* Display scale.
*/
typedef guint (*disp_scale_func)(void);
/** /**
* Global pointer to the current active theme. * Global pointer to the current active theme.
*/ */
@@ -141,10 +86,13 @@ void rofi_theme_property_free(Property *p);
/** /**
* @param p The property to free. * @param p The property to free.
* @param data User data (unused)
*
* Make a newly allocted copy of the property.
* *
* @returns a copy of p * @returns a copy of p
*/ */
Property *rofi_theme_property_copy(const Property *p, void *); Property *rofi_theme_property_copy(const Property *p, G_GNUC_UNUSED void *);
/** /**
* @param widget * @param widget
* *
@@ -367,34 +315,6 @@ void distance_get_linestyle(RofiDistance d, cairo_t *draw);
ThemeWidget *rofi_theme_find_widget(const char *name, const char *state, ThemeWidget *rofi_theme_find_widget(const char *name, const char *state,
gboolean exact); gboolean exact);
/**
* @param name The name of the element to find.
* @param state The state of the element.
* @param exact If the match should be exact, or parent can be included.
*
* Find the configuration element. If not exact, the closest specified element
* is returned.
*
* @returns the ThemeWidget if found, otherwise NULL.
*/
ThemeWidget *rofi_config_find_widget(const char *name, const char *state,
gboolean exact);
/**
* @param widget The widget to find the property on.
* @param type The %PropertyType to find.
* @param property The property to find.
* @param exact If the property should only be found on this widget, or on
* parents if not found.
*
* Find the property on the widget. If not exact, the parents are searched
* recursively until match is found.
*
* @returns the Property if found, otherwise NULL.
*/
Property *rofi_theme_find_property(ThemeWidget *widget, PropertyType type,
const char *property, gboolean exact);
/** /**
* Reset the current theme. * Reset the current theme.
*/ */
@@ -402,13 +322,12 @@ void rofi_theme_reset(void);
/** /**
* @param file File name to prepare. * @param file File name to prepare.
* @param parent_file Filename of parent file.
* *
* Tries to find full path relative to parent file. * Tries to find full path relative to parent file.
* *
* @returns full path to file. * @returns full path to file.
*/ */
char *rofi_theme_parse_prepare_file(const char *file, const char *parent_file); char *rofi_theme_parse_prepare_file(const char *file);
/** /**
* Process conditionals. * Process conditionals.
@@ -463,14 +382,37 @@ void rofi_theme_free_parsed_files(void);
void rofi_theme_print_parsed_files(int is_term); void rofi_theme_print_parsed_files(int is_term);
/** /**
* @param widget The widget handle.
* @param property The property to query.
*
* Returns a list of allocated RofiDistance objects that should be * Returns a list of allocated RofiDistance objects that should be
* freed. * freed.
*
* @returns a GList of RofiDistance objects.
*/ */
GList *rofi_theme_get_list_distance(const widget *widget, const char *property); GList *rofi_theme_get_list_distance(const widget *widget, const char *property);
/**
* @param widget The widget handle.
* @param property The property to query.
*
* Returns a list of allocated strings othat should be
* freed.
*
* @returns a GList of strings.
*/
GList *rofi_theme_get_list_strings(const widget *widget, const char *property); GList *rofi_theme_get_list_strings(const widget *widget, const char *property);
/**
* Display scale function type
*/
typedef guint (*disp_scale_func)(void);
/** /**
* @param func The function pointer to scale getter. * @param func The function pointer to scale getter.
*
* Dependency injection for changing display scale without theme library
* depending on the display library
*/ */
void rofi_theme_set_disp_scale_func(disp_scale_func func); void rofi_theme_set_disp_scale_func(disp_scale_func func);
#endif #endif

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -27,16 +27,23 @@
#ifndef ROFI_VIEW_INTERNAL_H #ifndef ROFI_VIEW_INTERNAL_H
#define ROFI_VIEW_INTERNAL_H #define ROFI_VIEW_INTERNAL_H
#include "display.h"
#include "keyb.h" #include "keyb.h"
#include "mode.h" #include "mode.h"
#include "theme.h" #include "theme.h"
#include "view.h"
#include "widgets/box.h" #include "widgets/box.h"
#include "widgets/container.h" #include "widgets/container.h"
#include "widgets/icon.h" #include "widgets/icon.h"
#include "widgets/listview.h" #include "widgets/listview.h"
#include "widgets/textbox.h" #include "widgets/textbox.h"
#include "widgets/widget.h" #include "widgets/widget.h"
#ifdef ENABLE_XCB
#include "xcb.h" #include "xcb.h"
#else
#include "xcb-dummy.h"
#endif
#ifdef ENABLE_WAYLAND #ifdef ENABLE_WAYLAND
#include "wayland.h" #include "wayland.h"
@@ -94,6 +101,8 @@ struct RofiViewState {
int skip_absorb; int skip_absorb;
/** The selected line (in the unfiltered list) */ /** The selected line (in the unfiltered list) */
unsigned int selected_line; unsigned int selected_line;
/** The previously selected line (in the unfiltered list) */
unsigned int previous_line;
/** The return state of the view */ /** The return state of the view */
MenuReturn retv; MenuReturn retv;
/** Monitor #workarea the view is displayed on */ /** Monitor #workarea the view is displayed on */
@@ -111,7 +120,9 @@ struct RofiViewState {
/** filtered rows */ /** filtered rows */
textbox *tb_filtered_rows; textbox *tb_filtered_rows;
/** Extra icon widget that shows the current selected entries text. */
textbox *tb_current_entry; textbox *tb_current_entry;
/** Extra icon widget that shows the current selected entries icon. */
icon *icon_current_entry; icon *icon_current_entry;
/** Settings of the menu */ /** Settings of the menu */
@@ -150,26 +161,27 @@ struct RofiViewState {
/** Regexs used for matching */ /** Regexs used for matching */
rofi_int_matcher **tokens; rofi_int_matcher **tokens;
/** For case-sensitivity */
gboolean case_sensitive;
}; };
/** @} */ /** @} */
typedef struct _view_proxy { typedef struct _view_proxy {
void (*update)(RofiViewState *state, gboolean qr); void (*update)(struct RofiViewState *state, gboolean qr);
void (*maybe_update)(RofiViewState *state); void (*temp_configure_notify)(struct RofiViewState *state,
void (*temp_configure_notify)(RofiViewState *state,
xcb_configure_notify_event_t *xce); xcb_configure_notify_event_t *xce);
void (*temp_click_to_exit)(RofiViewState *state, xcb_window_t target); void (*temp_click_to_exit)(struct RofiViewState *state, xcb_window_t target);
void (*frame_callback)(void); void (*frame_callback)(void);
void (*queue_redraw)(void); void (*queue_redraw)(void);
void (*set_window_title)(const char *title); void (*set_window_title)(const char *title);
void (*calculate_window_position)(RofiViewState *state); void (*calculate_window_position)(struct RofiViewState *state);
void (*calculate_window_width)(RofiViewState *state); void (*calculate_window_width)(struct RofiViewState *state);
int (*calculate_window_height)(RofiViewState *state); int (*calculate_window_height)(struct RofiViewState *state);
void (*window_update_size)(RofiViewState *state); void (*window_update_size)(struct RofiViewState *state);
void (*set_cursor)(RofiCursorType type); void (*set_cursor)(RofiCursorType type);
void (*ping_mouse)(RofiViewState *state); void (*ping_mouse)(struct RofiViewState *state);
void (*cleanup)(void); void (*cleanup)(void);
void (*hide)(void); void (*hide)(void);
@@ -180,12 +192,17 @@ typedef struct _view_proxy {
void (*get_current_monitor)(int *width, int *height); void (*get_current_monitor)(int *width, int *height);
void (*capture_screenshot)(void); void (*capture_screenshot)(void);
void (*set_size)(RofiViewState *state, gint width, gint height); void (*set_size)(struct RofiViewState *state, gint width, gint height);
void (*get_size)(RofiViewState *state, gint *width, gint *height); void (*get_size)(struct RofiViewState *state, gint *width, gint *height);
void (*pool_refresh)(); void (*pool_refresh)(void);
} view_proxy; } view_proxy;
typedef struct {
char *string;
int index;
} EntryHistoryIndex;
/** /**
* Structure holding cached state. * Structure holding cached state.
*/ */
@@ -198,12 +215,26 @@ struct _rofi_view_cache_state {
GQueue views; GQueue views;
/** timeout for reloading */ /** timeout for reloading */
guint refilter_timeout; guint refilter_timeout;
/* amount of time refiltering delay got reset */
guint refilter_timeout_count; guint refilter_timeout_count;
/** if filtering takes longer then this time,
* reduce the amount of refilters. */
double max_refilter_time; double max_refilter_time;
/** enable the reduced refilter mode. */
gboolean delayed_mode; gboolean delayed_mode;
/** timeout handling */ /** timeout handling */
guint user_timeout; guint user_timeout;
/** timeout overlay */
guint overlay_timeout;
/** Entry box */
gboolean entry_history_enable;
/** Array with history entriy input. */
EntryHistoryIndex *entry_history;
/** Length of the array */
gssize entry_history_length;
/** The current index being viewed. */
gssize entry_history_index;
}; };
extern struct _rofi_view_cache_state CacheState; extern struct _rofi_view_cache_state CacheState;

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -29,7 +29,13 @@
#define ROFI_VIEW_H #define ROFI_VIEW_H
#include "mode.h" #include "mode.h"
#include "widgets/widget.h"
#include <pango/pango.h>
#ifdef ENABLE_XCB
#include <xcb/xcb.h> #include <xcb/xcb.h>
#else
#include "xcb-dummy.h"
#endif
/** /**
* @defgroup View View * @defgroup View View
* *
@@ -54,6 +60,8 @@ typedef enum {
MENU_NORMAL_WINDOW = 2, MENU_NORMAL_WINDOW = 2,
/** ERROR dialog */ /** ERROR dialog */
MENU_ERROR_DIALOG = 4, MENU_ERROR_DIALOG = 4,
/** Create transient window. */
MENU_TRANSIENT_WINDOW = 8,
} MenuFlags; } MenuFlags;
/** /**
@@ -279,6 +287,14 @@ void rofi_view_switch_mode(RofiViewState *state, Mode *mode);
* Overlays text over the current view. Passing NULL for text hides the overlay. * Overlays text over the current view. Passing NULL for text hides the overlay.
*/ */
void rofi_view_set_overlay(RofiViewState *state, const char *text); void rofi_view_set_overlay(RofiViewState *state, const char *text);
/**
* @param state The handle to the view
* @param text An UTF-8 encoded character array with the text to overlay.
*
* Overlays text over the current view. Passing NULL for text hides the overlay.
* This message is automatically removed after X seconds.
*/
void rofi_view_set_overlay_timeout (RofiViewState *state, const char *text);
/** /**
* @param state The handle to the view. * @param state The handle to the view.
@@ -339,11 +355,6 @@ void rofi_capture_screenshot(void);
*/ */
void rofi_view_set_window_title(const char *title); void rofi_view_set_window_title(const char *title);
/**
* set ellipsize mode to start.
*/
void rofi_view_ellipsize_start(RofiViewState *state);
void rofi_view_set_size(RofiViewState *state, gint width, gint height); void rofi_view_set_size(RofiViewState *state, gint width, gint height);
void rofi_view_get_size(RofiViewState *state, gint *width, gint *height); void rofi_view_get_size(RofiViewState *state, gint *width, gint *height);
@@ -355,6 +366,13 @@ void rofi_view_pool_refresh(void);
void rofi_view_set_cursor(RofiCursorType type); void rofi_view_set_cursor(RofiCursorType type);
/**
* Input history
*/
void input_history_save(void);
void input_history_initialize(void);
struct _view_proxy; struct _view_proxy;
/* Implementations */ /* Implementations */
@@ -365,5 +383,37 @@ extern const struct _view_proxy *wayland_view_proxy;
void view_init(const struct _view_proxy *view_in); void view_init(const struct _view_proxy *view_in);
/**
@param state The window state handle
@param mode The pango ellipsize mode to user
* set ellipsize mode to start.
*/
void rofi_view_ellipsize_listview(RofiViewState *state,
PangoEllipsizeMode mode);
/**
* @param new_x New XIM window x pos
* @param new_y New XIM window y pos
*
* Updates the XIM window position to new_x and new_y, relative to the
* main_window
*/
gboolean rofi_set_im_window_pos(int new_x, int new_y);
/**
* @param wid to test.
* @param action the action done.
* @param x [unused]
* @param y [unsued]
* @param user_data
*
* textbux widget trigger action function.
*
* @return the result.
*/
WidgetTriggerActionResult textbox_button_trigger_action(
widget *wid, MouseBindingMouseDefaultAction action, G_GNUC_UNUSED gint x,
G_GNUC_UNUSED gint y, G_GNUC_UNUSED void *user_data);
/** @} */ /** @} */
#endif #endif

View File

@@ -6,7 +6,6 @@
#include <libgwater-wayland.h> #include <libgwater-wayland.h>
#include <nkutils-bindings.h> #include <nkutils-bindings.h>
#include <wayland-client.h> #include <wayland-client.h>
#include <xcb/xkb.h>
#include <xkbcommon/xkbcommon.h> #include <xkbcommon/xkbcommon.h>
#include "wayland.h" #include "wayland.h"
@@ -15,6 +14,8 @@ typedef enum {
WAYLAND_GLOBAL_COMPOSITOR, WAYLAND_GLOBAL_COMPOSITOR,
WAYLAND_GLOBAL_SHM, WAYLAND_GLOBAL_SHM,
WAYLAND_GLOBAL_LAYER_SHELL, WAYLAND_GLOBAL_LAYER_SHELL,
WAYLAND_GLOBAL_KEYBOARD_SHORTCUTS_INHIBITOR,
WAYLAND_GLOBAL_CURSOR_SHAPE,
_WAYLAND_GLOBAL_SIZE, _WAYLAND_GLOBAL_SIZE,
} wayland_global_name; } wayland_global_name;
@@ -33,6 +34,10 @@ typedef struct {
typedef struct _wayland_seat wayland_seat; typedef struct _wayland_seat wayland_seat;
typedef struct {
void *offer;
} clipboard_data;
typedef struct { typedef struct {
GMainLoop *main_loop; GMainLoop *main_loop;
GWaterWaylandSource *main_loop_source; GWaterWaylandSource *main_loop_source;
@@ -41,16 +46,23 @@ typedef struct {
uint32_t global_names[_WAYLAND_GLOBAL_SIZE]; uint32_t global_names[_WAYLAND_GLOBAL_SIZE];
struct wl_compositor *compositor; struct wl_compositor *compositor;
#ifdef HAVE_WAYLAND_CURSOR_SHAPE
struct wp_cursor_shape_manager_v1 *cursor_shape_manager;
#endif
struct wl_data_device_manager *data_device_manager; struct wl_data_device_manager *data_device_manager;
struct zwp_primary_selection_device_manager_v1 *primary_selection_device_manager; struct zwp_primary_selection_device_manager_v1
*primary_selection_device_manager;
struct zwlr_layer_shell_v1 *layer_shell; struct zwlr_layer_shell_v1 *layer_shell;
struct zwp_keyboard_shortcuts_inhibit_manager_v1 *kb_shortcuts_inhibit_manager;
struct wl_shm *shm; struct wl_shm *shm;
size_t buffer_count; size_t buffer_count;
struct { struct {
char *theme_name; char *theme_name;
char **name; RofiCursorType type;
struct wl_cursor_theme *theme; struct wl_cursor_theme *theme;
struct wl_cursor *cursor; struct wl_cursor *cursor;
struct wl_cursor_image *image; struct wl_cursor_image *image;
@@ -69,8 +81,7 @@ typedef struct {
int32_t scale; int32_t scale;
NkBindingsSeat *bindings_seat; NkBindingsSeat *bindings_seat;
char *clipboard_default_data; clipboard_data clipboards[2];
char *clipboard_primary_data;
uint32_t layer_width; uint32_t layer_width;
uint32_t layer_height; uint32_t layer_height;
@@ -88,26 +99,38 @@ struct _wayland_seat {
int32_t delay; int32_t delay;
} repeat; } repeat;
uint32_t serial; uint32_t serial;
uint32_t pointer_serial;
struct wl_keyboard *keyboard; struct wl_keyboard *keyboard;
struct wl_pointer *pointer; struct wl_pointer *pointer;
#ifdef HAVE_WAYLAND_CURSOR_SHAPE
struct wp_cursor_shape_device_v1 *cursor_shape_device;
#endif
struct wl_data_device *data_device; struct wl_data_device *data_device;
struct zwp_primary_selection_device_v1 *primary_selection_device; struct zwp_primary_selection_device_v1 *primary_selection_device;
enum wl_pointer_axis_source axis_source;
widget_button_event button; widget_button_event button;
widget_motion_event motion; widget_motion_event motion;
struct { struct {
gint vertical; gint vertical;
gint horizontal; gint horizontal;
} wheel; } wheel;
struct {
double vertical;
double horizontal;
} wheel_continuous;
}; };
/* Supported interface versions */ /* Supported interface versions */
#define WL_COMPOSITOR_INTERFACE_VERSION 3 #define WL_COMPOSITOR_INTERFACE_VERSION 3
#define WL_SHM_INTERFACE_VERSION 1 #define WL_SHM_INTERFACE_VERSION 1
#define WL_SEAT_INTERFACE_VERSION 5 #define WL_SEAT_INTERFACE_MIN_VERSION 5
#define WL_OUTPUT_INTERFACE_VERSION 2 #define WL_SEAT_INTERFACE_MAX_VERSION 8
#define WL_OUTPUT_INTERFACE_MIN_VERSION 2
#define WL_OUTPUT_INTERFACE_MAX_VERSION 4
#define WL_LAYER_SHELL_INTERFACE_VERSION 1 #define WL_LAYER_SHELL_INTERFACE_VERSION 1
#define WL_KEYBOARD_SHORTCUTS_INHIBITOR_INTERFACE_VERSION 1
extern wayland_stuff *wayland; extern wayland_stuff *wayland;

View File

@@ -41,8 +41,9 @@ cairo_surface_t *display_buffer_pool_get_next_buffer(display_buffer_pool *pool);
void display_surface_commit(cairo_surface_t *surface); void display_surface_commit(cairo_surface_t *surface);
gboolean display_get_surface_dimensions(int *width, int *height); gboolean display_get_surface_dimensions(int *width, int *height);
void display_set_surface_dimensions(int width, int height, void display_set_surface_dimensions(int width, int height, int x_margin,
int x_margin, int y_margin, int y_margin, int loc);
int loc);
void wayland_display_set_cursor_type(RofiCursorType type);
#endif #endif

View File

@@ -59,9 +59,9 @@ icon *icon_create(widget *parent, const char *name);
void icon_set_size(widget *icon, const int size); void icon_set_size(widget *icon, const int size);
/** /**
* @param icon The icon widget handle. * @param icon_widget The icon widget handle.
* @param surf The surface to display. * @param surf The surface to display.
*/ */
void icon_set_surface(icon *icon, cairo_surface_t *surf); void icon_set_surface(icon *icon_widget, cairo_surface_t *surf);
/**@}*/ /**@}*/
#endif // ROFI_ICON_H #endif // ROFI_ICON_H

View File

@@ -29,6 +29,7 @@
#define ROFI_LISTVIEW_H #define ROFI_LISTVIEW_H
#include "widgets/textbox.h" #include "widgets/textbox.h"
#include <pango/pango.h>
/** /**
* @defgroup listview listview * @defgroup listview listview
@@ -83,10 +84,18 @@ typedef void (*listview_selection_changed_callback)(listview *lv,
*/ */
typedef void (*listview_mouse_activated_cb)(listview *, gboolean, void *); typedef void (*listview_mouse_activated_cb)(listview *, gboolean, void *);
/**
* Callback when current page is changed.
*/
typedef void (*listview_page_changed_cb)(void);
/** /**
* @param parent The widget's parent. * @param parent The widget's parent.
* @param name The name of the to be created widget. * @param name The name of the to be created widget.
* @param cb The update callback. * @param cb The update callback.
* @param page_cb The page change callback.
* @param udata The user data to pass to the callback * @param udata The user data to pass to the callback
* @param eh The height of one element * @param eh The height of one element
* @param reverse Reverse the listview order. * @param reverse Reverse the listview order.
@@ -94,7 +103,8 @@ typedef void (*listview_mouse_activated_cb)(listview *, gboolean, void *);
* @returns a new listview * @returns a new listview
*/ */
listview *listview_create(widget *parent, const char *name, listview *listview_create(widget *parent, const char *name,
listview_update_callback cb, void *udata, listview_update_callback cb,
listview_page_changed_cb page_cb, void *udata,
unsigned int eh, gboolean reverse); unsigned int eh, gboolean reverse);
/** /**
@@ -231,13 +241,6 @@ void listview_set_scroll_type(listview *lv, ScrollType type);
void listview_set_mouse_activated_cb(listview *lv, void listview_set_mouse_activated_cb(listview *lv,
listview_mouse_activated_cb cb, listview_mouse_activated_cb cb,
void *udata); void *udata);
/**
* @param lv Handler to the listview object.
* @param num_lines the maximum number of lines to display.
*
* Set the maximum number of lines to display.
*/
void listview_set_num_lines(listview *lv, unsigned int num_lines);
/** /**
* @param lv Handler to the listview object. * @param lv Handler to the listview object.
@@ -272,11 +275,12 @@ void listview_toggle_ellipsizing(listview *lv);
/** /**
* @param lv Handler to the listview object. * @param lv Handler to the listview object.
* @param mode The ellipsize mode to set.
* *
* Set ellipsize mode to start. * Set ellipsize mode on the listview.
*/ */
void listview_set_ellipsize_start(listview *lv); void listview_set_ellipsize(listview *lv, PangoEllipsizeMode mode);
/** /**
* @param lv Handler to the listview object. * @param lv Handler to the listview object.

View File

@@ -75,10 +75,14 @@ typedef struct {
double yalign; double yalign;
double xalign; double xalign;
int cursor_x_pos;
TBFontConfig *tbfc; TBFontConfig *tbfc;
PangoEllipsizeMode emode; PangoEllipsizeMode emode;
//
const char *password_mask_char;
const char *theme_name; const char *theme_name;
} textbox; } textbox;
@@ -310,6 +314,7 @@ PangoAttrList *textbox_get_pango_attributes(textbox *tb);
* @returns the visible text. * @returns the visible text.
*/ */
const char *textbox_get_visible_text(const textbox *tb); const char *textbox_get_visible_text(const textbox *tb);
/** /**
* @param wid The handle to the textbox. * @param wid The handle to the textbox.
* @param height The height we want the desired width for * @param height The height we want the desired width for
@@ -318,7 +323,7 @@ const char *textbox_get_visible_text(const textbox *tb);
* *
* @returns the desired width of the textbox. * @returns the desired width of the textbox.
*/ */
int textbox_get_desired_width(widget *wid, const int height); int textbox_get_desired_width(widget *wid, G_GNUC_UNUSED const int height);
/** /**
* @param tb Handle to the textbox * @param tb Handle to the textbox
@@ -334,5 +339,26 @@ void textbox_cursor_end(textbox *tb);
* Set the ellipsizing mode used on the string. * Set the ellipsizing mode used on the string.
*/ */
void textbox_set_ellipsize(textbox *tb, PangoEllipsizeMode mode); void textbox_set_ellipsize(textbox *tb, PangoEllipsizeMode mode);
/**
* @param tb Handle to the textbox
*
* @returns the position of the cursor (0 if no cursor).
*/
int textbox_get_cursor_x_pos(const textbox *tb);
/**
* @param tb Handle to the textbox
*
* @returns gets a newly allocated copy of the content of the entrybox.
*/
char *textbox_get_text(const textbox *tb);
/**
* @param tb Handle to the textbox
*
* @returns the position of the cursor.
*/
int textbox_get_cursor(const textbox *tb);
/**@}*/ /**@}*/
#endif // ROFI_TEXTBOX_H #endif // ROFI_TEXTBOX_H

View File

@@ -32,23 +32,22 @@
/** Macro for initializing the RofiDistance struct. */ /** Macro for initializing the RofiDistance struct. */
#define WIDGET_DISTANCE_INIT \ #define WIDGET_DISTANCE_INIT \
(RofiDistance){ \ (RofiDistance) { \
.base = { \ .base = \
.distance = 0, \ { \
.type = ROFI_PU_PX, \ .distance = 0, \
.modtype = ROFI_DISTANCE_MODIFIER_NONE, \ .type = ROFI_PU_PX, \
.left = NULL, \ .modtype = ROFI_DISTANCE_MODIFIER_NONE, \
.right = NULL, \ .left = NULL, \
}, \ .right = NULL, \
}, \
.style = ROFI_HL_SOLID, \ .style = ROFI_HL_SOLID, \
} }
/* Macro for initializing the RofiPadding struct. */ /** Macro for initializing the RofiPadding struct. */
#define WIDGET_PADDING_INIT \ #define WIDGET_PADDING_INIT \
(RofiPadding){ \ (RofiPadding) { \
.top = WIDGET_DISTANCE_INIT, \ .top = WIDGET_DISTANCE_INIT, .right = WIDGET_DISTANCE_INIT, \
.right = WIDGET_DISTANCE_INIT, \ .bottom = WIDGET_DISTANCE_INIT, .left = WIDGET_DISTANCE_INIT, \
.bottom = WIDGET_DISTANCE_INIT, \
.left = WIDGET_DISTANCE_INIT, \
} }
/** /**
@@ -84,6 +83,12 @@ struct _widget {
gboolean expand; gboolean expand;
/** Place widget at end of parent */ /** Place widget at end of parent */
gboolean end; gboolean end;
/** enable/disable border aliasing. */
gboolean border_antialiasing;
/** enable/disable nvisia workaround. */
gboolean border_disable_nvidia_workaround;
/** Parent widget */ /** Parent widget */
struct _widget *parent; struct _widget *parent;
/** Internal */ /** Internal */

View File

@@ -83,7 +83,7 @@ typedef enum {
} WidgetTriggerActionResult; } WidgetTriggerActionResult;
/** /**
* @param widget The container widget itself * @param wid The container widget itself
* @param type The widget type searched for * @param type The widget type searched for
* @param x The X coordination of the mouse event relative to #widget * @param x The X coordination of the mouse event relative to #widget
* @param y The Y coordination of the mouse event relative to #widget * @param y The Y coordination of the mouse event relative to #widget
@@ -93,11 +93,11 @@ typedef enum {
* *
* @returns A child widget if found, NULL otherwise * @returns A child widget if found, NULL otherwise
*/ */
typedef widget *(*widget_find_mouse_target_cb)(widget *widget, WidgetType type, typedef widget *(*widget_find_mouse_target_cb)(widget *wid, WidgetType type,
gint x, gint y); gint x, gint y);
/** /**
* @param widget The target widget * @param wid The target widget
* @param action The action value (which enum it is depends on the widget type) * @param action The action value (which enum it is depends on the widget type)
* @param x The X coordination of the mouse event relative to #widget * @param x The X coordination of the mouse event relative to #widget
* @param y The Y coordination of the mouse event relative to #widget * @param y The Y coordination of the mouse event relative to #widget
@@ -108,7 +108,7 @@ typedef widget *(*widget_find_mouse_target_cb)(widget *widget, WidgetType type,
* *
* @returns Whether the action was handled or not, see enum values for details * @returns Whether the action was handled or not, see enum values for details
*/ */
typedef WidgetTriggerActionResult (*widget_trigger_action_cb)(widget *widget, typedef WidgetTriggerActionResult (*widget_trigger_action_cb)(widget *wid,
guint action, guint action,
gint x, gint y, gint x, gint y,
void *user_data); void *user_data);
@@ -117,7 +117,7 @@ typedef WidgetTriggerActionResult (*widget_trigger_action_cb)(widget *widget,
#define WIDGET(a) ((widget *)(a)) #define WIDGET(a) ((widget *)(a))
/** /**
* @param widget The widget to check * @param wid The widget to check
* @param x The X position relative to parent window * @param x The X position relative to parent window
* @param y the Y position relative to parent window * @param y the Y position relative to parent window
* *
@@ -125,65 +125,63 @@ typedef WidgetTriggerActionResult (*widget_trigger_action_cb)(widget *widget,
* *
* @return TRUE if x,y falls within the widget * @return TRUE if x,y falls within the widget
*/ */
int widget_intersect(const widget *widget, int x, int y); int widget_intersect(const widget *wid, int x, int y);
/** /**
* @param widget The widget to move * @param wid The widget to move
* @param x The new X position relative to parent window * @param x The new X position relative to parent window
* @param y The new Y position relative to parent window * @param y The new Y position relative to parent window
* *
* Moves the widget. * Moves the widget.
*/ */
void widget_move(widget *widget, short x, short y); void widget_move(widget *wid, short x, short y);
/** /**
* @param widget Handle to widget * @param wid Handle to widget
* @param type The widget type. * @param type The widget type.
* *
* Set the widget type. * Set the widget type.
*/ */
void widget_set_type(widget *widget, WidgetType type); void widget_set_type(widget *wid, WidgetType type);
/** /**
* @param widget Handle to widget * @param wid Handle to widget
* *
* Check if widget is enabled. * Check if widget is enabled.
* @returns TRUE when widget is enabled. * @returns TRUE when widget is enabled.
*/ */
gboolean widget_enabled(widget *widget); gboolean widget_enabled(widget *wid);
/** /**
* @param widget Handle to widget * @param wid Handle to widget
* @param enabled The new state * @param enabled The new state
* *
* Disable the widget. * Disable the widget.
*/ */
void widget_set_enabled(widget *widget, gboolean enabled); void widget_set_enabled(widget *wid, gboolean enabled);
/** /**
* @param widget Handle to widget * @param wid Handle to widget
* *
* Disable the widget. * Disable the widget.
*/ */
static inline void widget_disable(widget *widget) { static inline void widget_disable(widget *wid) {
widget_set_enabled(widget, FALSE); widget_set_enabled(wid, FALSE);
} }
/** /**
* @param widget Handle to widget * @param wid Handle to widget
* *
* Enable the widget. * Enable the widget.
*/ */
static inline void widget_enable(widget *widget) { static inline void widget_enable(widget *wid) { widget_set_enabled(wid, TRUE); }
widget_set_enabled(widget, TRUE);
}
/** /**
* @param widget widget Handle to the widget * @param wid widget Handle to the widget
* @param d The cairo object used to draw itself. * @param d The cairo object used to draw itself.
* *
* Render the textbox. * Render the textbox.
*/ */
void widget_draw(widget *widget, cairo_t *d); void widget_draw(widget *wid, cairo_t *d);
/** /**
* @param wid Handle to the widget * @param wid Handle to the widget
@@ -193,58 +191,58 @@ void widget_draw(widget *widget, cairo_t *d);
void widget_free(widget *wid); void widget_free(widget *wid);
/** /**
* @param widget The widget toresize * @param wid The widget toresize
* @param w The new width * @param w The new width
* @param h The new height * @param h The new height
* *
* Resizes the widget. * Resizes the widget.
*/ */
void widget_resize(widget *widget, short w, short h); void widget_resize(widget *wid, short w, short h);
/** /**
* @param widget The widget handle * @param wid The widget handle
* *
* @returns the height of the widget. * @returns the height of the widget.
*/ */
int widget_get_height(widget *widget); int widget_get_height(widget *wid);
/** /**
* @param widget The widget handle * @param wid The widget handle
* *
* @returns the width of the widget. * @returns the width of the widget.
*/ */
int widget_get_width(widget *widget); int widget_get_width(widget *wid);
/** /**
* @param widget The widget handle * @param wid The widget handle
* *
* @returns the y position of the widget relative to its parent. * @returns the y position of the widget relative to its parent.
*/ */
int widget_get_y_pos(widget *widget); int widget_get_y_pos(widget *wid);
/** /**
* @param widget The widget handle * @param wid The widget handle
* *
* @returns the x position of the widget relative to its parent. * @returns the x position of the widget relative to its parent.
*/ */
int widget_get_x_pos(widget *widget); int widget_get_x_pos(widget *wid);
/** /**
* @param widget The widget handle * @param wid The widget handle
* @param x A pointer to the absolute X coordinates * @param x A pointer to the absolute X coordinates
* @param y A pointer to the absolute Y coordinates * @param y A pointer to the absolute Y coordinates
* *
* Will modify param x and param y to make them relative to param widget . * Will modify param x and param y to make them relative to param wid .
*/ */
void widget_xy_to_relative(widget *widget, gint *x, gint *y); void widget_xy_to_relative(widget *wid, gint *x, gint *y);
/** /**
* @param widget The widget handle * @param wid The widget handle
* *
* Update the widget, and its parent recursively. * Update the widget, and its parent recursively.
* This should be called when size of widget changes. * This should be called when size of widget changes.
*/ */
void widget_update(widget *widget); void widget_update(widget *wid);
/** /**
* @param wid The widget handle * @param wid The widget handle
* *
@@ -282,8 +280,10 @@ widget *widget_find_mouse_target(widget *wid, WidgetType type, gint x, gint y);
* *
* @returns Whether the action would be handled or not * @returns Whether the action would be handled or not
*/ */
WidgetTriggerActionResult widget_check_action(widget *wid, guint action, gint x, WidgetTriggerActionResult widget_check_action(widget *wid,
gint y); G_GNUC_UNUSED guint action,
G_GNUC_UNUSED gint x,
G_GNUC_UNUSED gint y);
/** /**
* @param wid The widget handle * @param wid The widget handle

14
include/xcb-dummy.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef ROFI_XCB_DUMMY_H
#define ROFI_XCB_DUMMY_H
// Dummy types for xcb values shared in view interface (not used in wayland
// mode) This header exists so that rofi can be built without xcb headers
// present
typedef int xcb_configure_notify_event_t;
typedef int xcb_window_t;
typedef int xcb_timestamp_t;
#define XCB_WINDOW_NONE 0
#endif

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -32,9 +32,11 @@
#include <glib.h> #include <glib.h>
#include <libsn/sn.h> #include <libsn/sn.h>
#include "xcb.h"
#include <libgwater-xcb.h> #include <libgwater-xcb.h>
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/xcb_ewmh.h> #include <xcb/xcb_ewmh.h>
#include <xcb/xcb_keysyms.h>
#include <nkutils-bindings.h> #include <nkutils-bindings.h>
@@ -45,6 +47,11 @@ struct _xcb_stuff {
GMainLoop *main_loop; GMainLoop *main_loop;
GWaterXcbSource *source; GWaterXcbSource *source;
xcb_connection_t *connection; xcb_connection_t *connection;
#ifdef XCB_IMDKIT
xcb_xic_t ic;
xcb_xim_t *im;
xcb_key_symbols_t *syms;
#endif
xcb_ewmh_connection_t ewmh; xcb_ewmh_connection_t ewmh;
xcb_screen_t *screen; xcb_screen_t *screen;
int screen_nbr; int screen_nbr;
@@ -59,7 +66,7 @@ struct _xcb_stuff {
} xkb; } xkb;
xcb_timestamp_t last_timestamp; xcb_timestamp_t last_timestamp;
NkBindingsSeat *bindings_seat; NkBindingsSeat *bindings_seat;
gboolean mouse_seen; uint32_t mouse_seen;
xcb_window_t focus_revert; xcb_window_t focus_revert;
char *clipboard; char *clipboard;
}; };

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -29,6 +29,9 @@
#define ROFI_XCB_H #define ROFI_XCB_H
#include <cairo.h> #include <cairo.h>
#ifdef XCB_IMDKIT
#include <xcb-imdkit/imclient.h>
#endif
#include <xcb/xcb.h> #include <xcb/xcb.h>
/** /**
@@ -41,6 +44,11 @@ typedef struct _xcb_stuff xcb_stuff;
*/ */
extern xcb_stuff *xcb; extern xcb_stuff *xcb;
/**
* @param data String to copy to clipboard.
*
* copies string to clipboard.
*/
void xcb_stuff_set_clipboard(char *data); void xcb_stuff_set_clipboard(char *data);
/** /**
@@ -90,18 +98,6 @@ extern const char *netatom_names[];
/** atoms */ /** atoms */
extern xcb_atom_t netatoms[NUM_NETATOMS]; extern xcb_atom_t netatoms[NUM_NETATOMS];
/**
* @param w rofis window
*
* Stores old input focus for reverting and set focus to rofi.
*/
void rofi_xcb_set_input_focus(xcb_window_t w);
/**
* IF set, revert the focus back to the original applications.
*/
void rofi_xcb_revert_input_focus(void);
/** /**
* Depth of visual * Depth of visual
*/ */
@@ -169,8 +165,6 @@ typedef enum {
WM_DO_NOT_CHANGE_CURRENT_DESKTOP = 1, WM_DO_NOT_CHANGE_CURRENT_DESKTOP = 1,
/** PANGO WORKSPACE NAMES */ /** PANGO WORKSPACE NAMES */
WM_PANGO_WORKSPACE_NAMES = 2, WM_PANGO_WORKSPACE_NAMES = 2,
/** Root window offset (for bspwm) */
WM_ROOT_WINDOW_OFFSET = 4,
} WindowManagerQuirk; } WindowManagerQuirk;
/** /**
@@ -188,6 +182,7 @@ extern WindowManagerQuirk current_window_manager;
* @returns NULL if window was not found, or unmapped, otherwise returns a * @returns NULL if window was not found, or unmapped, otherwise returns a
* cairo_surface. * cairo_surface.
*/ */
cairo_surface_t *x11_helper_get_screenshot_surface_window(xcb_window_t window, cairo_surface_t *x11_helper_get_screenshot_surface_window(xcb_window_t window,
int size); int size);
@@ -198,7 +193,21 @@ cairo_surface_t *x11_helper_get_screenshot_surface_window(xcb_window_t window,
* *
* Blur the content of the surface with radius and deviation. * Blur the content of the surface with radius and deviation.
*/ */
void cairo_image_surface_blur(cairo_surface_t *surface, double radius, void cairo_image_surface_blur(cairo_surface_t *surface, int radius,
double deviation); double deviation);
#ifdef XCB_IMDKIT
/**
* IME Forwarding
*/
void x11_event_handler_fowarding(xcb_xim_t *im, xcb_xic_t ic,
xcb_key_press_event_t *event, void *user_data);
#endif
/**
* Get the currently detected window manager.
*
* @returns NULL when non found, otherwise a string (free with g_free)
*/
char *x11_helper_get_window_manager(void);
#endif #endif

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright © 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -49,7 +49,11 @@
#define LOG_DOMAIN "Parser" #define LOG_DOMAIN "Parser"
int last_state = 0; int last_state = 0;
extern int rofi_is_in_dmenu_mode;
gboolean import_optional = FALSE;
const char *rasi_theme_file_extensions[] = {".rasi", ".rasinc", NULL};
/** /**
* Type of Object to parse. * Type of Object to parse.
*/ */
@@ -122,6 +126,7 @@ static double rofi_theme_parse_convert_hex ( char high, char low)
{ \ { \
if ( errno != EINTR ) \ if ( errno != EINTR ) \
{ \ { \
fprintf(stderr, "Failed to read input from file: %s\n", strerror(errno)); \
YY_FATAL_ERROR( "input in flex scanner failed" ); \ YY_FATAL_ERROR( "input in flex scanner failed" ); \
break; \ break; \
} \ } \
@@ -161,17 +166,19 @@ static double rofi_theme_parse_convert_hex ( char high, char low)
ASC [\x00-\x7f] ASC [\x00-\x7f]
ASCN [\x00-\t\v-\x7f] ASCN [\x00-\t\v-\x7f]
ASCNP [\x00-\t\v-\x21\x23-\x7f] ASCNP1 [\x00-\t\v-\x21\x23-\x7f]
ASCNP2 [\x00-\t\v-\x26\x28-\x7f]
U [\x80-\xbf] U [\x80-\xbf]
U2 [\xc2-\xdf] U2 [\xc2-\xdf]
U3 [\xe0-\xef] U3 [\xe0-\xef]
U4 [\xf0-\xf4] U4 [\xf0-\xf4]
// UANY {ASC}|{U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
UANYN {ASCN}|{U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} // UANY {ASC}|{UONLY}
// UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} UANYN {ASCN}|{UONLY}
UANYNP {ASCNP}|{U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} UANYNP1 {ASCNP1}|{UONLY}
UANYNP2 {ASCNP2}|{UONLY}
WHITESPACE [[:blank:]] WHITESPACE [[:blank:]]
WSO [[:blank:]]* WSO [[:blank:]]*
@@ -179,12 +186,11 @@ WORD [[:alnum:]-]+
WORD_ELEMENT [[:alpha:]][[:alnum:]-]* WORD_ELEMENT [[:alpha:]][[:alnum:]-]*
WORD_ENV [[:alpha:]_][[:alnum:]_]* WORD_ENV [[:alpha:]_][[:alnum:]_]*
COLOR_NAME [[:alpha:]]+ COLOR_NAME [[:alpha:]]+
STRING \"{UANYN}*\" STRING \"{UANYN}*\"|\'{UANYN}*\'
STRING_LIST \"{UANYNP}*\" STRING_LIST \"{UANYNP1}*\"|\'{UANYNP2}*\'
CHAR \'({ASCN}|\\\\|\\\'|\\0)\'
HEX [[:xdigit:]] HEX [[:xdigit:]]
NUMBER [[:digit:]] NUMBER [[:digit:]]+
PNNUMBER [-+]?[[:digit:]]+ UNARYMIN -
PX (px) PX (px)
MM (mm) MM (mm)
EM (em) EM (em)
@@ -198,13 +204,13 @@ ASTERIX \*
ENV $\{[[:alpha:]_][[:alnum:]_]*\} ENV $\{[[:alpha:]_][[:alnum:]_]*\}
MODIFIER_ADD \+ MODIFIER_ADD \+
MODIFIER_SUBTRACT -
MODIFIER_MULTIPLY \* MODIFIER_MULTIPLY \*
MODIFIER_MIN (min) MODIFIER_MIN (min)
MODIFIER_MAX (max) MODIFIER_MAX (max)
MODIFIER_ROUND (round) MODIFIER_ROUND (round)
MODIFIER_FLOOR (floor) MODIFIER_FLOOR (floor)
MODIFIER_CEIL (ceil) MODIFIER_CEIL (ceil)
MODIFIER_MODULO (modulo)
/* Position */ /* Position */
CENTER (?i:center) CENTER (?i:center)
@@ -285,6 +291,7 @@ C_COMMENT_OPEN "/*"
INCLUDE "@import" INCLUDE "@import"
OPT_INCLUDE "?import"
THEME "@theme" THEME "@theme"
DEFAULT (?i:\"default\"?) DEFAULT (?i:\"default\"?)
@@ -294,6 +301,8 @@ CONFIGURATION (?i:configuration)
MEDIA_TYPES (monitor-id|(min|max)-(width|height|aspect-ratio)|enabled) MEDIA_TYPES (monitor-id|(min|max)-(width|height|aspect-ratio)|enabled)
DMENU (?i:dmenu)
%x INCLUDE %x INCLUDE
%x PROPERTIES %x PROPERTIES
%x PROPERTIES_ENV %x PROPERTIES_ENV
@@ -372,6 +381,12 @@ if ( queue == NULL ) {
*/ */
<INITIAL>{INCLUDE} { <INITIAL>{INCLUDE} {
g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) ); g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) );
import_optional = FALSE;
BEGIN(INCLUDE);
}
<INITIAL>{OPT_INCLUDE} {
g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) );
import_optional = TRUE;
BEGIN(INCLUDE); BEGIN(INCLUDE);
} }
<INITIAL>{THEME} { <INITIAL>{THEME} {
@@ -413,8 +428,8 @@ if ( queue == NULL ) {
yytext[yyleng-1] = '\0'; yytext[yyleng-1] = '\0';
ParseObject *top = g_queue_peek_head ( file_queue ); ParseObject *top = g_queue_peek_head ( file_queue );
g_assert ( top != NULL ); g_assert ( top != NULL );
char *file2 = helper_get_theme_path ( &yytext[1], ".rasi" ); char *file2 = helper_get_theme_path ( &yytext[1], rasi_theme_file_extensions, top->filename );
char *filename = rofi_theme_parse_prepare_file ( file2, top->filename ); char *filename = rofi_theme_parse_prepare_file ( file2 );
g_free ( file2 ); g_free ( file2 );
FILE *f = fopen ( filename, "rb" ); FILE *f = fopen ( filename, "rb" );
if ( f ) { if ( f ) {
@@ -431,10 +446,15 @@ if ( queue == NULL ) {
yylloc->first_column = yylloc->last_column = 1; yylloc->first_column = yylloc->last_column = 1;
yylloc->filename = current->filename; yylloc->filename = current->filename;
} else { } else {
char *str = g_markup_printf_escaped ( "Failed to open theme: <i>%s</i>\nError: <b>%s</b>", if ( !import_optional ) {
filename, strerror ( errno ) ); char *str = g_markup_printf_escaped ( "Failed to open theme: <i>%s</i>\nError: <b>%s</b>",
rofi_add_warning_message ( g_string_new ( str ) ); filename, strerror ( errno ) );
g_free ( str ); rofi_add_warning_message ( g_string_new ( str ) );
g_free ( str );
} else {
g_warning("Trying to parse optional theme: '%s', Error: %s",
filename, strerror(errno));
}
g_free(filename); g_free(filename);
} }
// Pop out of include. */ // Pop out of include. */
@@ -509,11 +529,12 @@ if ( queue == NULL ) {
<SECTION>":" { g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) ); BEGIN(PROPERTIES); return T_PSEP; } <SECTION>":" { g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) ); BEGIN(PROPERTIES); return T_PSEP; }
<PROPERTIES>";" { BEGIN(GPOINTER_TO_INT ( g_queue_pop_head ( queue ))); return T_PCLOSE;} <PROPERTIES>";" { BEGIN(GPOINTER_TO_INT ( g_queue_pop_head ( queue ))); return T_PCLOSE;}
<PROPERTIES,PROPERTIES_ARRAY,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT,MEDIA_ENV_VAR_CONTENT,MEDIA_ENV_VAR_DEFAULT>(true|false) { yylval->bval= g_strcmp0(yytext, "true") == 0; return T_BOOLEAN;} <PROPERTIES,PROPERTIES_ARRAY,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT,MEDIA_ENV_VAR_CONTENT,MEDIA_ENV_VAR_DEFAULT>(true|false) { yylval->bval= g_strcmp0(yytext, "true") == 0; return T_BOOLEAN;}
<PROPERTIES,PROPERTIES_ARRAY,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT,MEDIA_CONTENT>{PNNUMBER}\.{NUMBER}+ { yylval->fval = g_ascii_strtod(yytext, NULL); return T_DOUBLE;} <MEDIA_CONTENT>{DMENU} { yylval->bval = rofi_is_in_dmenu_mode; return T_BOOLEAN;}
<PROPERTIES,PROPERTIES_ARRAY,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT,MEDIA_CONTENT>{PNNUMBER} { yylval->ival = (int)g_ascii_strtoll(yytext, NULL, 10); return T_INT;} <PROPERTIES,PROPERTIES_ARRAY,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT,MEDIA_CONTENT>{NUMBER}\.{NUMBER} { yylval->fval = g_ascii_strtod(yytext, NULL); return T_DOUBLE;}
<PROPERTIES,PROPERTIES_ARRAY,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT,MEDIA_CONTENT>{NUMBER} { yylval->ival = (int)g_ascii_strtoll(yytext, NULL, 10); return T_INT;}
<PROPERTIES,PROPERTIES_ARRAY,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT,MEDIA_CONTENT>{UNARYMIN} { return T_MIN; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{STRING} { yytext[yyleng-1] = '\0'; yylval->sval = g_strcompress(&yytext[1]); return T_STRING;} <PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{STRING} { yytext[yyleng-1] = '\0'; yylval->sval = g_strcompress(&yytext[1]); return T_STRING;}
<PROPERTIES_ARRAY>{STRING_LIST} { yytext[yyleng-1] = '\0'; yylval->sval = g_strcompress(&yytext[1]); return T_STRING;} <PROPERTIES_ARRAY>{STRING_LIST} { yytext[yyleng-1] = '\0'; yylval->sval = g_strcompress(&yytext[1]); return T_STRING;}
<PROPERTIES,PROPERTIES_ARRAY,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{CHAR} { yytext[yyleng-1] = '\0'; yylval->cval = g_strcompress(&yytext[1])[0]; return T_CHAR;}
<PROPERTIES,PROPERTIES_ARRAY,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>@{WORD} { <PROPERTIES,PROPERTIES_ARRAY,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>@{WORD} {
yylval->sval = g_strdup(yytext+1); yylval->sval = g_strdup(yytext+1);
@@ -538,13 +559,13 @@ if ( queue == NULL ) {
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{INHERIT} { return T_INHERIT; } <PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{INHERIT} { return T_INHERIT; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_ADD} { return T_MODIFIER_ADD; } <PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_ADD} { return T_MODIFIER_ADD; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_SUBTRACT} { return T_MODIFIER_SUBTRACT; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_MULTIPLY} { return T_MODIFIER_MULTIPLY; } <PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_MULTIPLY} { return T_MODIFIER_MULTIPLY; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_MIN} { return T_MODIFIER_MIN; } <PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_MIN} { return T_MODIFIER_MIN; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_MAX} { return T_MODIFIER_MAX; } <PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_MAX} { return T_MODIFIER_MAX; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_ROUND} { return T_MODIFIER_ROUND; } <PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_ROUND} { return T_MODIFIER_ROUND; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_FLOOR} { return T_MODIFIER_FLOOR; } <PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_FLOOR} { return T_MODIFIER_FLOOR; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_CEIL} { return T_MODIFIER_CEIL; } <PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_CEIL} { return T_MODIFIER_CEIL; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{MODIFIER_MODULO} { return T_MODIFIER_MODULO; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{CALC} { return T_CALC; } <PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{CALC} { return T_CALC; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{ENV} { <PROPERTIES,PROPERTIES_ENV,PROPERTIES_ARRAY,PROPERTIES_VAR_DEFAULT>{ENV} {
@@ -837,7 +858,7 @@ if ( queue == NULL ) {
/** /**
* Media defaults. * Media defaults.
*/ */
<MEDIA,MEDIA_CONTENT,MEDIA_ENV_VAR,MEDIA_ENV_VAR_DEFAULT,MEDIA_ENV_VAR_CONTENT>{WHITESPACE}+ ; // ignore all whitespace <MEDIA,MEDIA_CONTENT,MEDIA_ENV_VAR,MEDIA_ENV_VAR_DEFAULT,MEDIA_ENV_VAR_CONTENT>{WHITESPACE}+ ; // ignore all whitespace
<MEDIA,MEDIA_CONTENT,MEDIA_ENV_VAR,MEDIA_ENV_VAR_DEFAULT,MEDIA_ENV_VAR_CONTENT>. { <MEDIA,MEDIA_CONTENT,MEDIA_ENV_VAR,MEDIA_ENV_VAR_DEFAULT,MEDIA_ENV_VAR_CONTENT>. {
yytext[yyleng-1] = '\0'; yytext[yyleng-1] = '\0';
@@ -880,8 +901,8 @@ if ( queue == NULL ) {
gboolean rofi_theme_parse_file ( const char *file ) gboolean rofi_theme_parse_file ( const char *file )
{ {
char *file2 = helper_get_theme_path ( file, ".rasi" ); char *file2 = helper_get_theme_path ( file, rasi_theme_file_extensions, NULL );
char *filename = rofi_theme_parse_prepare_file ( file2, NULL ); char *filename = rofi_theme_parse_prepare_file ( file2 );
g_free ( file2 ); g_free ( file2 );
yyin = fopen ( filename, "rb" ); yyin = fopen ( filename, "rb" );

View File

@@ -2,7 +2,7 @@
* rofi * rofi
* *
* MIT/X11 License * MIT/X11 License
* Copyright 2013-2022 Qball Cow <qball@gmpclient.org> * Copyright 2013-2023 Qball Cow <qball@gmpclient.org>
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@@ -164,7 +164,6 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b )
%token <fval> T_DOUBLE "Floating-point number" %token <fval> T_DOUBLE "Floating-point number"
%token <sval> T_STRING "UTF-8 encode string" %token <sval> T_STRING "UTF-8 encode string"
%token <sval> T_MEDIA_TYPE "Media type" %token <sval> T_MEDIA_TYPE "Media type"
%token <cval> T_CHAR "Character"
%token <sval> T_PROP_NAME "property name" %token <sval> T_PROP_NAME "property name"
%token <colorval> T_COLOR_NAME "Color value by name" %token <colorval> T_COLOR_NAME "Color value by name"
%token <sval> T_NAME_ELEMENT "Element name" %token <sval> T_NAME_ELEMENT "Element name"
@@ -195,7 +194,6 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b )
%token T_UNIT_MM "mm" %token T_UNIT_MM "mm"
%token T_UNIT_EM "em" %token T_UNIT_EM "em"
%token T_UNIT_CH "ch" %token T_UNIT_CH "ch"
%token T_UNIT_PERCENT "%"
%token T_ANGLE_DEG "Degrees" %token T_ANGLE_DEG "Degrees"
%token T_ANGLE_GRAD "Gradians" %token T_ANGLE_GRAD "Gradians"
@@ -231,7 +229,6 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b )
%token T_PARENT_LEFT "Parent left ('(')" %token T_PARENT_LEFT "Parent left ('(')"
%token T_PARENT_RIGHT "Parent right (')')" %token T_PARENT_RIGHT "Parent right (')')"
%token T_COMMA "comma separator (',')" %token T_COMMA "comma separator (',')"
%token T_OPTIONAL_COMMA "Optional comma separator (',')"
%token T_FORWARD_SLASH "forward slash ('/')" %token T_FORWARD_SLASH "forward slash ('/')"
%token T_PERCENT "Percent sign ('%')" %token T_PERCENT "Percent sign ('%')"
@@ -239,8 +236,8 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b )
%token T_LIST_CLOSE "List close (']')" %token T_LIST_CLOSE "List close (']')"
%token T_MODIFIER_ADD "Add ('+')" %token T_MODIFIER_ADD "Add ('+')"
%token T_MODIFIER_SUBTRACT "Subtract ('-')"
%token T_MODIFIER_MULTIPLY "Multiply ('*')" %token T_MODIFIER_MULTIPLY "Multiply ('*')"
%token T_MODIFIER_MODULO "Modulo ('modulo')"
%token T_MODIFIER_MAX "Max ('max')" %token T_MODIFIER_MAX "Max ('max')"
%token T_MODIFIER_MIN "Min ('min')" %token T_MODIFIER_MIN "Min ('min')"
@@ -257,7 +254,6 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b )
%token T_NSEP "Name separator (' ' or '.')" %token T_NSEP "Name separator (' ' or '.')"
%token T_SSEP "Selector separator (',')" %token T_SSEP "Selector separator (',')"
%token T_NAME_PREFIX "Element section ('# {name} { ... }')" %token T_NAME_PREFIX "Element section ('# {name} { ... }')"
%token T_WHITESPACE "White space"
%token T_PDEFAULTS "Default settings section ( '* { ... }')" %token T_PDEFAULTS "Default settings section ( '* { ... }')"
%token T_CONFIGURATION "Configuration block" %token T_CONFIGURATION "Configuration block"
%token T_RESET_THEME "Reset Theme" %token T_RESET_THEME "Reset Theme"
@@ -266,13 +262,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b )
%token T_INHERIT "Inherit" %token T_INHERIT "Inherit"
%token T_MEDIA_WIDTH "Width" %token T_MIN "-"
%token T_MEDIA_HEIGHT "Height"
%token T_MEDIA_MIN "Min"
%token T_MEDIA_MONITOR_ID "Monitor-ID"
%token T_MEDIA_MAX "Max"
%token T_MEDIA_SEP "-"
%token T_VAR_START "var" %token T_VAR_START "var"
@@ -313,6 +303,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b )
%type <ival> t_property_orientation %type <ival> t_property_orientation
%type <ival> t_property_cursor %type <ival> t_property_cursor
%type <ival> t_name_prefix_optional %type <ival> t_name_prefix_optional
%type <fval> t_property_number
%start t_main %start t_main
%% %%
@@ -370,13 +361,13 @@ t_entry_list T_CONFIGURATION T_BOPEN t_config_property_list_optional T_BCLOSE {
| t_entry_list t_name_prefix_optional t_entry_name_path_selectors T_BOPEN t_property_list_optional T_BCLOSE | t_entry_list t_name_prefix_optional t_entry_name_path_selectors T_BOPEN t_property_list_optional T_BCLOSE
{ {
for ( GList *liter = g_list_first ( $3); liter; liter = g_list_next ( liter ) ) { for ( GList *liter = g_list_first ( $3); liter; liter = g_list_next ( liter ) ) {
ThemeWidget *widget = $1; ThemeWidget *wid = $1;
for ( GList *iter = g_list_first ( (GList*)liter->data ); widget && iter ; iter = g_list_next ( iter ) ) { for ( GList *iter = g_list_first ( (GList*)liter->data ); wid && iter ; iter = g_list_next ( iter ) ) {
widget = rofi_theme_find_or_create_name ( widget, iter->data ); wid = rofi_theme_find_or_create_name ( wid, iter->data );
} }
g_list_free_full ( (GList*)liter->data, g_free ); g_list_free_full ( (GList*)liter->data, g_free );
widget->set = TRUE; wid->set = TRUE;
rofi_theme_widget_add_properties ( widget, $5); rofi_theme_widget_add_properties ( wid, $5);
} }
if ( $5 ) { if ( $5 ) {
g_hash_table_destroy ( $5 ); g_hash_table_destroy ( $5 );
@@ -384,92 +375,78 @@ t_entry_list T_CONFIGURATION T_BOPEN t_config_property_list_optional T_BCLOSE {
g_list_free ( $3 ); g_list_free ( $3 );
} }
| t_entry_list T_PDEFAULTS T_BOPEN t_property_list_optional T_BCLOSE { | t_entry_list T_PDEFAULTS T_BOPEN t_property_list_optional T_BCLOSE {
ThemeWidget *widget = rofi_theme_find_or_create_name ( $1, "*" ); ThemeWidget *wid = rofi_theme_find_or_create_name ( $1, "*" );
rofi_theme_widget_add_properties (widget, $4); rofi_theme_widget_add_properties (wid, $4);
if ( $4 ) { if ( $4 ) {
g_hash_table_destroy ( $4 ); g_hash_table_destroy ( $4 );
} }
} }
| t_entry_list T_MEDIA T_PARENT_LEFT T_MEDIA_TYPE T_PSEP T_INT T_PARENT_RIGHT T_BOPEN t_entry_list T_BCLOSE { | t_entry_list T_MEDIA T_PARENT_LEFT T_MEDIA_TYPE T_PSEP t_property_number T_PARENT_RIGHT T_BOPEN t_entry_list T_BCLOSE {
gchar *name = g_strdup_printf("@media ( %s: %d )",$4, $6);
ThemeWidget *widget = rofi_theme_find_or_create_name ( $1, name );
widget->set = TRUE;
widget->media = g_slice_new0(ThemeMedia);
widget->media->type = rofi_theme_parse_media_type ( $4 );
widget->media->value = (double)$6;
for ( unsigned int i = 0; i < $9->num_widgets; i++ ) {
ThemeWidget *d = $9->widgets[i];
rofi_theme_parse_merge_widgets(widget, d);
}
g_free ( $4 );
g_free ( name );
}
| t_entry_list T_MEDIA T_PARENT_LEFT T_MEDIA_TYPE T_PSEP T_DOUBLE T_PARENT_RIGHT T_BOPEN t_entry_list T_BCLOSE {
gchar *name = g_strdup_printf("@media ( %s: %f )",$4, $6); gchar *name = g_strdup_printf("@media ( %s: %f )",$4, $6);
ThemeWidget *widget = rofi_theme_find_or_create_name ( $1, name ); ThemeWidget *wid = rofi_theme_find_or_create_name ( $1, name );
widget->set = TRUE; wid->set = TRUE;
widget->media = g_slice_new0(ThemeMedia); wid->media = g_slice_new0(ThemeMedia);
widget->media->type = rofi_theme_parse_media_type ( $4 ); wid->media->type = rofi_theme_parse_media_type ( $4 );
widget->media->value = $6; wid->media->value = $6;
for ( unsigned int i = 0; i < $9->num_widgets; i++ ) { for ( unsigned int i = 0; i < $9->num_widgets; i++ ) {
ThemeWidget *d = $9->widgets[i]; ThemeWidget *d = $9->widgets[i];
rofi_theme_parse_merge_widgets(widget, d); rofi_theme_parse_merge_widgets(wid, d);
} }
g_free ( $4 ); g_free ( $4 );
g_free ( name ); g_free ( name );
} }
| t_entry_list T_MEDIA T_PARENT_LEFT T_MEDIA_TYPE T_PSEP T_INT T_UNIT_PX T_PARENT_RIGHT T_BOPEN t_entry_list T_BCLOSE { | t_entry_list T_MEDIA T_PARENT_LEFT T_MEDIA_TYPE T_PSEP T_INT T_UNIT_PX T_PARENT_RIGHT T_BOPEN t_entry_list T_BCLOSE {
gchar *name = g_strdup_printf("@media ( %s: %d px )",$4, $6); gchar *name = g_strdup_printf("@media ( %s: %d px )",$4, $6);
ThemeWidget *widget = rofi_theme_find_or_create_name ( $1, name ); ThemeWidget *wid = rofi_theme_find_or_create_name ( $1, name );
widget->set = TRUE; wid->set = TRUE;
widget->media = g_slice_new0(ThemeMedia); wid->media = g_slice_new0(ThemeMedia);
widget->media->type = rofi_theme_parse_media_type ( $4 ); wid->media->type = rofi_theme_parse_media_type ( $4 );
widget->media->value = (double)$6; wid->media->value = (double)$6;
for ( unsigned int i = 0; i < $10->num_widgets; i++ ) { for ( unsigned int i = 0; i < $10->num_widgets; i++ ) {
ThemeWidget *d = $10->widgets[i]; ThemeWidget *d = $10->widgets[i];
rofi_theme_parse_merge_widgets(widget, d); rofi_theme_parse_merge_widgets(wid, d);
} }
g_free ( $4 ); g_free ( $4 );
g_free ( name ); g_free ( name );
} }
| t_entry_list T_MEDIA T_PARENT_LEFT T_MEDIA_TYPE T_PSEP T_BOOLEAN T_PARENT_RIGHT T_BOPEN t_entry_list T_BCLOSE { | t_entry_list T_MEDIA T_PARENT_LEFT T_MEDIA_TYPE T_PSEP T_BOOLEAN T_PARENT_RIGHT T_BOPEN t_entry_list T_BCLOSE {
gchar *name = g_strdup_printf("@media ( %s: %s )",$4, $6?"true":"false"); gchar *name = g_strdup_printf("@media ( %s: %s )",$4, $6?"true":"false");
ThemeWidget *widget = rofi_theme_find_or_create_name ( $1, name ); ThemeWidget *wid = rofi_theme_find_or_create_name ( $1, name );
widget->set = TRUE; wid->set = TRUE;
widget->media = g_slice_new0(ThemeMedia); wid->media = g_slice_new0(ThemeMedia);
widget->media->type = rofi_theme_parse_media_type ( $4 ); wid->media->type = rofi_theme_parse_media_type ( $4 );
widget->media->boolv = $6; wid->media->boolv = $6;
for ( unsigned int i = 0; i < $9->num_widgets; i++ ) { for ( unsigned int i = 0; i < $9->num_widgets; i++ ) {
ThemeWidget *d = $9->widgets[i]; ThemeWidget *d = $9->widgets[i];
rofi_theme_parse_merge_widgets(widget, d); rofi_theme_parse_merge_widgets(wid, d);
} }
g_free ( $4 ); g_free ( $4 );
g_free ( name ); g_free ( name );
} }
| t_entry_list T_MEDIA T_PARENT_LEFT T_MEDIA_TYPE T_PSEP T_ENV_START T_PARENT_LEFT T_BOOLEAN T_COMMA T_BOOLEAN T_PARENT_RIGHT T_PARENT_RIGHT T_BOPEN t_entry_list T_BCLOSE { | t_entry_list T_MEDIA T_PARENT_LEFT T_MEDIA_TYPE T_PSEP T_ENV_START T_PARENT_LEFT T_BOOLEAN T_COMMA T_BOOLEAN T_PARENT_RIGHT T_PARENT_RIGHT T_BOPEN t_entry_list T_BCLOSE {
gchar *name = g_strdup_printf("@media ( %s: %s )",$4, $8?"true":"false"); gchar *name = g_strdup_printf("@media ( %s: %s )",$4, $8?"true":"false");
ThemeWidget *widget = rofi_theme_find_or_create_name ( $1, name ); ThemeWidget *wid = rofi_theme_find_or_create_name ( $1, name );
widget->set = TRUE; wid->set = TRUE;
widget->media = g_slice_new0(ThemeMedia); wid->media = g_slice_new0(ThemeMedia);
widget->media->type = rofi_theme_parse_media_type ( $4 ); wid->media->type = rofi_theme_parse_media_type ( $4 );
widget->media->boolv = $8; wid->media->boolv = $8;
for ( unsigned int i = 0; i < $14->num_widgets; i++ ) { for ( unsigned int i = 0; i < $14->num_widgets; i++ ) {
ThemeWidget *d = $14->widgets[i]; ThemeWidget *d = $14->widgets[i];
rofi_theme_parse_merge_widgets(widget, d); rofi_theme_parse_merge_widgets(wid, d);
} }
g_free ( $4 ); g_free ( $4 );
g_free ( name ); g_free ( name );
} }
| t_entry_list T_MEDIA T_PARENT_LEFT T_MEDIA_TYPE T_PSEP T_ENV_START T_PARENT_LEFT T_COMMA T_BOOLEAN T_PARENT_RIGHT T_PARENT_RIGHT T_BOPEN t_entry_list T_BCLOSE { | t_entry_list T_MEDIA T_PARENT_LEFT T_MEDIA_TYPE T_PSEP T_ENV_START T_PARENT_LEFT T_COMMA T_BOOLEAN T_PARENT_RIGHT T_PARENT_RIGHT T_BOPEN t_entry_list T_BCLOSE {
gchar *name = g_strdup_printf("@media ( %s: %s )",$4, $9?"true":"false"); gchar *name = g_strdup_printf("@media ( %s: %s )",$4, $9?"true":"false");
ThemeWidget *widget = rofi_theme_find_or_create_name ( $1, name ); ThemeWidget *wid = rofi_theme_find_or_create_name ( $1, name );
widget->set = TRUE; wid->set = TRUE;
widget->media = g_slice_new0(ThemeMedia); wid->media = g_slice_new0(ThemeMedia);
widget->media->type = rofi_theme_parse_media_type ( $4 ); wid->media->type = rofi_theme_parse_media_type ( $4 );
widget->media->boolv = $9; wid->media->boolv = $9;
for ( unsigned int i = 0; i < $13->num_widgets; i++ ) { for ( unsigned int i = 0; i < $13->num_widgets; i++ ) {
ThemeWidget *d = $13->widgets[i]; ThemeWidget *d = $13->widgets[i];
rofi_theme_parse_merge_widgets(widget, d); rofi_theme_parse_merge_widgets(wid, d);
} }
g_free ( $4 ); g_free ( $4 );
g_free ( name ); g_free ( name );
@@ -509,10 +486,10 @@ t_config_property
{ {
for ( GList *iter = g_list_first( $1) ; iter; iter = g_list_next(iter)){ for ( GList *iter = g_list_first( $1) ; iter; iter = g_list_next(iter)){
ThemeWidget *widget = rofi_configuration; ThemeWidget *wid = rofi_configuration;
widget = rofi_theme_find_or_create_name ( widget, iter->data ); wid = rofi_theme_find_or_create_name ( wid, iter->data );
widget->set = TRUE; wid->set = TRUE;
rofi_theme_widget_add_properties ( widget, $3); rofi_theme_widget_add_properties ( wid, $3);
} }
if ( $3 ) { if ( $3 ) {
g_hash_table_destroy ( $3 ); g_hash_table_destroy ( $3 );
@@ -577,14 +554,18 @@ t_property_element
$$ = rofi_theme_property_create ( P_DOUBLE ); $$ = rofi_theme_property_create ( P_DOUBLE );
$$->value.f = $1; $$->value.f = $1;
} }
| T_MIN T_INT {
$$ = rofi_theme_property_create ( P_INTEGER );
$$->value.i = -$2;
}
| T_MIN T_DOUBLE {
$$ = rofi_theme_property_create ( P_DOUBLE );
$$->value.f = -$2;
}
| T_STRING { | T_STRING {
$$ = rofi_theme_property_create ( P_STRING ); $$ = rofi_theme_property_create ( P_STRING );
$$->value.s = $1; $$->value.s = $1;
} }
| T_CHAR {
$$ = rofi_theme_property_create ( P_CHAR );
$$->value.c = $1;
}
| T_LINK { | T_LINK {
$$ = rofi_theme_property_create ( P_LINK ); $$ = rofi_theme_property_create ( P_LINK );
$$->value.link.name = $1; $$->value.link.name = $1;
@@ -686,11 +667,11 @@ t_property_scale_type
t_color_list t_color_list
: t_property_color { : t_property_color {
$$ = g_list_append ( NULL, g_memdup ( (gconstpointer)&($1), sizeof ( ThemeColor ))); $$ = g_list_append ( NULL, g_memdup2 ( (gconstpointer)&($1), sizeof ( ThemeColor )));
} }
| t_color_list T_COMMA t_property_color { | t_color_list T_COMMA t_property_color {
$$ = g_list_append ($1, g_memdup ( (gconstpointer)&($3), sizeof ( ThemeColor ))); $$ = g_list_append ($1, g_memdup2 ( (gconstpointer)&($3), sizeof ( ThemeColor )));
} }
; ;
@@ -771,8 +752,8 @@ t_property_highlight_style
t_property_distance_zero t_property_distance_zero
: T_INT t_property_line_style { : t_property_number t_property_line_style {
$$.base.distance = (double) $1; $$.base.distance = $1;
$$.base.type = ROFI_PU_PX; $$.base.type = ROFI_PU_PX;
$$.base.left = NULL; $$.base.left = NULL;
$$.base.right = NULL; $$.base.right = NULL;
@@ -784,7 +765,7 @@ t_property_distance_zero
/** Distance. */ /** Distance. */
t_property_distance_unit t_property_distance_unit
: T_INT t_property_unit { : t_property_number t_property_unit {
$$ = g_slice_new0(RofiDistanceUnit); $$ = g_slice_new0(RofiDistanceUnit);
$$->distance = (double)$1; $$->distance = (double)$1;
$$->type = $2; $$->type = $2;
@@ -792,7 +773,7 @@ t_property_distance_unit
$$->right = NULL; $$->right = NULL;
$$->modtype = ROFI_DISTANCE_MODIFIER_NONE; $$->modtype = ROFI_DISTANCE_MODIFIER_NONE;
} }
| T_INT { | t_property_number {
$$ = g_slice_new0(RofiDistanceUnit); $$ = g_slice_new0(RofiDistanceUnit);
$$->distance = (double)$1; $$->distance = (double)$1;
$$->type = ROFI_PU_PX; $$->type = ROFI_PU_PX;
@@ -800,14 +781,6 @@ t_property_distance_unit
$$->right = NULL; $$->right = NULL;
$$->modtype = ROFI_DISTANCE_MODIFIER_NONE; $$->modtype = ROFI_DISTANCE_MODIFIER_NONE;
} }
| T_DOUBLE t_property_unit {
$$ = g_slice_new0(RofiDistanceUnit);
$$->distance = (double)$1;
$$->type = $2;
$$->left = NULL;
$$->right = NULL;
$$->modtype = ROFI_DISTANCE_MODIFIER_NONE;
}
| T_PARENT_LEFT t_property_distance_unit_math3 T_PARENT_RIGHT { | T_PARENT_LEFT t_property_distance_unit_math3 T_PARENT_RIGHT {
$$ = g_slice_new0(RofiDistanceUnit); $$ = g_slice_new0(RofiDistanceUnit);
$$->distance = 0; $$->distance = 0;
@@ -834,7 +807,7 @@ t_property_distance_unit_math
$$->right = $3; $$->right = $3;
$$->modtype = ROFI_DISTANCE_MODIFIER_DIVIDE; $$->modtype = ROFI_DISTANCE_MODIFIER_DIVIDE;
} }
| t_property_distance_unit_math T_PERCENT t_property_distance_unit { | t_property_distance_unit_math T_MODIFIER_MODULO t_property_distance_unit {
$$ = g_slice_new0(RofiDistanceUnit); $$ = g_slice_new0(RofiDistanceUnit);
$$->left = $1; $$->left = $1;
$$->right = $3; $$->right = $3;
@@ -853,7 +826,7 @@ t_property_distance_unit_math2
$$->right = $3; $$->right = $3;
$$->modtype = ROFI_DISTANCE_MODIFIER_ADD; $$->modtype = ROFI_DISTANCE_MODIFIER_ADD;
} }
| t_property_distance_unit_math2 T_MODIFIER_SUBTRACT t_property_distance_unit_math { | t_property_distance_unit_math2 T_MIN t_property_distance_unit_math {
$$ = g_slice_new0(RofiDistanceUnit); $$ = g_slice_new0(RofiDistanceUnit);
$$->left = $1; $$->left = $1;
$$->right = $3; $$->right = $3;
@@ -901,23 +874,14 @@ t_property_distance_unit_math3
t_property_distance t_property_distance
/** Integer unit and line style */ /** Integer unit and line style */
: T_INT t_property_unit t_property_line_style { : t_property_number t_property_unit t_property_line_style {
$$.base.distance = (double)$1; $$.base.distance = $1;
$$.base.type = $2; $$.base.type = $2;
$$.base.left = NULL; $$.base.left = NULL;
$$.base.right = NULL; $$.base.right = NULL;
$$.base.modtype = ROFI_DISTANCE_MODIFIER_NONE; $$.base.modtype = ROFI_DISTANCE_MODIFIER_NONE;
$$.style = $3; $$.style = $3;
} }
/** Double unit and line style */
| T_DOUBLE t_property_unit t_property_line_style {
$$.base.distance = (double)$1;
$$.base.type = $2;
$$.base.modtype = ROFI_DISTANCE_MODIFIER_NONE;
$$.base.left = NULL;
$$.base.right = NULL;
$$.style = $3;
}
| T_CALC T_PARENT_LEFT t_property_distance_unit_math3 T_PARENT_RIGHT t_property_line_style { | T_CALC T_PARENT_LEFT t_property_distance_unit_math3 T_PARENT_RIGHT t_property_line_style {
$$.base.distance = 0; $$.base.distance = 0;
$$.base.type = ROFI_PU_PX; $$.base.type = ROFI_PU_PX;
@@ -927,6 +891,11 @@ t_property_distance
$$.style = $5; $$.style = $5;
}; };
t_property_number
: T_INT { $$ = (double) $1; }
| T_DOUBLE { $$ = $1; }
| T_MIN t_property_number { $$ = -(double)$2; }
/** distance unit. px, em, % */ /** distance unit. px, em, % */
t_property_unit t_property_unit
: T_UNIT_PX { $$ = ROFI_PU_PX; } : T_UNIT_PX { $$ = ROFI_PU_PX; }

23
meson-dist-script Normal file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
set -eu
cd "${MESON_DIST_ROOT}"
# deploy docs
mkdir build
meson setup build -Dprefix=/usr
ninja -C build
cp build/doc/*.1 doc
cp build/doc/*.5 doc
rm -rf build
# configure script
autoreconf -i
rm -rf autom4te.cache
# remove unwanted files in submodules
# (.gitattributes only applies to the root repo)
rm -f subprojects/*/.mailmap
rm -f subprojects/*/.gitignore
rm -f subprojects/*/.travis.yml

View File

@@ -1,28 +1,32 @@
project('rofi', 'c', project('rofi', 'c',
version: '1.7.5+wayland2', version: '1.7.9+wayland1',
meson_version: '>=0.47.0', meson_version: '>=0.59.0',
license: [ 'MIT' ], license: [ 'MIT' ],
default_options: [ default_options: [
'c_std=c99', 'c_std=c99',
'warning_level=3'
], ],
) )
c_compiler = meson.get_compiler('c') c_compiler = meson.get_compiler('c')
add_project_arguments( add_project_arguments(
'-I@0@'.format(meson.build_root()), '-I@0@'.format(meson.project_build_root()),
'-I@0@'.format(join_paths(meson.source_root(), 'include')), '-I@0@'.format(join_paths(meson.project_source_root(), 'include')),
'-D_DEFAULT_SOURCE=1', '-D_DEFAULT_SOURCE=1',
language: 'c' language: 'c'
) )
meson.add_dist_script('meson-dist-script')
flags = [ flags = [
'-Wparentheses', '-Wparentheses',
'-Winline', '-Winline',
'-Wunreachable-code', '-Wunreachable-code',
'-Werror=missing-prototypes', '-Werror=missing-prototypes',
'-Wno-overlength-strings',
'-Wno-inline', # A bit too noisy with Bison… '-Wno-inline', # A bit too noisy with Bison…
'-Wextra' '-Wshadow'
] ]
foreach f : flags foreach f : flags
if c_compiler.has_argument(f) if c_compiler.has_argument(f)
@@ -30,13 +34,19 @@ foreach f : flags
endif endif
endforeach endforeach
if get_option('b_lto')
add_project_arguments('-Werror=odr', language: 'c')
add_project_arguments('-Werror=lto-type-mismatch', language: 'c')
add_project_arguments('-Werror=strict-aliasing', language: 'c')
endif
plugindir = join_paths(get_option('libdir'), meson.project_name()) plugindir = join_paths(get_option('libdir'), meson.project_name())
themedir = join_paths(get_option('datadir'), meson.project_name(), 'themes') themedir = join_paths(get_option('datadir'), meson.project_name(), 'themes')
desktop_install_dir = join_paths(get_option('datadir'), 'applications') desktop_install_dir = join_paths(get_option('datadir'), 'applications')
icondir = join_paths(get_option('datadir'), 'icons','hicolor', 'scalable', 'apps') icondir = join_paths(get_option('datadir'), 'icons','hicolor', 'scalable', 'apps')
glib_min_major=2 glib_min_major=2
glib_min_minor=40 glib_min_minor=72
glib_min_version='@0@.@1@'.format(glib_min_major, glib_min_minor) glib_min_version='@0@.@1@'.format(glib_min_major, glib_min_minor)
plugins_deps = [ plugins_deps = [
dependency('glib-2.0', version: '>= @0@'.format(glib_min_version)), dependency('glib-2.0', version: '>= @0@'.format(glib_min_version)),
@@ -77,6 +87,7 @@ if xcb_enabled
dependency('xcb-randr'), dependency('xcb-randr'),
dependency('xcb-cursor'), dependency('xcb-cursor'),
dependency('xcb-xinerama'), dependency('xcb-xinerama'),
dependency('xcb-keysyms'),
dependency('cairo-xcb'), dependency('cairo-xcb'),
dependency('libstartup-notification-1.0'), dependency('libstartup-notification-1.0'),
] ]
@@ -93,15 +104,35 @@ if wayland_enabled
] ]
endif endif
header_conf = configuration_data()
if get_option('imdkit')
imdkit_new = dependency('xcb-imdkit', version: '>= 1.0.3', required: false)
imdkit_old = dependency('xcb-imdkit', version: '<= 1.0.2', required: false)
if imdkit_new.found()
deps += imdkit_new
header_conf.set('XCB_IMDKIT_1_0_3_LOWER', false)
header_conf.set('XCB_IMDKIT', true)
elif imdkit_old.found()
deps+= imdkit_old
header_conf.set('XCB_IMDKIT_1_0_3_LOWER', true)
header_conf.set('XCB_IMDKIT', true)
else
header_conf.set('XCB_IMDKIT_1_0_3_LOWER', false)
header_conf.set('XCB_IMDKIT', false)
endif
endif
check = dependency('check', version: '>= 0.11.0', required: get_option('check')) check = dependency('check', version: '>= 0.11.0', required: get_option('check'))
header_conf = configuration_data()
header_conf.set_quoted('PACKAGE_NAME', meson.project_name()) header_conf.set_quoted('PACKAGE_NAME', meson.project_name())
header_conf.set_quoted('PACKAGE_VERSION', meson.project_version()) header_conf.set_quoted('PACKAGE_VERSION', meson.project_version())
header_conf.set_quoted('VERSION', meson.project_version()) header_conf.set_quoted('VERSION', meson.project_version())
header_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) header_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
header_conf.set_quoted('PACKAGE_BUGREPORT', 'https://github.com/davatorium/rofi/') header_conf.set_quoted('PACKAGE_BUGREPORT', 'https://github.com/davatorium/rofi/')
header_conf.set_quoted('PACKAGE_URL', 'https://reddit.com/r/qtools/') header_conf.set_quoted('PACKAGE_URL', 'https://github.com/davatorium/rofi/discussions')
header_conf.set('_GNU_SOURCE', true) header_conf.set('_GNU_SOURCE', true)
@@ -125,8 +156,7 @@ config_h = configure_file(output: 'config.h', configuration: header_conf)
nk_options = [ nk_options = [
'bindings=true', 'bindings=true',
'xdg-theme=true', 'git-work-tree=@0@'.format(meson.project_source_root()),
'git-work-tree=@0@'.format(meson.source_root()),
] ]
nk = subproject('libnkutils', default_options: nk_options) nk = subproject('libnkutils', default_options: nk_options)
nk_subproject_options = nk.get_variable('nk_options') nk_subproject_options = nk.get_variable('nk_options')
@@ -204,6 +234,7 @@ rofi_sources = files(
'source/modes/script.c', 'source/modes/script.c',
'source/modes/help-keys.c', 'source/modes/help-keys.c',
'source/modes/filebrowser.c', 'source/modes/filebrowser.c',
'source/modes/recursivebrowser.c',
'include/display.h', 'include/display.h',
'include/xcb.h', 'include/xcb.h',
'include/rofi.h', 'include/rofi.h',
@@ -258,25 +289,36 @@ theme_lexer = flex.process(theme_lexer_sources)
theme_parser = bison.process(theme_parser_sources) theme_parser = bison.process(theme_parser_sources)
if wayland_enabled if wayland_enabled
wayland_sys_protocols_dir = wayland_protocols.get_pkgconfig_variable('pkgdatadir') fs = import('fs')
wayland_sys_protocols_dir = wayland_protocols.get_variable(pkgconfig: 'pkgdatadir')
wayland_scanner = find_program('wayland-scanner') wayland_scanner = find_program('wayland-scanner')
protocols = files( protocols = files(
wayland_sys_protocols_dir + '/stable/xdg-shell/xdg-shell.xml', wayland_sys_protocols_dir + '/stable/xdg-shell/xdg-shell.xml',
wayland_sys_protocols_dir + '/unstable/primary-selection/primary-selection-unstable-v1.xml', wayland_sys_protocols_dir + '/unstable/primary-selection/primary-selection-unstable-v1.xml',
wayland_sys_protocols_dir + '/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml',
'protocols/wlr-foreign-toplevel-management-unstable-v1.xml', 'protocols/wlr-foreign-toplevel-management-unstable-v1.xml',
'protocols/wlr-layer-shell-unstable-v1.xml', 'protocols/wlr-layer-shell-unstable-v1.xml',
) )
if wayland_protocols.version().version_compare('>=1.32')
add_project_arguments('-DHAVE_WAYLAND_CURSOR_SHAPE', language: 'c')
protocols += files(
wayland_sys_protocols_dir + '/staging/cursor-shape/cursor-shape-v1.xml',
wayland_sys_protocols_dir + '/unstable/tablet/tablet-unstable-v2.xml',
)
endif
proto_srcs = [] proto_srcs = []
proto_headers = [] proto_headers = []
foreach p : protocols foreach p : protocols
proto_srcs += custom_target( proto_srcs += custom_target(
'@0@'.format(p).underscorify() + '_protocol_c', fs.stem(p).underscorify() + '_protocol_c',
input: p, input: p,
output: '@BASENAME@-protocol.c', output: '@BASENAME@-protocol.c',
command: [wayland_scanner, 'public-code', '@INPUT@', '@OUTPUT@'], command: [wayland_scanner, 'public-code', '@INPUT@', '@OUTPUT@'],
) )
proto_headers += custom_target( proto_headers += custom_target(
'@0@'.format(p).underscorify() + '_protocol_h', fs.stem(p).underscorify() + '_protocol_h',
input: p, input: p,
output: '@BASENAME@-protocol.h', output: '@BASENAME@-protocol.h',
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'], command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
@@ -308,16 +350,6 @@ rofi = executable('rofi', rofi_sources + [
) )
subdir('doc') subdir('doc')
install_man(
'doc/rofi.1',
'doc/rofi-theme-selector.1',
'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',
)
install_data( install_data(
'themes/Adapta-Nokto.rasi', 'themes/Adapta-Nokto.rasi',
@@ -334,7 +366,7 @@ install_data(
'themes/dmenu.rasi', 'themes/dmenu.rasi',
'themes/docu.rasi', 'themes/docu.rasi',
'themes/glue_pro_blue.rasi', 'themes/glue_pro_blue.rasi',
'themes/gruvbox-common.rasi', 'themes/gruvbox-common.rasinc',
'themes/gruvbox-dark-hard.rasi', 'themes/gruvbox-dark-hard.rasi',
'themes/gruvbox-dark-soft.rasi', 'themes/gruvbox-dark-soft.rasi',
'themes/gruvbox-dark.rasi', 'themes/gruvbox-dark.rasi',
@@ -349,8 +381,11 @@ install_data(
'themes/solarized.rasi', 'themes/solarized.rasi',
'themes/solarized_alternate.rasi', 'themes/solarized_alternate.rasi',
'themes/fancy.rasi', 'themes/fancy.rasi',
'themes/fancy2.rasi',
'themes/iggy.rasi', 'themes/iggy.rasi',
'themes/material.rasi',
'themes/iggy.jpg', 'themes/iggy.jpg',
'themes/fullscreen-preview.rasi',
install_dir: themedir install_dir: themedir
) )
@@ -576,7 +611,7 @@ if cppcheck.found()
'--enable=all', '--enable=all',
'-Uerror_dialog', '-Uerror_dialog',
'--inconclusive', '--inconclusive',
'-I@0@'.format(join_paths(meson.source_root(), 'include')), '-I@0@'.format(join_paths(meson.project_source_root(), 'include')),
rofi_sources rofi_sources
], ],
) )

View File

@@ -1,5 +1,6 @@
option('drun', type: 'boolean', value: true, description: 'Desktop file mode') option('drun', type: 'boolean', value: true, description: 'Desktop file mode')
option('window', type: 'boolean', value: true, description: 'Window switcher mode') option('window', type: 'boolean', value: true, description: 'Window switcher mode')
option('check', type: 'feature', description: 'Build and run libcheck-based tests') option('check', type: 'feature', description: 'Build and run libcheck-based tests')
option('imdkit', type: 'boolean', value: true, description: 'IMDKit support')
option('wayland', type: 'feature', value: 'enabled', description: 'Build with wayland support') option('wayland', type: 'feature', value: 'enabled', description: 'Build with wayland support')
option('xcb', type: 'feature', value: 'enabled', description: 'Build with X11/xcb support') option('xcb', type: 'feature', value: 'enabled', description: 'Build with X11/xcb support')

View File

@@ -0,0 +1,145 @@
# ROFI-SCRIPT 5 rofi-script
## NAME
**rofi script mode** - Rofi format for scriptable modi.
## DESCRIPTION
**rofi** supports modes that use simple scripts in the background to generate a list and process the result from user
actions. This provide a simple interface to make simple extensions to rofi.
## USAGE
To specify a script mode, set a mode with the following syntax: "{name}:{executable}"
For example:
```
rofi -show fb -modi "fb:file_browser.sh"
```
The name should be unique.
## API
Rofi calls the executable without arguments on startup. This should generate a list of options, separated by a newline
(`\n`) (This can be changed by the script).
If the user selects an option, rofi calls the executable with the text of that option as the first argument.
If the script returns no entries, rofi quits.
A simple script would be:
```bash
#!/usr/bin/env bash
if [ x"$@" = x"quit" ]
then
exit 0
fi
echo "reload"
echo "quit"
```
This shows two entries, reload and quit. When the quit entry is selected, rofi closes.
## Environment
Rofi sets the following environment variable when executing the script:
### `ROFI_RETV`
An integer number with the current state:
* **0**: Initial call of script.
* **1**: Selected an entry.
* **2**: Selected a custom entry.
* **10-28**: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
### `ROFI_INFO`
Environment get set when selected entry get set with the property value of the 'info' row option, if set.
## Passing mode options
Extra options, like setting the prompt, can be set by the script.
Extra options are lines that start with a NULL character (`\0`) followed by a key, separator (`\x1f`) and value.
For example to set the prompt:
```bash
echo -en "\0prompt\x1fChange prompt\n"
```
The following extra options exists:
* **prompt**: Update the prompt text.
* **message**: Update the message text.
* **markup-rows**: If 'true' renders markup in the row.
* **urgent**: Mark rows as urgent. (for syntax see the urgent option in dmenu mode)
* **active**: Mark rows as active. (for syntax see the active option in dmenu mode)
* **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.
## Parsing row options
Extra options for individual rows can be set.
The extra option can be specified following the same syntax as mode option, but following the entry.
For example:
```bash
echo -en "aap\0icon\x1ffolder\n"
```
The following options are supported:
* **icon**: Set the icon for that row.
* **meta**: Specify invisible search terms.
* **nonselectable**: If true the row cannot activated.
* **info**: Info that, on selection, gets placed in the `ROFI_INFO` environment variable. This entry does not get searched.
multiple entries can be passed using the `\x1f` separator.
```bash
echo -en "aap\0icon\x1ffolder\x1finfo\x1ftest\n"
```
## Executing external program
If you want to launch an external program from the script, you need to make sure it is launched in the background.
If not rofi will wait for its output (to display).
In bash the best way to do this is using `coproc`.
```bash
coproc ( myApp > /dev/null 2>&1 )
```
## DASH shell
If you use the `dash` shell for your script, take special care with how dash handles escaped values for the separators.
See issue #1201 on github.
## SEE ALSO
rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-theme-selector(1)
## AUTHOR
Qball Cow <qball@gmpclient.org>
Rasmus Steinke <rasi@xssn.at>
Quentin Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com>
For a full list of authors, check the AUTHORS file.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,145 @@
# ROFI-SCRIPT 5 rofi-script
## NAME
**rofi script mode** - Rofi format for scriptable modi.
## DESCRIPTION
**rofi** supports modes that use simple scripts in the background to generate a list and process the result from user
actions. This provide a simple interface to make simple extensions to rofi.
## USAGE
To specify a script mode, set a mode with the following syntax: "{name}:{executable}"
For example:
```
rofi -show fb -modi "fb:file_browser.sh"
```
The name should be unique.
## API
Rofi calls the executable without arguments on startup. This should generate a list of options, separated by a newline
(`\n`) (This can be changed by the script).
If the user selects an option, rofi calls the executable with the text of that option as the first argument.
If the script returns no entries, rofi quits.
A simple script would be:
```bash
#!/usr/bin/env bash
if [ x"$@" = x"quit" ]
then
exit 0
fi
echo "reload"
echo "quit"
```
This shows two entries, reload and quit. When the quit entry is selected, rofi closes.
## Environment
Rofi sets the following environment variable when executing the script:
### `ROFI_RETV`
An integer number with the current state:
* **0**: Initial call of script.
* **1**: Selected an entry.
* **2**: Selected a custom entry.
* **10-28**: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
### `ROFI_INFO`
Environment get set when selected entry get set with the property value of the 'info' row option, if set.
## Passing mode options
Extra options, like setting the prompt, can be set by the script.
Extra options are lines that start with a NULL character (`\0`) followed by a key, separator (`\x1f`) and value.
For example to set the prompt:
```bash
echo -en "\0prompt\x1fChange prompt\n"
```
The following extra options exists:
* **prompt**: Update the prompt text.
* **message**: Update the message text.
* **markup-rows**: If 'true' renders markup in the row.
* **urgent**: Mark rows as urgent. (for syntax see the urgent option in dmenu mode)
* **active**: Mark rows as active. (for syntax see the active option in dmenu mode)
* **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.
## Parsing row options
Extra options for individual rows can be set.
The extra option can be specified following the same syntax as mode option, but following the entry.
For example:
```bash
echo -en "aap\0icon\x1ffolder\n"
```
The following options are supported:
* **icon**: Set the icon for that row.
* **meta**: Specify invisible search terms.
* **nonselectable**: If true the row cannot activated.
* **info**: Info that, on selection, gets placed in the `ROFI_INFO` environment variable. This entry does not get searched.
multiple entries can be passed using the `\x1f` separator.
```bash
echo -en "aap\0icon\x1ffolder\x1finfo\x1ftest\n"
```
## Executing external program
If you want to launch an external program from the script, you need to make sure it is launched in the background.
If not rofi will wait for its output (to display).
In bash the best way to do this is using `coproc`.
```bash
coproc ( myApp > /dev/null 2>&1 )
```
## DASH shell
If you use the `dash` shell for your script, take special care with how dash handles escaped values for the separators.
See issue #1201 on github.
## SEE ALSO
rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-theme-selector(1)
## AUTHOR
Qball Cow <qball@gmpclient.org>
Rasmus Steinke <rasi@xssn.at>
Quentin Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com>
For a full list of authors, check the AUTHORS file.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,145 @@
# ROFI-SCRIPT 5 rofi-script
## NAME
**rofi script mode** - Rofi format for scriptable modi.
## DESCRIPTION
**rofi** supports modes that use simple scripts in the background to generate a list and process the result from user
actions. This provide a simple interface to make simple extensions to rofi.
## USAGE
To specify a script mode, set a mode with the following syntax: "{name}:{executable}"
For example:
```
rofi -show fb -modi "fb:file_browser.sh"
```
The name should be unique.
## API
Rofi calls the executable without arguments on startup. This should generate a list of options, separated by a newline
(`\n`) (This can be changed by the script).
If the user selects an option, rofi calls the executable with the text of that option as the first argument.
If the script returns no entries, rofi quits.
A simple script would be:
```bash
#!/usr/bin/env bash
if [ x"$@" = x"quit" ]
then
exit 0
fi
echo "reload"
echo "quit"
```
This shows two entries, reload and quit. When the quit entry is selected, rofi closes.
## Environment
Rofi sets the following environment variable when executing the script:
### `ROFI_RETV`
An integer number with the current state:
* **0**: Initial call of script.
* **1**: Selected an entry.
* **2**: Selected a custom entry.
* **10-28**: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
### `ROFI_INFO`
Environment get set when selected entry get set with the property value of the 'info' row option, if set.
## Passing mode options
Extra options, like setting the prompt, can be set by the script.
Extra options are lines that start with a NULL character (`\0`) followed by a key, separator (`\x1f`) and value.
For example to set the prompt:
```bash
echo -en "\0prompt\x1fChange prompt\n"
```
The following extra options exists:
* **prompt**: Update the prompt text.
* **message**: Update the message text.
* **markup-rows**: If 'true' renders markup in the row.
* **urgent**: Mark rows as urgent. (for syntax see the urgent option in dmenu mode)
* **active**: Mark rows as active. (for syntax see the active option in dmenu mode)
* **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.
## Parsing row options
Extra options for individual rows can be set.
The extra option can be specified following the same syntax as mode option, but following the entry.
For example:
```bash
echo -en "aap\0icon\x1ffolder\n"
```
The following options are supported:
* **icon**: Set the icon for that row.
* **meta**: Specify invisible search terms.
* **nonselectable**: If true the row cannot activated.
* **info**: Info that, on selection, gets placed in the `ROFI_INFO` environment variable. This entry does not get searched.
multiple entries can be passed using the `\x1f` separator.
```bash
echo -en "aap\0icon\x1ffolder\x1finfo\x1ftest\n"
```
## Executing external program
If you want to launch an external program from the script, you need to make sure it is launched in the background.
If not rofi will wait for its output (to display).
In bash the best way to do this is using `coproc`.
```bash
coproc ( myApp > /dev/null 2>&1 )
```
## DASH shell
If you use the `dash` shell for your script, take special care with how dash handles escaped values for the separators.
See issue #1201 on github.
## SEE ALSO
rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-theme-selector(1)
## AUTHOR
Qball Cow <qball@gmpclient.org>
Rasmus Steinke <rasi@xssn.at>
Quentin Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com>
For a full list of authors, check the AUTHORS file.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -0,0 +1,203 @@
# ROFI-DMENU 5 rofi-dmenu
## NAME
**rofi dmenu mode** - Rofi dmenu emulation
## DESCRIPTION
To integrate **rofi** into scripts as simple selection dialogs,
**rofi** supports emulating **dmenu(1)** (A dynamic menu for X11).
The website for `dmenu` can be found [here](http://tools.suckless.org/dmenu/).
**rofi** does not aim to be 100% compatible with `dmenu`. There are simply too many flavors of `dmenu`.
The idea is that the basic usage command-line flags are obeyed, theme-related flags are not.
Besides, **rofi** offers some extended features (like multi-select, highlighting, message bar, extra key bindings).
## BASIC CONCEPT
In `dmenu` mode, **rofi** reads data from standard in, splits them into separate entries and displays them.
If the user selects an row, this is printed out to standard out, allow the script to process it further.
By default separation of rows is done on new lines, making it easy to pipe the output a one application into
**rofi** and the output of rofi into the next.
## USAGE
By launching **rofi** with the `-dmenu` flag it will go into dmenu emulation mode.
```bash
ls | rofi -dmenu
```
### DMENU DROP-IN REPLACEMENT
If `argv[0]` (calling command) is dmenu, **rofi** will start in dmenu mode.
This way, it can be used as a drop-in replacement for dmenu. Just copy or symlink **rofi** to dmenu in `$PATH`.
ln -s /usr/bin/rofi /usr/bin/dmenu
### DMENU VS SCRIPT MODE
Script mode is used to extend **rofi**, dmenu mode is used to extend a script.
The two do share much of the same input format. Please see the **rofi-script(5)** manpage for more information.
### DMENU SPECIFIC COMMANDLINE FLAGS
A lot of these options can also be modified by the script using special input. See the **rofi-script(5)** manpage
for more information about this syntax.
`-sep` *separator*
Separator for `dmenu`. Example: To show a list of 'a' to 'e' with '|' as a separator:
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
`-p` *prompt*
Specify the prompt to show in `dmenu` mode. For example, select 'monkey', a,b,c,d, or e.
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey"
Default: *dmenu*
`-l` *number of lines to show*
Maximum number of lines the menu may show before scrolling.
rofi -dmenu -l 25
Default: *15*
`-i`
Makes `dmenu` searches case-insensitive
`-a` *X*
Active row, mark *X* as active. Where *X* 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:
* A single row: '5'
* A range of (last 3) rows: '-3:'
* 4 rows starting from row 7: '7:11' (or in legacy notation: '7-10')
* A set of rows: '2,0,-9'
* Or any combination: '5,-3:,7:11,2,0,-9'
`-u` *X*
Urgent row, mark *X* as urgent. See `-a` option for details.
`-only-match`
Only return a selected item, do not allow custom entry.
This mode always returns an entry. It will not return if no matching entry is
selected.
`-no-custom`
Only return a selected item, do not allow custom entry.
This mode returns directly when no entries given.
`-format` *format*
Allows the output of dmenu to be customized (N is the total number of input entries):
* 's' selected string
* 'i' index (0 - (N-1))
* 'd' index (1 - N)
* 'q' quote string
* 'p' Selected string stripped from Pango markup (Needs to be a valid string)
* 'f' filter string (user input)
* 'F' quoted filter string (user input)
Default: 's'
`-select` *string*
Select first line that matches the given string
`-mesg` *string*
Add a message line below the filter entry box. Supports Pango markup.
For more information on supported markup, see [here](https://docs.gtk.org/Pango/pango_markup.html)
`-dump`
Dump the filtered list to stdout and quit.
This can be used to get the list as **rofi** would filter it.
Use together with `-filter` command.
`-input` *file*
Reads from *file* instead of stdin.
`-password`
Hide the input text. This should not be considered secure!
`-markup-rows`
Tell **rofi** that DMenu input is Pango markup encoded, and should be rendered.
See [here](https://developer.gnome.org/pygtk/stable/pango-markup-language.html) for details about Pango markup.
`-multi-select`
Allow multiple lines to be selected. Adds a small selection indicator to the left of each entry.
`-sync`
Force **rofi** mode to first read all data from stdin before showing the selection window. This is original dmenu behavior.
Note: the default asynchronous mode will also be automatically disabled if used with conflicting options,
such as `-dump`, `-only-match` or `-auto-select`.
`-async-pre-read` *number*
Reads the first *number* entries blocking, then switches to async mode.
This makes it feel more 'snappy'.
*default*: 25
`-window-title` *title*
Set name used for the window title. Will be shown as Rofi - *title*
`-w` *windowid*
Position **rofi** over the window with the given X11 window ID.
`-keep-right`
Set ellipsize mode to start. So, the end of the string is visible.
## RETURN VALUE
* **0**: Row has been selected accepted by user.
* **1**: User cancelled the selection.
* **10-28**: Row accepted by custom keybinding.
## SEE ALSO
rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-script(5), rofi-theme-selector(1)
## AUTHOR
Qball Cow <qball@gmpclient.org>
Rasmus Steinke <rasi@xssn.at>
Morgane Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com>
For a full list of authors, check the AUTHORS file.

View File

@@ -0,0 +1,446 @@
# ROFI-KEYS 5 rofi-keys
## NAME
**rofi keys** - Rofi Key and Mouse bindings
## DESCRIPTION
**rofi** supports overriding of any of it key and mouse binding.
## Setting binding
Bindings can be done on the commandline (-{bindingname}):
```bash
rofi -show run -kb-accept-entry 'Control+Shift+space'
```
or via the configuration file:
```css
configuration {
kb-accept-entry: "Control+Shift+space";
}
```
The key can be set by its name (see above) or its keycode:
```css
configuration {
kb-accept-entry: "Control+Shift+[65]";
}
```
An easy way to look up keycode is xev(1).
Multiple keys can be specified for an action as a comma separated list:
```css
configuration {
kb-accept-entry: "Control+Shift+space,Return";
}
```
By Default **rofi** reacts on pressing, to act on the release of all keys
prepend the binding with `!`:
```css
configuration {
kb-accept-entry: "!Control+Shift+space,Return";
}
```
## Keyboard Bindings
### **kb-primary-paste**:
Paste primary selection
**Default**: Control+V,Shift+Insert
### **kb-secondary-paste**
Paste clipboard
**Default**: Control+v,Insert
### **kb-clear-line**
Clear input line
**Default**: Control+w
### **kb-move-front**
Beginning of line
**Default**: Control+a
### **kb-move-end**
End of line
**Default**: Control+e
### **kb-move-word-back**
Move back one word
**Default**: Alt+b,Control+Left
### **kb-move-word-forward**
Move forward one word
**Default**: Alt+f,Control+Right
### **kb-move-char-back**
Move back one char
**Default**: Left,Control+b
### **kb-move-char-forward**
Move forward one char
**Default**: Right,Control+f
### **kb-remove-word-back**
Delete previous word
**Default**: Control+Alt+h,Control+BackSpace
### **kb-remove-word-forward**
Delete next word
**Default**: Control+Alt+d
### **kb-remove-char-forward**
Delete next char
**Default**: Delete,Control+d
### **kb-remove-char-back**
Delete previous char
**Default**: BackSpace,Shift+BackSpace,Control+h
### **kb-remove-to-eol**
Delete till the end of line
**Default**: Control+k
### **kb-remove-to-sol**
Delete till the start of line
**Default**: Control+u
### **kb-accept-entry**
Accept entry
**Default**: Control+j,Control+m,Return,KP_Enter
### **kb-accept-custom**
Use entered text as command (in ssh/run modi)
**Default**: Control+Return
### **kb-accept-custom-alt**
Use entered text as command (in ssh/run modi)
**Default**: Control+Shift+Return
### **kb-accept-alt**
Use alternate accept command.
**Default**: Shift+Return
### **kb-delete-entry**
Delete entry from history
**Default**: Shift+Delete
### **kb-mode-next**
Switch to the next mode.
**Default**: Shift+Right,Control+Tab
### **kb-mode-previous**
Switch to the previous mode.
**Default**: Shift+Left,Control+ISO_Left_Tab
### **kb-mode-complete**
Start completion for mode.
**Default**: Control+l
### **kb-row-left**
Go to the previous column
**Default**: Control+Page_Up
### **kb-row-right**
Go to the next column
**Default**: Control+Page_Down
### **kb-row-up**
Select previous entry
**Default**: Up,Control+p,ISO_Left_Tab
### **kb-row-down**
Select next entry
**Default**: Down,Control+n
### **kb-row-tab**
Go to next row, if one left, accept it, if no left next mode.
**Default**: Tab
### **kb-page-prev**
Go to the previous page
**Default**: Page_Up
### **kb-page-next**
Go to the next page
**Default**: Page_Down
### **kb-row-first**
Go to the first entry
**Default**: Home,KP_Home
### **kb-row-last**
Go to the last entry
**Default**: End,KP_End
### **kb-row-select**
Set selected item as input text
**Default**: Control+space
### **kb-screenshot**
Take a screenshot of the rofi window
**Default**: Alt+S
### **kb-ellipsize**
Toggle between ellipsize modes for displayed data
**Default**: Alt+period
### **kb-toggle-case-sensitivity**
Toggle case sensitivity
**Default**: grave,dead_grave
### **kb-toggle-sort**
Toggle sort
**Default**: Alt+grave
### **kb-cancel**
Quit rofi
**Default**: Escape,Control+g,Control+bracketleft
### **kb-custom-1**
Custom keybinding 1
**Default**: Alt+1
### **kb-custom-2**
Custom keybinding 2
**Default**: Alt+2
### **kb-custom-3**
Custom keybinding 3
**Default**: Alt+3
### **kb-custom-4**
Custom keybinding 4
**Default**: Alt+4
### **kb-custom-5**
Custom Keybinding 5
**Default**: Alt+5
### **kb-custom-6**
Custom keybinding 6
**Default**: Alt+6
### **kb-custom-7**
Custom Keybinding 7
**Default**: Alt+7
### **kb-custom-8**
Custom keybinding 8
**Default**: Alt+8
### **kb-custom-9**
Custom keybinding 9
**Default**: Alt+9
### **kb-custom-10**
Custom keybinding 10
**Default**: Alt+0
### **kb-custom-11**
Custom keybinding 11
**Default**: Alt+exclam
### **kb-custom-12**
Custom keybinding 12
**Default**: Alt+at
### **kb-custom-13**
Custom keybinding 13
**Default**: Alt+numbersign
### **kb-custom-14**
Custom keybinding 14
**Default**: Alt+dollar
### **kb-custom-15**
Custom keybinding 15
**Default**: Alt+percent
### **kb-custom-16**
Custom keybinding 16
**Default**: Alt+dead_circumflex
### **kb-custom-17**
Custom keybinding 17
**Default**: Alt+ampersand
### **kb-custom-18**
Custom keybinding 18
**Default**: Alt+asterisk
### **kb-custom-19**
Custom Keybinding 19
**Default**: Alt+parenleft
### **kb-select-1**
Select row 1
**Default**: Super+1
### **kb-select-2**
Select row 2
**Default**: Super+2
### **kb-select-3**
Select row 3
**Default**: Super+3
### **kb-select-4**
Select row 4
**Default**: Super+4
### **kb-select-5**
Select row 5
**Default**: Super+5
### **kb-select-6**
Select row 6
**Default**: Super+6
### **kb-select-7**
Select row 7
**Default**: Super+7
### **kb-select-8**
Select row 8
**Default**: Super+8
### **kb-select-9**
Select row 9
**Default**: Super+9
### **kb-select-10**
Select row 10
**Default**: Super+0
## Mouse Bindings
### **ml-row-left**
Go to the previous column
**Default**: ScrollLeft
### **ml-row-right**
Go to the next column
**Default**: ScrollRight
### **ml-row-up**
Select previous entry
**Default**: ScrollUp
### **ml-row-down**
Select next entry
**Default**: ScrollDown
### **me-select-entry**
Select hovered row
**Default**: MousePrimary
### **me-accept-entry**
Accept hovered row
**Default**: MouseDPrimary
### **me-accept-custom**
Accept hovered row with custom action
**Default**: Control+MouseDPrimary
## SEE ALSO
rofi(1), rofi-sensible-terminal(1), rofi-theme(5), rofi-script(5)
## AUTHOR
Qball Cow <qball@gmpclient.org>
Rasmus Steinke <rasi@xssn.at>
Morgane Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com>
For a full list of authors, check the AUTHORS file.

View File

@@ -0,0 +1,145 @@
# ROFI-SCRIPT 5 rofi-script
## NAME
**rofi script mode** - Rofi format for scriptable modi.
## DESCRIPTION
**rofi** supports modes that use simple scripts in the background to generate a list and process the result from user
actions. This provide a simple interface to make simple extensions to rofi.
## USAGE
To specify a script mode, set a mode with the following syntax: "{name}:{executable}"
For example:
```
rofi -show fb -modi "fb:file_browser.sh"
```
The name should be unique.
## API
Rofi calls the executable without arguments on startup. This should generate a list of options, separated by a newline
(`\n`) (This can be changed by the script).
If the user selects an option, rofi calls the executable with the text of that option as the first argument.
If the script returns no entries, rofi quits.
A simple script would be:
```bash
#!/usr/bin/env bash
if [ x"$@" = x"quit" ]
then
exit 0
fi
echo "reload"
echo "quit"
```
This shows two entries, reload and quit. When the quit entry is selected, rofi closes.
## Environment
Rofi sets the following environment variable when executing the script:
### `ROFI_RETV`
An integer number with the current state:
* **0**: Initial call of script.
* **1**: Selected an entry.
* **2**: Selected a custom entry.
* **10-28**: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
### `ROFI_INFO`
Environment get set when selected entry get set with the property value of the 'info' row option, if set.
## Passing mode options
Extra options, like setting the prompt, can be set by the script.
Extra options are lines that start with a NULL character (`\0`) followed by a key, separator (`\x1f`) and value.
For example to set the prompt:
```bash
echo -en "\0prompt\x1fChange prompt\n"
```
The following extra options exists:
* **prompt**: Update the prompt text.
* **message**: Update the message text.
* **markup-rows**: If 'true' renders markup in the row.
* **urgent**: Mark rows as urgent. (for syntax see the urgent option in dmenu mode)
* **active**: Mark rows as active. (for syntax see the active option in dmenu mode)
* **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.
## Parsing row options
Extra options for individual rows can be set.
The extra option can be specified following the same syntax as mode option, but following the entry.
For example:
```bash
echo -en "aap\0icon\x1ffolder\n"
```
The following options are supported:
* **icon**: Set the icon for that row.
* **meta**: Specify invisible search terms.
* **nonselectable**: If true the row cannot activated.
* **info**: Info that, on selection, gets placed in the `ROFI_INFO` environment variable. This entry does not get searched.
multiple entries can be passed using the `\x1f` separator.
```bash
echo -en "aap\0icon\x1ffolder\x1finfo\x1ftest\n"
```
## Executing external program
If you want to launch an external program from the script, you need to make sure it is launched in the background.
If not rofi will wait for its output (to display).
In bash the best way to do this is using `coproc`.
```bash
coproc ( myApp > /dev/null 2>&1 )
```
## DASH shell
If you use the `dash` shell for your script, take special care with how dash handles escaped values for the separators.
See issue #1201 on github.
## SEE ALSO
rofi(1), rofi-sensible-terminal(1), dmenu(1), rofi-theme(5), rofi-theme-selector(1)
## AUTHOR
Qball Cow <qball@gmpclient.org>
Rasmus Steinke <rasi@xssn.at>
Morgane Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com>
For a full list of authors, check the AUTHORS file.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,176 @@
# 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.
To redirect the debug output to a file (`~/rofi.log`) add:
```
rofi -show drun -log ~/rofi.log
```
Specifying the logfile automatically enabled all log domains.
This can be useful when rofi is launched from a window manager.
## 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>

Some files were not shown because too many files have changed in this diff Show More