summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2020-04-05 12:55:00 +0200
committerDave Davenport <qball@gmpclient.org>2020-04-05 12:56:33 +0200
commitbacecf3044be0dea3f8c5e06a2354443f09152eb (patch)
treebb452b22afaaef18d4c4c95a45cd2108798feac7 /doc
parent5879fd60996b376edfb16f424fc1ffd0e3f49cd3 (diff)
[Script] Add environment variable to indicate state.
* ROFI_RETV shows the state rofi was in before calling rofi.
Diffstat (limited to 'doc')
-rw-r--r--doc/rofi-script.516
-rw-r--r--doc/rofi-script.5.markdown13
2 files changed, 29 insertions, 0 deletions
diff --git a/doc/rofi-script.5 b/doc/rofi-script.5
index 55abbfed..2ebd1ca3 100644
--- a/doc/rofi-script.5
+++ b/doc/rofi-script.5
@@ -57,6 +57,22 @@ echo "quit"
.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:
+.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
+
.SH Passing mode options
.PP
Extra options, like setting the prompt, can be set by the script.
diff --git a/doc/rofi-script.5.markdown b/doc/rofi-script.5.markdown
index 7a97b127..63a37d57 100644
--- a/doc/rofi-script.5.markdown
+++ b/doc/rofi-script.5.markdown
@@ -46,6 +46,19 @@ 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
+
## Passing mode options
Extra options, like setting the prompt, can be set by the script.