You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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>
**rofi-actions** - Custom commands following interaction with rofi menus
6
+
7
+
## DESCRIPTION
8
+
9
+
**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.
10
+
11
+
This makes it possible for example to play sound effects or read aloud menu entries on selection.
12
+
13
+
## USAGE
14
+
15
+
Following is the list of rofi flags for specifying custom commands or scripts to execute on supported actions:
16
+
17
+
`-on-selection-changed`*cmd*
18
+
19
+
Command or script to run when the current selection changes. Selected text is forwarded to the command replacing the pattern *{entry}*.
20
+
21
+
`-on-entry-accepted`*cmd*
22
+
23
+
Command or script to run when a menu entry is accepted. Accepted text is forwarded to the command replacing the pattern *{entry}*.
24
+
25
+
`-on-mode-changed`*cmd*
26
+
27
+
Command or script to run when the menu mode (e.g. drun,window,ssh...) is changed.
28
+
29
+
`-on-menu-canceled`*cmd*
30
+
31
+
Command or script to run when the menu is canceled.
32
+
33
+
`-on-menu-error`*cmd*
34
+
35
+
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}*.
36
+
37
+
`-on-screenshot-taken`*cmd*
38
+
39
+
Command or script to run when a screenshot of rofi is taken. Screenshot path is forwarded to the command replacing the pattern *{path}*.
0 commit comments