Makefile | 10 +++------- README.md | 5 +---- nlay => scripts/nlay/nlay | 0 nlay.1 => scripts/nlay/nlay.1 | 0 nnn.1 | 13 +------------ nnn.c | 33 +++++++++++++++------------------ scripts/auto-completion/bash/nnn-completion.bash | 2 -- scripts/auto-completion/fish/nnn.fish | 1 - scripts/auto-completion/zsh/_nnn | 1 - diff --git a/Makefile b/Makefile index 60fa49efa5fa60faca13cfe70cb1e37a336b53a0..12769c613a8761c59cee0f1f7d3bb743005d0c12 100644 --- a/Makefile +++ b/Makefile @@ -16,12 +16,11 @@ else LDLIBS += -lncurses endif -DISTFILES = nlay nlay.1 nnn.c nnn.h nnn.1 Makefile README.md LICENSE +DISTFILES = nnn.c nnn.h nnn.1 Makefile README.md LICENSE SRC = nnn.c BIN = nnn -PLAYER = nlay -all: $(BIN) $(PLAYER) +all: $(BIN) $(SRC): nnn.h @@ -33,16 +32,13 @@ $(CC) -DDEBUGMODE -g $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS) install: all $(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin - $(INSTALL) -m 0755 $(BIN) $(PLAYER) $(DESTDIR)$(PREFIX)/bin + $(INSTALL) -m 0755 $(BIN) $(DESTDIR)$(PREFIX)/bin $(INSTALL) -m 0755 -d $(DESTDIR)$(MANPREFIX)/man1 $(INSTALL) -m 0644 $(BIN).1 $(DESTDIR)$(MANPREFIX)/man1 - $(INSTALL) -m 0644 $(PLAYER).1 $(DESTDIR)$(MANPREFIX)/man1 uninstall: $(RM) $(DESTDIR)$(PREFIX)/bin/$(BIN) - $(RM) $(DESTDIR)$(PREFIX)/bin/$(PLAYER) $(RM) $(DESTDIR)$(MANPREFIX)/man1/$(BIN).1 - $(RM) $(DESTDIR)$(MANPREFIX)/man1/$(PLAYER).1 strip: $(BIN) $(STRIP) $^ diff --git a/README.md b/README.md index 973dfbbab9b4f31fed4527c923a7c88f49ca3abd..d443b7dc114745968e30b2881da25a6da6f2ae67 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ #### Cmdline options ``` usage: nnn [-b key] [-c N] [-e] [-i] [-l] - [-p nlay] [-S] [-v] [-h] [PATH] + [-S] [-v] [-h] [PATH] The missing terminal file manager for X. @@ -197,7 +197,6 @@ -c N dir color, disables if N>7 -e use exiftool instead of mediainfo -i start in navigate-as-you-type mode -l start in light mode - -p nlay path to custom nlay -S start in disk usage analyser mode -v show program version -h show this help @@ -345,8 +344,6 @@ - To edit all text files in EDITOR (preferably CLI, fallback vi): export NNN_USE_EDITOR=1 - -Customizable script [nlay](https://github.com/jarun/nnn/wiki/all-about-nlay) is used to run terminal locker. #### Help diff --git a/nlay b/scripts/nlay/nlay rename from nlay rename to scripts/nlay/nlay diff --git a/nlay.1 b/scripts/nlay/nlay.1 rename from nlay.1 rename to scripts/nlay/nlay.1 diff --git a/nnn.1 b/nnn.1 index f3b2636e89ec8fc2f6efc1b3b20fc8952595070d..82b47329e7937f4581f94529121601810ea57855 100644 --- a/nnn.1 +++ b/nnn.1 @@ -11,7 +11,6 @@ .Op Ar -c N .Op Ar -e .Op Ar -i .Op Ar -l -.Op Ar -p nlay .Op Ar -S .Op Ar -v .Op Ar -h @@ -152,9 +151,6 @@ .Pp .Fl l start in light mode (fewer details) .Pp -.Fl "p nlay" - path to custom nlay -.Pp .Fl S start in disk usage analyzer mode .Pp @@ -165,14 +161,7 @@ .Fl h show program help and exit .Sh CONFIGURATION .Nm -uses \fIxdg-open\fR (on Linux) and \fIopen(1)\fR (on OS X) as the desktop -opener. It invokes -.Pa nlay -to run the terminal locker. Read more on -.Pa nlay -at: -.br -.Em https://github.com/jarun/nnn/wiki/all-about-nlay +uses \fIxdg-open\fR (on Linux) and \fIopen(1)\fR (on OS X) as the desktop opener. .Pp There is no configuration file. Settings work on environment variables. Please refer to the ENVIRONMENT section below. diff --git a/nnn.c b/nnn.c index efce9b319dbc03f7d7bddffa3830890006f8fded..575f91d5df22c5ee2d0049951db2f0239e8d2688 100644 --- a/nnn.c +++ b/nnn.c @@ -284,7 +284,6 @@ static char *pnamebuf, *pcopybuf; static int ndents, cur, total_dents = ENTRY_INCR; static uint idle; static uint idletimeout, copybufpos, copybuflen; -static char *player; static char *copier; static char *editor; static blkcnt_t ent_blocks; @@ -322,10 +321,10 @@ /* Macros for utilities */ #define MEDIAINFO 0 #define EXIFTOOL 1 #define OPENER 2 -#define NLAY 3 -#define ATOOL 4 -#define APACK 5 -#define VIDIR 6 +#define ATOOL 3 +#define APACK 4 +#define VIDIR 5 +#define LOCKER 6 #define UNKNOWN 7 /* Utilities to open files, run actions */ @@ -339,10 +338,16 @@ "cygstart", #else "xdg-open", #endif - "nlay", "atool", "apack", "vidir", +#ifdef __APPLE__ + "bashlock", +#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) + "lock", +#else + "vlock", +#endif "UNKNOWN" }; @@ -3282,7 +3287,7 @@ run = editor ? editor : xgetenv("EDITOR", "vi"); spawn(run, dents[cur].name, NULL, path, F_NORMAL); break; case SEL_LOCK: - spawn(player, "", "screensaver", NULL, F_NORMAL | F_SIGINT); + spawn(utils[LOCKER], NULL, NULL, NULL, F_NORMAL | F_SIGINT); break; case SEL_QUITCTX: { @@ -3337,7 +3342,7 @@ /* Screensaver */ if (idletimeout != 0 && idle == idletimeout) { idle = 0; - spawn(player, "", "screensaver", NULL, F_NORMAL | F_SIGINT); + spawn(utils[LOCKER], NULL, NULL, NULL, F_NORMAL | F_SIGINT); } } } @@ -3346,7 +3351,7 @@ static void usage(void) { fprintf(stdout, "usage: nnn [-b key] [-c N] [-e] [-i] [-l]\n" - " [-p nlay] [-S] [-v] [-h] [PATH]\n\n" + " [-S] [-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" @@ -3356,7 +3361,6 @@ " -c N dir color, disables if N>7\n" " -e use exiftool instead of mediainfo\n" " -i start in navigate-as-you-type mode\n" " -l start in light mode\n" - " -p nlay path to custom nlay\n" " -S start in disk usage analyser mode\n" " -v show program version\n" " -h show this help\n\n" @@ -3376,7 +3380,7 @@ fprintf(stderr, "stdin or stdout is not a tty\n"); exit(1); } - while ((opt = getopt(argc, argv, "Slib:c:ep:vh")) != -1) { + while ((opt = getopt(argc, argv, "Slib:c:evh")) != -1) { switch (opt) { case 'S': cfg.blkorder = 1; @@ -3400,9 +3404,6 @@ cfg.color = (uchar)atoi(optarg); break; case 'e': cfg.metaviewer = EXIFTOOL; - break; - case 'p': - player = optarg; break; case 'v': fprintf(stdout, "%s\n", VERSION); @@ -3463,10 +3464,6 @@ editor = xgetenv("VISUAL", NULL); if (!editor) editor = xgetenv("EDITOR", "vi"); } - - /* Set player if not set already */ - if (!player) - player = utils[NLAY]; /* Get screensaver wait time, if set; copier used as tmp var */ copier = getenv("NNN_IDLE_TIMEOUT"); diff --git a/scripts/auto-completion/bash/nnn-completion.bash b/scripts/auto-completion/bash/nnn-completion.bash index b16b2967d4273a72ecc8043aab606f544a5d9590..6eaba968ee7fcb410e67dd9a0bae25674fece518 100644 --- a/scripts/auto-completion/bash/nnn-completion.bash +++ b/scripts/auto-completion/bash/nnn-completion.bash @@ -16,13 +16,11 @@ -e -h -i -l - -p -S -v ) opts_with_arg=( -c - -p ) # Do not complete non option names diff --git a/scripts/auto-completion/fish/nnn.fish b/scripts/auto-completion/fish/nnn.fish index 2eebc4890b359564af54bdd27b80ee9a69183515..47c9f8ecb659bad591de0a5660c411aa68909ca6 100644 --- a/scripts/auto-completion/fish/nnn.fish +++ b/scripts/auto-completion/fish/nnn.fish @@ -10,6 +10,5 @@ complete -c nnn -s e -d 'use exiftool instead of mediainfo' complete -c nnn -s h -d 'show this help and exit' complete -c nnn -s i -d 'start in navigate-as-you-type mode' complete -c nnn -s l -d 'start in light mode (fewer details)' -complete -c nnn -s p -r -d 'specify custom nlay' complete -c nnn -s S -d 'start in disk usage analyzer mode' complete -c nnn -s v -d 'show program version and exit' diff --git a/scripts/auto-completion/zsh/_nnn b/scripts/auto-completion/zsh/_nnn index 3ccfeb7d948a87235cc99bb9245dc4be8af45bc1..746dc415b62b75b364e37d52b3233b594a96d708 100644 --- a/scripts/auto-completion/zsh/_nnn +++ b/scripts/auto-completion/zsh/_nnn @@ -14,7 +14,6 @@ '(-e)-e[use exiftool instead of mediainfo]' '(-h)-h[show this help and exit]' '(-i)-i[start in navigate-as-you-type mode]' '(-l)-l[start in light mode (fewer details)]' - '(-p)-p[specify custom nlay]:path to nlay' '(-S)-S[start in disk usage analyzer mode]' '(-v)-v[show program version and exit]' '*:filename:_files'