diff options
author | 2019-12-12 00:56:39 +0530 | |
---|---|---|
committer | 2019-12-12 07:24:22 +0530 | |
commit | f95ee54870e2259e9384c6f5641cb6d374526a65 (patch) | |
tree | b4e2007429edac90ef8a7fbb38ab0464e6adae53 /src | |
parent | b64df85d23ad186b036683b79db1c6aaf9da523b (diff) | |
download | nnn-f95ee54870e2259e9384c6f5641cb6d374526a65.tar.gz |
Add plugin to show notification
Diffstat (limited to 'src')
-rw-r--r-- | src/nnn.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -138,7 +138,7 @@ #define CTX_MAX 4 #define DOT_FILTER_LEN 7 #define ASCII_MAX 128 -#define EXEC_ARGS_MAX 10 +#define EXEC_ARGS_MAX 8 #define SCROLLOFF 3 #define MIN_DISPLAY_COLS 10 #define LONG_SIZE sizeof(ulong) @@ -379,6 +379,7 @@ static bool g_plinit = FALSE; #define UTIL_SH 14 #define UTIL_FZF 15 #define UTIL_FZY 16 +#define UTIL_NOTIFY 17 /* Utilities to open files, run actions */ static char * const utils[] = { @@ -411,6 +412,7 @@ static char * const utils[] = { "sh", "fzf", "fzy", + ".notify", }; /* Common strings */ @@ -4445,7 +4447,7 @@ nochange: /* If open file is disabled on right arrow or `l`, return */ if (cfg.nonavopen && sel == SEL_NAV_IN) - continue; + goto nochange; /* Handle plugin selection mode */ if (cfg.runplugin) { @@ -4972,8 +4974,9 @@ nochange: if (!cpmvrm_selection(sel, path, &presel)) goto nochange; - spawn("ntfy -l CRITICAL -t nnn send Done!", - NULL, NULL, NULL, F_NOWAIT | F_NOTRACE | F_MULTI); + /* Show notification on operation complete */ + mkpath(plugindir, utils[UTIL_NOTIFY], newpath); + spawn(newpath, NULL, NULL, NULL, F_NOWAIT | F_NOTRACE); if (ndents) copycurname(); |