- copy absolute file path to clipboard, spawn a terminal and use the file path
- navigate instantly using shortcuts like `~`, `-`, `&` or handy bookmarks
- use `cd .....` at chdir prompt to go to a parent directory
-- see detailed file stats or mediainfo information
+- detailed file stats, media info, list and extract archives
- open a (supported) archive in vim to view its contents
- pin a directory you may need to revisit and jump to it anytime
- set timeout to lock the current terminal
- Invoke file path copier (*easy* shell integration)
- Change directory at exit (*easy* shell integration)
- Open any file in EDITOR (fallback vi) or PAGER (fallback less)
+ - List and extract archives (needs atool)
- Open current directory in a custom GUI file browser
- Monitor directory changes
- Terminal screensaver (default vlock, customizable) integration
export NNN_DE_FILE_MANAGER=thunar
export NNN_DE_FILE_MANAGER=nautilus
- [mediainfo](https://mediaarea.net/en/MediaInfo) (or exiftool, if specified) is required to view media information
+- [atool](http://www.nongnu.org/atool/) is required to list and extract archives
#### Help
Open directory in NNN_DE_FILE_MANAGER
.It Ic p
Open current entry in PAGER (fallback less)
+.It Ic f
+List files in archive
+.It Ic ^X
+Extract archive in current directory
.It Ic ^K
Invoke file path copier
.It Ic ^L
#else
"/usr/bin/xdg-open",
#endif
- "nlay"
+ "nlay",
+ "atool"
};
/* Common message strings */
return 0;
}
+static int
+handle_archive(char *fpath, char *arg, char *dir)
+{
+ if (!get_output(g_buf, MAX_CMD_LEN, "which", utils[4], NULL, 0))
+ return -1;
+
+ if (arg[1] == 'x')
+ spawn(utils[4], arg, fpath, dir, F_NORMAL);
+ else {
+ exitcurses();
+ get_output(NULL, 0, utils[4], arg, fpath, 1);
+ initcurses();
+ }
+
+ return 0;
+}
+
/*
* The help string tokens (each line) start with a HEX value
* which indicates the number of spaces to print before the
"ee | Edit entry in EDITOR\n"
"eo | Open dir in file manager\n"
"ep | Open entry in PAGER\n"
+ "ef | List archive\n"
+ "d^X | Extract archive\n"
"d^K | Invoke file path copier\n"
"d^L | Redraw, clear prompt\n"
"e? | Help, settings\n"
}
}
break;
+ case SEL_LIST: // fallthrough
+ case SEL_EXTRACT: // fallthrough
case SEL_MEDIA: // fallthrough
case SEL_FMEDIA:
if (ndents > 0) {
mkpath(path, dents[cur].name, oldpath, PATH_MAX);
- if (show_mediainfo(oldpath, run) == -1) {
- sprintf(g_buf, "%s missing", utils[cfg.metaviewer]);
+ if (sel == SEL_MEDIA || sel == SEL_FMEDIA)
+ r = show_mediainfo(oldpath, run);
+ else
+ r = handle_archive(oldpath, run, path);
+
+ if (r == -1) {
+ if (sel == SEL_MEDIA || sel == SEL_FMEDIA)
+ sprintf(g_buf, "%s missing", utils[cfg.metaviewer]);
+ else
+ sprintf(g_buf, "%s missing", utils[4]);
+
printmsg(g_buf);
goto nochange;
}
SEL_MEDIA,
SEL_FMEDIA,
SEL_DFB,
+ SEL_LIST,
+ SEL_EXTRACT,
SEL_FSIZE,
SEL_BSIZE,
SEL_MTIME,
struct key {
int sym; /* Key pressed */
enum action act; /* Action */
- char *run; /* Program to run */
+ char *run; /* Program to run or program option */
char *env; /* Environment variable to run */
};
{ 'M', SEL_FMEDIA, "-f", "" },
/* Open dir in desktop file manager */
{ 'o', SEL_DFB, "", "" },
+ /* List archive */
+ { 'f', SEL_LIST, "-l", "" },
+ /* Extract archive */
+ { CONTROL('X'), SEL_EXTRACT, "-x", "" },
/* Toggle sort by size */
{ 's', SEL_FSIZE, "", "" },
/* Sort by total block count including dir contents */