From f95ee54870e2259e9384c6f5641cb6d374526a65 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Thu, 12 Dec 2019 00:56:39 +0530 Subject: Add plugin to show notification --- src/nnn.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/nnn.c b/src/nnn.c index 1e25bf8..7500d01 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -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(); -- cgit v1.2.3-70-g09d2