- Desktop search (gnome-search-tool, catfish) integration
- Mimes
- Open with desktop opener (default) or specify a custom app
- - List and extract archives (needs atool)
+ - Create, list and extract archives (needs atool)
- Optionally open text files in EDITOR (fallback vi)
- Customizable bash script [nlay](https://github.com/jarun/nnn/wiki/all-about-nlay) to handle actions
- Information
e | Edit entry in EDITOR
o | Open DE filemanager
p | Open entry in PAGER
+ f | Archive entry
F | List archive
^F | Extract archive
^K | Copy file path
| xdg-open (Linux), open(1) (OS X) | desktop opener |
| mediainfo, exiftool | multimedia file details |
| gnome-search-tool, catfish | desktop search utility |
-| atool | list and extract archives |
+| atool | create, list and extract archives |
| vidir from moreutils | batch rename, move, delete dir entries |
| vlock (Linux) | terminal locker |
| $EDITOR ($VISUAL, if defined) | edit files (fallback vi) |
Open directory in NNN_DE_FILE_MANAGER
.It Ic p
Open current entry in PAGER (fallback less)
+.It Ic f
+Archive current entry
.It Ic F
List files in archive
.It Ic ^F
#define OPENER 2
#define NLAY 3
#define ATOOL 4
-#define VIDIR 5
+#define APACK 5
+#define VIDIR 6
/* Utilities to open files, run actions */
static char * const utils[] = {
#endif
"nlay",
"atool",
+ "apack",
"vidir"
};
"ee | Edit entry in EDITOR\n"
"eo | Open DE filemanager\n"
"ep | Open entry in PAGER\n"
+ "ef | Archive entry\n"
"eF | List archive\n"
"d^F | Extract archive\n"
"d^K | Copy file path\n"
goto nochange;
case SEL_OPEN:
printprompt("open with: "); // fallthrough
+ case SEL_ARCHIVE: // fallthrough
case SEL_NEW:
- if (sel == SEL_NEW)
+ if (sel != SEL_OPEN)
printprompt("name: ");
tmp = xreadline(NULL);
mkpath(path, dents[cur].name, newpath, PATH_MAX);
spawn(tmp, newpath, NULL, path, r);
+ continue;
+ } else if (sel == SEL_ARCHIVE) {
+ /* newpath is used as temporary buffer */
+ if (!get_output(newpath, PATH_MAX, "which", utils[APACK], NULL, 0)) {
+ printmsg("apack missing");
+ continue;
+ }
+ spawn(utils[APACK], tmp, dents[cur].name, path, F_NORMAL);
continue;
}
SEL_MEDIA,
SEL_FMEDIA,
SEL_DFB,
+ SEL_ARCHIVE,
SEL_LIST,
SEL_EXTRACT,
SEL_FSIZE,
{ 'M', SEL_FMEDIA, "-f", "" },
/* Open dir in desktop file manager */
{ 'o', SEL_DFB, "", "" },
+ /* Create archive */
+ { 'f', SEL_ARCHIVE, "", "" },
/* List archive */
{ 'F', SEL_LIST, "-l", "" },
/* Extract archive */