nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 12ce9451ee1c24ad245d33e8944ba77a1108b5b2
parent a80ed0554dc677a26aca8a7a967cd60e1192edd4
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date:   Thu, 18 Apr 2019 19:41:39 +0530

Move nlaunch from user-scripts

Diffstat:
MREADME.md | 2+-
Ascripts/nlaunch/nlaunch | 20++++++++++++++++++++
Muser-scripts/README.md | 1-
Duser-scripts/nlaunch | 18------------------
4 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/README.md b/README.md @@ -196,7 +196,7 @@ Option completion scripts for Bash, Fish and Zsh can be found in respective subd 2. Configure [cd on quit](https://github.com/jarun/nnn/wiki/hacking-nnn#cd-on-quit). 3. Optionally open all text files in `$EDITOR` (fallback vi): `export NNN_USE_EDITOR=1` 4. Run `n`. -5. To use `nnn` as a GUI app launcher with fuzzy selection menu, drop [`nlaunch`](https://github.com/jarun/nnn/blob/master/user-scripts/nlaunch) somewhere in your `$PATH`. +5. To use `nnn` as a GUI app launcher with fuzzy selection menu, drop [`nlaunch`](https://github.com/jarun/nnn/blob/master/scripts/nlaunch/nlaunch) somewhere in your `$PATH`. Note that the launcher requires fzy. 6. Don't memorize keys. Arrows, <kbd>/</kbd> and <kbd>q</kbd> suffice. Press <kbd>?</kbd> for help on keyboard shortcuts anytime. - For additional functionality [setup custom scripts](#user-scripts). diff --git a/scripts/nlaunch/nlaunch b/scripts/nlaunch/nlaunch @@ -0,0 +1,20 @@ +#!/usr/bin/env sh + +# Description: Fuzzy find executables in $PATH and launch an application. +# stdin, stdout, stderr are suppressed so CLI utilities exit silently. +# Works as an independent app launcher. +# +# Requires fzy. +# +# Shell: POSIX compliant +# Author: Arun Prakash Jana + +IFS=':' + +get_selection() { + ls -H $PATH | sort | fzy +} + +if selection=$( get_selection ); then + "$selection" 2>/dev/null 1>/dev/null & +fi diff --git a/user-scripts/README.md b/user-scripts/README.md @@ -8,7 +8,6 @@ | imgur | bash | [imgur](https://github.com/jomo/imgur-screenshot) | Upload an image to imgur | | kdeconnect | sh | kdeconnect-cli | Send selected files to an Android device | | ndiff | sh | vimdiff | File and directory diff for selection | -| nlaunch | sh | fzy | Drop-down app launcher. Copy in `$PATH`; fallback regular prompt | | nwal | sh | nitrogen | Set the selected image as wallpaper using nitrogen | | paste | sh | [pastebinit](https://launchpad.net/pastebinit) | Paste contents of current (text) file to paste.ubuntu.com | | picker | sh | nnn | Pick files and pipe the newline-separated list to another utility | diff --git a/user-scripts/nlaunch b/user-scripts/nlaunch @@ -1,18 +0,0 @@ -#!/usr/bin/env sh - -# Description: Fuzzy find executables in $PATH and launch an application. -# stdin, stdout, stderr are suppressed so CLI utilities exit silently. -# Works as an independent app launcher. -# -# Shell: POSIX compliant -# Author: Arun Prakash Jana - -IFS=':' - -get_selection() { - ls -H $PATH | sort | fzy -} - -if selection=$( get_selection ); then - "$selection" 2>/dev/null 1>/dev/null & -fi