nsxiv43fcd2e
set env var NSXIV_USING_NULL for key-handler and update docs
+19 −8
3 files changed
- M examples/key-handler +8 −4
- M main.c +1 −0
- M nsxiv.1 +10 −4
| @@ -3,10 +3,14 @@ | |||
| 3 | 3 | # Example for $XDG_CONFIG_HOME/nsxiv/exec/key-handler | |
| 4 | 4 | # Called by nsxiv(1) after the external prefix key (C-x by default) is pressed. | |
| 5 | 5 | # 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. | |
| 10 | 14 | ||
| 11 | 15 | # The key combo argument has the following form: "[C-][M-][S-]KEY", | |
| 12 | 16 | # where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier states and KEY is the X | |
| @@ -549,6 +549,7 @@ void run_key_handler(const char *key, unsigned int mask) | |||
| 549 | 549 | mask & ControlMask ? "C-" : "", | |
| 550 | 550 | mask & Mod1Mask ? "M-" : "", | |
| 551 | 551 | mask & ShiftMask ? "S-" : "", key); | |
| 552 | + | setenv("NSXIV_USING_NULL", options->using_null ? "1" : "0", 1); | |
| 552 | 553 | ||
| 553 | 554 | if ((pid = fork()) == 0) { | |
| 554 | 555 | close(pfd[1]); | |
| @@ -439,14 +439,20 @@ located in | |||
| 439 | 439 | The handler is invoked by pressing | |
| 440 | 440 | .BR Ctrl-x . | |
| 441 | 441 | 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. | |
| 446 | 450 | ||
| 447 | 451 | The key combo argument has the following form: "[C-][M-][S-]KEY", | |
| 448 | 452 | where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier states and KEY is the X | |
| 449 | 453 | 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. | |
| 450 | 456 | ||
| 451 | 457 | There is also an example script installed together with nsxiv as | |
| 452 | 458 | .IR EGPREFIX/key-handler . | |