]> Sergey Matveev's repositories - nnn.git/commitdiff
Operation completion notification
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 11 Dec 2019 17:23:03 +0000 (22:53 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 11 Dec 2019 17:23:03 +0000 (22:53 +0530)
README.md
src/nnn.c

index a67d3fa825f20846a53dc8b7b35a63ff02c1990f..346e4e7047af58a70a2200313cba2f4674c37bd6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -56,6 +56,7 @@ Add to that an awesome [Wiki](https://github.com/jarun/nnn/wiki)!
   - Detailed file information
   - Media information (using plugin)
 - Convenience
+  - Notification on cp, mv, rm completion (needs ntfy)
   - Run plugins and commands with custom keybinds
   - FreeDesktop compliant trash (needs trash-cli)
   - Cross-dir file/all/range selection
@@ -100,6 +101,7 @@ A curses library with wide char support (e.g. ncursesw), libreadline (`make O_NO
 | archivemount, fusermount(3) | optional | mount, unmount archives |
 | sshfs, [rclone](https://rclone.org/), fusermount(3) | optional | mount, unmount remotes |
 | trash-cli | optional | trash files (default action: rm) |
+| [ntfy](https://github.com/dschep/ntfy) | optional | operation completion notification |
 | vlock (Linux), bashlock (macOS), lock(1) (BSD) | optional | terminal locker (fallback: [cmatrix](https://github.com/abishekvashok/cmatrix)) |
 | advcpmv (Linux) ([integration](https://github.com/jarun/nnn/wiki/Advanced-use-cases#show-cp-mv-progress)) | optional | copy, move progress |
 | `$VISUAL` (else `$EDITOR`), `$PAGER`, `$SHELL` | optional | fallback vi, less, sh |
index 9ff6030d5dee6f3b7d5e5ed60f4df2670e46c8e3..1e25bf8ca51e34663c03f3045286dc51b7bcdae8 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
 #define CTX_MAX 4
 #define DOT_FILTER_LEN 7
 #define ASCII_MAX 128
-#define EXEC_ARGS_MAX 8
+#define EXEC_ARGS_MAX 10
 #define SCROLLOFF 3
 #define MIN_DISPLAY_COLS 10
 #define LONG_SIZE sizeof(ulong)
@@ -4972,6 +4972,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);
+
                        if (ndents)
                                copycurname();
                        goto begin;