summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2020-04-07 13:20:16 +0200
committerDave Davenport <qball@gmpclient.org>2020-04-07 13:20:16 +0200
commit758714995091977ec0dd87b7c664cd3f36a7d093 (patch)
tree0bf75bfef499782dc669008dda6dfffa9d747ca4
parentde38e0f4a9c2e4dce9d2ab764359f62610f0f17a (diff)
[Script] Update example and doc.
-rwxr-xr-xExamples/test_script_mode_delim.sh6
-rw-r--r--doc/rofi-script.52
-rw-r--r--doc/rofi-script.5.markdown2
-rw-r--r--source/dialogs/script.c2
4 files changed, 8 insertions, 4 deletions
diff --git a/Examples/test_script_mode_delim.sh b/Examples/test_script_mode_delim.sh
index 1fc15871..d5ff26e8 100755
--- a/Examples/test_script_mode_delim.sh
+++ b/Examples/test_script_mode_delim.sh
@@ -6,7 +6,11 @@ then
fi
# Override the previously set prompt.
-echo -en "\x00delim\x1f\\x1\n"
+# We only want to do this on first call of script.
+if [ $ROFI_RETV = 0 ]
+then
+ echo -en "\x00delim\x1f\\x1\n"
+fi
echo -en "\x00prompt\x1fChange prompt\x1"
for a in {1..10}
do
diff --git a/doc/rofi-script.5 b/doc/rofi-script.5
index 2ebd1ca3..4d5a2ea3 100644
--- a/doc/rofi-script.5
+++ b/doc/rofi-script.5
@@ -103,7 +103,7 @@ The following extra options exists:
.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.
+\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.
.SH Parsing row options
.PP
diff --git a/doc/rofi-script.5.markdown b/doc/rofi-script.5.markdown
index 63a37d57..8b941aa7 100644
--- a/doc/rofi-script.5.markdown
+++ b/doc/rofi-script.5.markdown
@@ -77,7 +77,7 @@ The following extra options exists:
* **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.
+ * **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.
## Parsing row options
diff --git a/source/dialogs/script.c b/source/dialogs/script.c
index 6976fe05..653a5726 100644
--- a/source/dialogs/script.c
+++ b/source/dialogs/script.c
@@ -108,7 +108,7 @@ static void parse_header_entry ( Mode *sw, char *line, ssize_t length )
length_key++;
}
- if ( length_key < length ) {
+ if ( (length_key+1) < length ) {
line[length_key] = '\0';
char *value = line + length_key + 1;
if ( strcasecmp ( line, "message" ) == 0 ) {