aboutsummaryrefslogtreecommitdiffstats
path: root/config.def.h
diff options
context:
space:
mode:
authorMartin Kühl <martin.kuehl@gmail.com>2015-11-20 16:42:33 +0100
committersin <sin@2f30.org>2015-11-26 13:37:03 +0000
commitd1ed0cff118a07327b3b237ea65836f5c673acbb (patch)
treeaf0753ee09bbf1d5e0edc9227566594f0eb7d328 /config.def.h
parentd1d086d91edd89e5a8edcc3349488b3ed89f8c9d (diff)
downloadnoice-d1ed0cff118a07327b3b237ea65836f5c673acbb.tar.gz
Support commands specified by environment variables
Specifying commands by name in config.h means that every time one switches ones editor (for example), one has to modify every config.h file referencing that editor and then recompile every corresponding program. This change adds a string `env` for specifying an environment variable to `struct key` and uses it to optionally specify the command to run on SEL_{RUN,RUNARG}. The `run` string is used as a fallback when the environment variable has not been specified or is not set. It also updates `config.def.h` to demonstrate this new capability.
Diffstat (limited to 'config.def.h')
-rw-r--r--config.def.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/config.def.h b/config.def.h
index 39c1799..beae17d 100644
--- a/config.def.h
+++ b/config.def.h
@@ -62,8 +62,9 @@ struct key bindings[] = {
{ 't', SEL_MTIME },
{ CONTROL('L'), SEL_REDRAW },
/* Run command */
- { '!', SEL_RUN, "sh" },
- { 'z', SEL_RUN, "top" },
+ { 'z', SEL_RUN, "top" },
+ { '!', SEL_RUN, "sh", "SHELL" },
/* Run command with argument */
- { 'e', SEL_RUNARG, "vi" },
+ { 'e', SEL_RUNARG, "vi", "EDITOR" },
+ { 'p', SEL_RUNARG, "less", "PAGER" },
};
Un proyecto texto-plano.xyz