commit abce18b913ffbe3caf85bca368757e306a9d2b6e
parent 022e61ed65c4b5363e9cd8767676816834c8a9fb
Author: sin <sin@2f30.org>
Date: Thu, 22 Aug 2019 15:48:59 +0100
Allow overriding plumber via NOPEN env variable
Diffstat:
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/TODO b/TODO
@@ -1 +0,0 @@
-- Support overriding plumber via environment variable
diff --git a/noice.1 b/noice.1
@@ -1,4 +1,4 @@
-.Dd August 2, 2019
+.Dd August 22, 2019
.Dt NOICE 1
.Os
.Sh NAME
@@ -117,6 +117,14 @@ environment variables take precedence when dealing with the
and
.Ic p
commands respectively.
+.Pp
+The
+.Ev NOPEN
+environment variable can be used to specify the plumber
+program used by
+.Nm .
+It defaults to
+.Xr nopen 1 .
.Sh KNOWN ISSUES
If you are using
.Xr urxvt 1
diff --git a/noice.c b/noice.c
@@ -650,10 +650,11 @@ nochange:
goto begin;
case S_IFREG:
exitcurses();
- r = spawnlp(path, NOPENCMD, NOPENCMD, newpath, (void *)0);
+ run = xgetenv("NOPEN", NOPENCMD);
+ r = spawnlp(path, run, run, newpath, (void *)0);
initcurses();
if (r == -1) {
- printmsg("failed to execute " NOPENCMD);
+ printmsg("Failed to execute plumber");
goto nochange;
}
continue;