- Option to open all text files in EDITOR
- Information
- Detailed file information
- - Media information (needs mediainfo/exiftool)
+ - Media information (using plugin)
- Convenience
- Minimal configuration
- Plugin keybinds
| xdg-open (Linux), open(1) (macOS), cygstart (Cygwin) | base | desktop opener |
| file, coreutils (cp, mv, rm), findutils (xargs) | base | file type, copy, move and remove |
| tar, (un)zip [atool/bsdtar for more formats] | base | create, list, extract tar, gzip, bzip2, zip |
-| mediainfo / exiftool | if needed | multimedia file details |
| sshfs, fusermount(3) | if needed | mount, unmount over SSHFS |
| trash-cli | optional | trash files (default action: delete) |
| vlock (Linux), bashlock (macOS), lock(1) (BSD) | optional | terminal locker (fallback: [cmatrix](https://github.com/abishekvashok/cmatrix)) |
#### Cmdline options
```
-usage: nnn [-b key] [-d] [-e] [-H] [-i] [-n] [-o]
- [-p file] [-r] [-s] [-S] [-t] [-v] [-h] [PATH]
+usage: nnn [-b key] [-d] [-H] [-i] [-n] [-o] [-p file]
+ [-r] [-s] [-S] [-t] [-v] [-h] [PATH]
The missing terminal file manager for X.
optional args:
-b key open bookmark key
-d detail mode
- -e use exiftool for media info
-H show hidden files
-i nav-as-you-type mode
-n version sort
K ^Y Toggle selection y List selection
P Copy selection X Delete selection
V Move selection ^X Delete entry
- f Create archive m M Brief/full mediainfo
+ f Create archive C Execute entry
^F Extract archive F List archive
e Edit in EDITOR p Open in PAGER
ORDER TOGGLES
^J du S Apparent du
s Size E Extn t Time modified
MISC
- ! ^] Shell L Lock C Execute entry
+ ! ^] Shell ^N Note L Lock
R ^V Pick plugin F12 xK Run plugin key K
c SSHFS mount u Unmount
- ^P Prompt ^N Note = Launcher
+ ^P Prompt = Launcher
```
-Note: Help & settings, file details, media info and archive listing are shown in the PAGER. Use the PAGER-specific keys in these screens.
+Note: Help & settings, file details and archive listing are shown in the PAGER. Use the PAGER-specific keys in these screens.
| Mouse click | Function |
|---| --- |
opts=(
-b
-d
- -e
-H
-i
-n
complete -c nnn -s b -r -d 'bookmark key to open'
complete -c nnn -s d -d 'start in detail mode'
-complete -c nnn -s e -d 'use exiftool instead of mediainfo'
complete -c nnn -s H -d 'show hidden files'
complete -c nnn -s i -d 'start in navigate-as-you-type mode'
complete -c nnn -s n -d 'use version compare to sort files'
args=(
'(-b)-b[bookmark key to open]:key char'
'(-d)-d[start in detail mode]'
- '(-e)-e[use exiftool instead of mediainfo]'
'(-H)-H[show hidden files]'
'(-i)-i[start in navigate-as-you-type mode]'
'(-n)-n[use version compare to sort files]'
.Nm
.Op Ar -b key
.Op Ar -d
-.Op Ar -e
.Op Ar -H
.Op Ar -i
.Op Ar -n
.Fl d
detail mode
.Pp
-.Fl e
- use exiftool instead of mediainfo
-.Pp
.Fl H
show hidden files
.Pp
| imgur | bash | - | Upload an image to imgur (from [imgur-screenshot](https://github.com/jomo/imgur-screenshot)) |
| ipinfo | sh | curl, whois | Fetch external IP address and whois information |
| kdeconnect | sh | kdeconnect-cli | Send selected files to an Android device |
+| mediainf | sh | mediainfo | Show media information |
| moclyrics | sh | [ddgr](https://github.com/jarun/ddgr), [moc](http://moc.daper.net/) | Show lyrics of the track playing in moc |
| mocplay | sh | [moc](http://moc.daper.net/) | Appends (and plays, see script) selection/dir/file in moc|
| ndiff | sh | vimdiff | Diff for selection (limited to 2 for directories) |
--- /dev/null
+#!/usr/bin/env sh
+
+# Description: Show media information of a file in pager
+#
+# Requires: mediainfo
+#
+# Shell: POSIX compliant
+# Author: Arun Prakash Jana
+
+if ! [ -z "$1" ] && [ -f "$1" ]; then
+ mediainfo "$1" | $PAGER
+ # exiftool "$1" | $PAGER
+fi
#endif
/* Macros for utilities */
-#define MEDIAINFO 0
-#define EXIFTOOL 1
-#define OPENER 2
-#define ATOOL 3
-#define BSDTAR 4
-#define UNZIP 5
-#define TAR 6
-#define LOCKER 7
-#define CMATRIX 8
-#define NLAUNCH 9
-#define UNKNOWN 10
+#define OPENER 0
+#define ATOOL 1
+#define BSDTAR 2
+#define UNZIP 3
+#define TAR 4
+#define LOCKER 5
+#define CMATRIX 6
+#define NLAUNCH 7
+#define UNKNOWN 8
/* Utilities to open files, run actions */
static char * const utils[] = {
- "mediainfo",
- "exiftool",
#ifdef __APPLE__
"/usr/bin/open",
#elif defined __CYGWIN__
return svb.f_bavail << ffs((int)(svb.f_frsize >> 1));
}
-static bool show_mediainfo(const char *fpath, const char *arg)
-{
- if (!getutil(utils[cfg.metaviewer]))
- return FALSE;
-
- exitcurses();
- get_output(NULL, 0, utils[cfg.metaviewer], fpath, arg, TRUE);
- refresh();
- return TRUE;
-}
-
/* List or extract archive */
static void handle_archive(char *fpath, const char *dir, char op)
{
"9K ^Y Toggle selection y List selection\n"
"cP Copy selection X Delete selection\n"
"cV Move selection ^X Delete entry\n"
- "cf Create archive m M Brief/full mediainfo\n"
+ "cf Create archive C Execute entry\n"
"b^F Extract archive F List archive\n"
"ce Edit in EDITOR p Open in PAGER\n"
"1ORDER TOGGLES\n"
"b^J du S Apparent du\n"
"cs Size E Extn t Time modified\n"
"1MISC\n"
- "9! ^] Shell L Lock C Execute entry\n"
+ "9! ^] Shell ^N Note L Lock \n"
"9R ^V Pick plugin F12 xK Run plugin key K\n"
"cc SSHFS mount u Unmount\n"
- "b^P Prompt ^N Note = Launcher\n"};
+ "b^P Prompt = Launcher\n"};
fd = create_tmp_file();
if (fd == -1)
goto nochange;
}
break;
- case SEL_MEDIA: // fallthrough
- case SEL_FMEDIA: // fallthrough
case SEL_ARCHIVELS: // fallthrough
case SEL_EXTRACT: // fallthrough
case SEL_RUNEDIT: // fallthrough
r = TRUE;
switch (sel) {
- case SEL_MEDIA: // fallthrough
- case SEL_FMEDIA:
- tmp = (sel == SEL_FMEDIA) ? "-f" : NULL;
- show_mediainfo(newpath, tmp);
- setdirwatch();
- goto nochange;
case SEL_ARCHIVELS:
handle_archive(newpath, path, 'l');
break;
static void usage(void)
{
fprintf(stdout,
- "%s: nnn [-b key] [-d] [-e] [-H] [-i] [-n] [-o]\n"
- " [-p file] [-r] [-s] [-S] [-t] [-v] [-h] [PATH]\n\n"
+ "%s: nnn [-b key] [-d] [-H] [-i] [-n] [-o] [-p file]\n"
+ " [-r] [-s] [-S] [-t] [-v] [-h] [PATH]\n\n"
"The missing terminal file manager for X.\n\n"
"positional args:\n"
" PATH start dir [default: current dir]\n\n"
"optional args:\n"
" -b key open bookmark key\n"
" -d detail mode\n"
- " -e use exiftool for media info\n"
" -H show hidden files\n"
" -i nav-as-you-type mode\n"
" -n version sort\n"
bool progress = FALSE;
#endif
- while ((opt = getopt(argc, argv, "HSib:denop:rstvh")) != -1) {
+ while ((opt = getopt(argc, argv, "HSib:dnop:rstvh")) != -1) {
switch (opt) {
case 'S':
cfg.blkorder = 1;
case 'b':
arg = optarg;
break;
- case 'e':
- cfg.metaviewer = EXIFTOOL;
- break;
case 'H':
cfg.showhidden = 1;
break;
SEL_TOGGLEDOT,
SEL_DETAIL,
SEL_STATS,
- SEL_MEDIA,
- SEL_FMEDIA,
SEL_ARCHIVE,
SEL_ARCHIVELS,
SEL_EXTRACT,
{ 'd', SEL_DETAIL },
/* File details */
{ 'D', SEL_STATS },
- /* Show media info short, run is hacked */
- { 'm', SEL_MEDIA },
- /* Show media info full, run is hacked */
- { 'M', SEL_FMEDIA },
/* Create archive */
{ 'f', SEL_ARCHIVE },
/* List archive */