Krolyxon
Commit 43fcd2e

Branches

Refs →

nsxiv43fcd2e

set env var NSXIV_USING_NULL for key-handler and update docs

Author
NRK
Date
2021-11-19 16:08 +0600
Committer
N-R-K · 2021-11-19 17:02 +0600
Parent
2df3320
Commit
43fcd2e02e113a55f673f266ad28b53858500022

+19 −8

3 files changed

  1. M examples/key-handler +8 −4
  2. M main.c +1 −0
  3. M nsxiv.1 +10 −4
M examples/key-handler View
@@ -3,10 +3,14 @@
33 # Example for $XDG_CONFIG_HOME/nsxiv/exec/key-handler
44 # Called by nsxiv(1) after the external prefix key (C-x by default) is pressed.
55 # The next key combo is passed as its first argument. Passed via stdin are the
6−# images to act upon, one path per line: all marked images, if in thumbnail
7−# mode and at least one image has been marked, otherwise the current image.
8−# nsxiv(1) blocks until this script terminates. It then checks which images
9−# have been modified and reloads them.
6+# images to act upon: all marked images, if in thumbnail mode and at least one
7+# image has been marked, otherwise the current image. nsxiv(1) will block until
8+# the handler terminates. It then checks which images have been modified and
9+# reloads them.
10+
11+# By default nsxiv(1) will send one image per-line to stdin, however when using
12+# -0 the image list will be NULL separated and the enviornment variable
13+# "$NSXIV_USING_NULL" will be set to 1.
1014
1115 # The key combo argument has the following form: "[C-][M-][S-]KEY",
1216 # where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier states and KEY is the X
M main.c View
@@ -549,6 +549,7 @@ void run_key_handler(const char *key, unsigned int mask)
549549 mask & ControlMask ? "C-" : "",
550550 mask & Mod1Mask ? "M-" : "",
551551 mask & ShiftMask ? "S-" : "", key);
552+ setenv("NSXIV_USING_NULL", options->using_null ? "1" : "0", 1);
552553
553554 if ((pid = fork()) == 0) {
554555 close(pfd[1]);
M nsxiv.1 View
@@ -439,14 +439,20 @@ located in
439439 The handler is invoked by pressing
440440 .BR Ctrl-x .
441441 The next key combo is passed as its first argument. Passed via stdin are the
442−images to act upon, one path per line: all marked images, if in thumbnail mode
443−and at least one image has been marked, otherwise the current image.
444−nsxiv(1) will block until the handler terminates. It then checks which images
445−have been modified and reloads them.
442+images to act upon: all marked images, if in thumbnail mode and at least one
443+image has been marked, otherwise the current image. nsxiv(1) will block until
444+the handler terminates. It then checks which images have been modified and
445+reloads them.
446+
447+By default nsxiv(1) will send one image per-line to stdin, however when using
448+\-0 the image list will be NULL separated and the enviornment variable
449+"$NSXIV_USING_NULL" will be set to 1.
446450
447451 The key combo argument has the following form: "[C-][M-][S-]KEY",
448452 where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier states and KEY is the X
449453 keysym as listed in /usr/include/X11/keysymdef.h without the "XK_" prefix.
454+If KEY has an uppercase equivalent, S-KEY is resolved into it. For instance,
455+K replaces S-k and Scedilla replaces S-scedilla, but S-Delete is sent as-is.
450456
451457 There is also an example script installed together with nsxiv as
452458 .IR EGPREFIX/key-handler .