plugins/autojump | 7 ++++--- plugins/bookmarks | 3 +-- plugins/boom | 7 +++++-- plugins/bulknew | 4 ++-- plugins/chksum | 11 ++++++----- plugins/diffs | 9 +++++---- plugins/dragdrop | 10 +++++----- plugins/dups | 12 ++++++------ plugins/fzhist | 6 ++++-- plugins/fzplug | 29 ++++++++++++++++++----------- plugins/gpgd | 6 ++++-- plugins/gpge | 8 +++++--- plugins/hexview | 1 + plugins/imgresize | 15 ++++++++------- plugins/imgthumb | 2 ++ plugins/imgur | 2 +- plugins/imgview | 8 +++++--- plugins/kdeconnect | 3 ++- plugins/moclyrics | 1 + plugins/mocplay | 6 +++--- plugins/mp3conv | 2 +- plugins/mtpmount | 4 ++-- plugins/nmount | 12 +++++++----- plugins/nuke | 4 +--- plugins/pdfview | 4 ++-- plugins/preview-tabbed | 47 ++++++++++++++++++++++------------------------- plugins/preview-tui | 44 +++++++++++++++++++++----------------------- plugins/renamer | 10 +++++----- plugins/uidgid | 1 - plugins/unmount-parent | 14 +++++++++----- plugins/upgrade | 2 +- plugins/upload | 2 ++ plugins/vidthumb | 4 ++-- plugins/wall | 3 ++- plugins/x2sel | 22 +++++++++++----------- plugins/xdgdefault | 10 +++++----- diff --git a/plugins/autojump b/plugins/autojump index dc840628038380d37cc1a3ce05088c7e94e0ae1c..19c6548ef71a4b0ecec8878b28537797056a8f6c 100755 --- a/plugins/autojump +++ b/plugins/autojump @@ -2,9 +2,10 @@ #!/usr/bin/env sh # Description: Navigate to directory using jump/autojump/zoxide # -# Dependencies: jump - https://github.com/gsamokovarov/jump -# OR autojump - https://github.com/wting/autojump -# OR zoxide - https://github.com/ajeetdsouza/zoxide +# Dependencies: +# - jump - https://github.com/gsamokovarov/jump +# - OR autojump - https://github.com/wting/autojump +# - OR zoxide - https://github.com/ajeetdsouza/zoxide # # Note: The dependencies STORE NAVIGATION PATTERNS # diff --git a/plugins/bookmarks b/plugins/bookmarks index 1bb3503df0836bb3cfd7c2012139b2087dd9d566..8cb3ea24eec73ac14f0cfa185aedc7d5c429ba50 100755 --- a/plugins/bookmarks +++ b/plugins/bookmarks @@ -7,7 +7,6 @@ # # Usage: # 1. Create a $BOOKMARKS_DIR directory # By default, $BOOKMARKS_DIR is set to: ${XDG_CACHE_HOME:-$HOME/.cache}/nnn/bookmarks -# # 2. Create symlinks to directories # `cd $BOOKMARKS_DIR` # `ln -s /path/to/useful/directory bookmark_name` @@ -20,7 +19,7 @@ # Bonus tip: Add `$BOOKMARKS_DIR` to your `$CDPATH` # https://linux.101hacks.com/cd-command/cdpath/ # # TODO: -# 1. Remove `fzf` dependency +# - Remove `fzf` dependency # # Shell: POSIX compliant # Author: Todd Yamakawa diff --git a/plugins/boom b/plugins/boom index 39da84c2c9c5f1b6cab1481a7e1f025c7452a147..77bb1b8c8401cb3d81d3470f7db9449ffcb2cd82 100755 --- a/plugins/boom +++ b/plugins/boom @@ -1,7 +1,10 @@ #!/usr/bin/env sh -# Description: Play random music from current directory. Identifies MP3, FLAC, M4A, WEBM, WMA. -# You may want to set GUIPLAYER. +# Description: Play random music (MP3, FLAC, M4A, WEBM, WMA) from current dir. +# +# Dependencies: mocp (or custom) +# +# Note: You may want to set GUIPLAYER. # # Shell: POSIX compliant # Author: Arun Prakash Jana diff --git a/plugins/bulknew b/plugins/bulknew index 4010662d0997a19c5ec7d0ab42a4c9bef2db7a22..64331e47b60e7716645543748fb1ca2de60e80dc 100755 --- a/plugins/bulknew +++ b/plugins/bulknew @@ -1,7 +1,7 @@ #!/usr/bin/env sh -# Description: Allows for creation of multiple files/directories at the same time. -# Plugin opens a temp file where each entry is to be written on a separate line +# Description: Allows for creation of multiple files/dirs simultaneously +# Creates a tmp file to write each entry in a separate line # # Note: Only relative paths are supported. Absolute paths are ignored # Leading and trailing whitespace in path names is also ignored diff --git a/plugins/chksum b/plugins/chksum index 97f0cf0a145f549d6ae7d6cb6163964cde60b5e4..318f1c8b346febf427039d0455af09be2c92b1d9 100755 --- a/plugins/chksum +++ b/plugins/chksum @@ -2,13 +2,14 @@ #!/usr/bin/env sh # Description: Create and verify checksums # -# For selection: it will generate one file containing the checksums with file names -# [and with paths if they are in another directory] -# the output checksum filename will be checksum_timestamp.checksum_type -# For file: if the file is a checksum, the plugin does the verification +# Details: +# - selection: it will generate one file with the checksums and filenames +# (and with paths if they are in another directory) +# output checksum filename format: checksum_timestamp.checksum_type +# - file: if the file is a checksum, the plugin does the verification # if the file is not a checksum, checksum will be generated for it # the output checksum filename will be filename.checksum_type -# For directory: recursively calculates checksum for all the files in the directory +# - directory: recursively calculates checksum for all the files in the dir # the output checksum filename will be directory.checksum_type # # Shell: POSIX compliant diff --git a/plugins/diffs b/plugins/diffs index 1028f4e7a7d945031356b2fb2f0ed99dc4849749..0464781b31aa00a3938919e951e7a18b2ae758ca 100755 --- a/plugins/diffs +++ b/plugins/diffs @@ -2,10 +2,11 @@ #!/usr/bin/env sh # Description: Show diff of 2 directories or multiple files in vimdiff # -# Note: 1. vim may show the warning: 'Vim: Warning: Input is not from a terminal' -# press 'Enter' to ignore and proceed. -# 2. if only one file is in selection, the hovered file is considered as the -# second file to diff with +# Notes: +# 1. vim may show the warning: 'Vim: Warning: Input is not from a terminal' +# press 'Enter' to ignore and proceed. +# 2. if only one file is in selection, the hovered file is considered as the +# second file to diff with # # Shell: POSIX compliant # Authors: Arun Prakash Jana, ath3 diff --git a/plugins/dragdrop b/plugins/dragdrop index ef352da7b7c924d7e0264c94e03a468b5c05c65c..6ecb5c8d635fbc6b89069e01f76ac97f424b3df5 100755 --- a/plugins/dragdrop +++ b/plugins/dragdrop @@ -3,13 +3,13 @@ # Description: Open a Drag and drop window, to drop files onto other programs. # Also provides drag and drop window for files. # -# Dependencies: https://github.com/mwh/dragon +# Dependencies: dragon - https://github.com/mwh/dragon # # Notes: -# - Files that are dropped will be added to nnn's selection -# Some webbased files will be downloaded to current directory with curl -# and it may overwrite some existing files -# - The user has to mm to clear nnn's selection first +# 1. Files that are dropped will be added to nnn's selection +# Some web-based files will be downloaded to current dir +# with curl and it may overwrite some existing files +# 2. The user has to mm to clear nnn's selection first # # Shell: POSIX compliant # Author: 0xACE diff --git a/plugins/dups b/plugins/dups index 98e8f72751e0213f3d98a77d6f77619d6ac910b9..c87757e74fb65e6958cfb17cb792e8ccbea7edd9 100755 --- a/plugins/dups +++ b/plugins/dups @@ -1,18 +1,18 @@ #!/usr/bin/env sh -# Description: List non-empty duplicate files in the current directory (based on size followed by MD5) +# Description: List non-empty duplicates in the current dir (based on size followed by MD5) # # Source: https://www.commandlinefu.com/commands/view/3555/find-duplicate-files-based-on-size-first-then-md5-hash # # Dependencies: find md5sum sort uniq xargs gsed # -# Note: bash compatible required for mktemp +# Notes: +# 1. If the file size exceeds $size_digits digits the file will be misplaced +# 12 digits fit files up to 931GiB +# 2. bash compatible required for mktemp # -# Shell: bash +# Shell: Bash # Authors: syssyphus, KlzXS - -# If the size of a file has more that $size_digits digits the file will be misplaced -# 12 digits fit files up to 931GiB EDITOR="${EDITOR:-vi}" TMPDIR="${TMPDIR:-/tmp}" diff --git a/plugins/fzhist b/plugins/fzhist index 2a801f08261cf11aa320c1a37b1c9886e6710976..91b47393ac6f346e09ec6e62c0b0a75cfe70fd20 100755 --- a/plugins/fzhist +++ b/plugins/fzhist @@ -1,7 +1,9 @@ #!/usr/bin/env sh -# Description: Fuzzy find a command from history, edit in $EDITOR and run as a command -# Currently supports only bash and fish history +# Description: Fuzzy find a command from history, +# edit in $EDITOR and run as a command +# +# Note: Supports only bash and fish history # # Shell: POSIX compliant # Author: Arun Prakash Jana diff --git a/plugins/fzplug b/plugins/fzplug index e7993455066da95c3638b7bddd0bf5c353f09c0b..c2ad762211f303fa0b6750ab211a768757e9a5f1 100755 --- a/plugins/fzplug +++ b/plugins/fzplug @@ -1,21 +1,27 @@ #!/usr/bin/env sh -# Description: Fuzzy find and execute nnn plugins (and, optionally, custom scripts located elsewhere). -# Description and details of plugins can be previewed from the fzf interface. Use `?` to toggle preview -# pane on and off, ^Up/^Dn to scroll. +# Description: Fuzzy find and execute nnn plugins (and optionally, +# custom scripts located elsewhere). +# Description and details of plugins can be previewed +# from the fzf interface. Use `?` to toggle preview +# pane on and off, ^Up/^Dn to scroll. +# +# Dependencies: find, fzf, cat (or bat, if installed) # -# For better compatibility with as many nnn plugins as possible, fzplug will first execute -# the chosen script on the file hovered in nnn, and upon failure, try to run it with no target -# (i.e on an active selection, if present). +# Note: For better compatibility with as many nnn plugins as possible, +# fzplug will first execute the chosen script on the file hovered +# in nnn, and upon failure, try to run it with no target (i.e on +# an active selection, if present). # -# Dependencies: find, fzf, cat (or bat, if installed) # Shell: POSIX compliant # Author: Kabouik # Optional scripts sources -# Leave blank or fill with the absolute path of a folder containing executable scripts other than nnn plugins -# (e.g., "$HOME/.local/share/nautilus/scripts", since there are numerous Nautilus script git repositories). -# Add extra variables if need be, but be sure to call them in the find command below at lines 27 and 33. +# Leave blank or fill with the absolute path of a folder containing executable +# scripts other than nnn plugins (e.g., "$HOME/.local/share/nautilus/scripts", +# since there are numerous Nautilus script git repositories). +# Add extra variables if needed, make sure you call them in the find command. + #CUSTOMDIR1="$HOME/.local/share/nautilus/scripts" CUSTOMDIR1="" CUSTOMDIR2="" @@ -38,7 +44,8 @@ --preview-window right:66% --delimiter / --with-nth -1 \ --bind="?:toggle-preview") fi -# Try running the script on the hovered file, and abort if no plugin was selected (ESC or ^C pressed), +# Try running the script on the hovered file, and abort +# abort if no plugin was selected (ESC or ^C pressed). err=0 if ! [ "$plugin" = "" ]; then "$plugin" "$1" || err=1 diff --git a/plugins/gpgd b/plugins/gpgd index 7f1dba2e1d589dc32456c6838e482cfdad07c423..44d5c0f4dc386c870b53ee932e219dda96e8fc98 100755 --- a/plugins/gpgd +++ b/plugins/gpgd @@ -1,8 +1,10 @@ #!/usr/bin/env sh -# Description: Decrypts selected files using gpg. The contents of the decrypted file are stored in a file with extension .dec +# Description: Decrypts selected files using gpg. The contents of the +# decrypted file are stored in a file with extension .dec # -# Note: If an appropriate private key cannot be found gpg silently prints a message in the background and no files are written. +# Note: If an appropriate private key cannot be found gpg silently +# prints a message in the background and no files are written. # # Shell: POSIX compliant # Author: KlzXS diff --git a/plugins/gpge b/plugins/gpge index ba935ab6215c61a363266dac40f6031166d93107..69016a9dd92ff5a558b4eb3e82e36d7e5f3346f8 100755 --- a/plugins/gpge +++ b/plugins/gpge @@ -1,9 +1,11 @@ #!/usr/bin/env sh -# Description: Encrypts selected files using gpg. Can encrypt either asymmetrically (key) or symmetrically (passphrase). -# If asymmetric encryption is chosen a key can be chosen from the list of capable public keys using fzf. +# Description: Encrypts selected files using gpg. Can encrypt +# asymmetrically (key) or symmetrically (passphrase). +# If asymmetric encryption is chosen a key can be +# chosen from the list of capable public keys using fzf. # -# Note: symmetric encryption only works for a single (current) file as per gpg limitations +# Note: Symmetric encryption only works for a single (current) file as per gpg limitations # # Shell: POSIX compliant # Author: KlzXS diff --git a/plugins/hexview b/plugins/hexview index ad6e97fac47089be148f5f71ab03c8fe5dc2b35a..cb1006dfa411669d6ff145b7abd7794d114e8a81 100755 --- a/plugins/hexview +++ b/plugins/hexview @@ -1,6 +1,7 @@ #!/usr/bin/env sh # Description: View a file in hex +# # Dependencies: hx (https://github.com/krpors/hx)/xxd and $PAGER # # Shell: POSIX compliant diff --git a/plugins/imgresize b/plugins/imgresize index f04a883b5befb824f65c6ec19584b7661f3a9c2d..351fe7126198eadef8e5c144035dd2f6c5045523 100755 --- a/plugins/imgresize +++ b/plugins/imgresize @@ -1,15 +1,16 @@ #!/usr/bin/env sh # Description: Resize images in a directory to screen resolution with imgp -# imgp homepage: https://github.com/jarun/imgp +# +# Dependencipes: imgp - https://github.com/jarun/imgp # # Notes: -# 1. Set res if you don't want to be prompted for desktop resolution every time -# 2. MINSIZE is set to 1MB by default, adjust it if you want -# 3. imgp options used: -# a - adaptive mode -# c - convert PNG to JPG -# k - skip images matching specified hres/vres +# 1. Set res to avoid the desktop resolution prompt each time +# 2. MINSIZE is set to 1MB by default, adjust it if you want +# 3. imgp options used: +# a - adaptive mode +# c - convert PNG to JPG +# k - skip images matching specified hres/vres # # Shell: POSIX compliant # Author: Arun Prakash Jana diff --git a/plugins/imgthumb b/plugins/imgthumb index 8e217077347ba4c52f166e25676c9ca18785ce88..a47f661bf95f10a5f52e43e910c68ae1f6eb7af8 100755 --- a/plugins/imgthumb +++ b/plugins/imgthumb @@ -2,6 +2,8 @@ #!/usr/bin/env sh # Description: View thumbnail of an image or a directory of images with lsix # +# Dependencies: lsix +# # Shell: POSIX compliant # Author: Arun Prakash Jana diff --git a/plugins/imgur b/plugins/imgur index c6a46ae1f681de52c83f8f1cd91349e0075ba87f..4aa7a65ee9076f7ab24eedac5ce4f4131a211e53 100755 --- a/plugins/imgur +++ b/plugins/imgur @@ -32,7 +32,7 @@ # https://imgur.com/tools # # Slightly modified for `nnn` integration # -# Shell: bash +# Shell: Bash # Description: Upload an image file to imgur if [ "${1}" = "--debug" ]; then diff --git a/plugins/imgview b/plugins/imgview index 9a3083229af54e1da4a58e74e3192d0bd092126d..667bcca71b3019b72659df4af93a78c59eb018dc 100755 --- a/plugins/imgview +++ b/plugins/imgview @@ -2,9 +2,11 @@ #!/usr/bin/env sh # Description: Open images in hovered directory and thumbnails # open hovered image in sxiv or viu and browse other images in the directory -# Dependencies: imv (https://github.com/eXeC64/imv) or, -# sxiv (https://github.com/muennich/sxiv) or, -# viu (https://github.com/atanunq/viu), less +# +# Dependencies: +# - imv (https://github.com/eXeC64/imv) or, +# - sxiv (https://github.com/muennich/sxiv) or, +# - viu (https://github.com/atanunq/viu), less # # Shell: POSIX compliant # Author: Arun Prakash Jana diff --git a/plugins/kdeconnect b/plugins/kdeconnect index 9bef7dfd6ff2b695e21a8cc14adb0a33a91fa525..5f63d8bc8f45f077b344359c581fb17441bd2873 100755 --- a/plugins/kdeconnect +++ b/plugins/kdeconnect @@ -1,6 +1,7 @@ #!/usr/bin/env sh -# Description: Send the selected files to your Android device using kdeconnect-cli. You must have installed and configured kdeconnect both on the Android device and on the PC. +# Description: Send the selected files to your Android device using kdeconnect-cli. +# kdeconnect must be configured on the Android device and the PC. # # Shell: POSIX compliant # Author: juacq97 diff --git a/plugins/moclyrics b/plugins/moclyrics index 0dc3cd79f66b02d94cbb68e3d26f401e9226575f..2f698070cd7d04d4f8374c0b48f5e3a985368d4e 100755 --- a/plugins/moclyrics +++ b/plugins/moclyrics @@ -1,6 +1,7 @@ #!/usr/bin/env sh # Description: Fetches the lyrics of the track currently playing in MOC +# # Dependencies: ddgr (https://github.com/jarun/ddgr) # # Shell: POSIX compliant diff --git a/plugins/mocplay b/plugins/mocplay index dbda0d3c81f5d843a1b9ed6cad3088ab266415ba..038ecc9259a0c92a17d58c7fe3ff1c18f1b6f36c 100755 --- a/plugins/mocplay +++ b/plugins/mocplay @@ -3,9 +3,9 @@ # Description: Appends and optionally plays music in MOC # # Notes: -# - if selection is available, plays it, else plays the current file or directory -# - appends tracks and exits is MOC is running, else clears playlist and adds tracks -# - to let mocp shuffle tracks, set SHUFFLE=1 +# - if selection is available, plays it, else plays the current file or directory +# - appends tracks and exits is MOC is running, else clears playlist and adds tracks +# - to let mocp shuffle tracks, set SHUFFLE=1 # # Shell: POSIX compliant # Authors: Arun Prakash Jana, ath3 diff --git a/plugins/mp3conv b/plugins/mp3conv index b582cbca0dc6dd2389d07fa05795e865e416f51d..029f5445760fc037bfe1b2e03d86c8a013407711 100755 --- a/plugins/mp3conv +++ b/plugins/mp3conv @@ -2,7 +2,7 @@ #!/usr/bin/env sh # Description: Extract audio from multimedia files and convert to mp3 # -# Dependency: ffmpeg compiled with libmp3lame audio codec support +# Dependencies: ffmpeg compiled with libmp3lame audio codec support # # Shell: POSIX compliant # Author: Arun Prakash Jana diff --git a/plugins/mtpmount b/plugins/mtpmount index a295ea073c877d9ebaca4e4fbb746130a0af0950..d6feea064e4a1afd7f18215a020e716498760c56 100755 --- a/plugins/mtpmount +++ b/plugins/mtpmount @@ -5,6 +5,8 @@ # 'l' to list mountable devices # 'n' integer associated to device to mount # 'q'/'Return' exit # +# Dependencies: gvfs-mtp +# # Notes: The MTP device should be mounted at /run/user/$UID/gvfs. # Put /run/user/$UID/gvfs to bookmark entries (NNN_BMS) for faster access. # Make sure the device is unlocked when mounting. @@ -13,8 +15,6 @@ # When doing copy-paste into MTP device, you will get an error like this: # cp: preserving times for './gambar1.png': Operation not supported # That just means the file is copied but timestamp won't be preserved. # It's like doing `cp -p localfile.txt file-to-SMB.txt`. -# -# Dependencies: gvfs-mtp # # Shell: POSIX compliant # Author: Benawi Adha diff --git a/plugins/nmount b/plugins/nmount index 460f8b487f6e3c1867619af37330087fcbd29645..fc154e27dd21a5a57aa53ae4ea667142ba5e35de 100755 --- a/plugins/nmount +++ b/plugins/nmount @@ -4,14 +4,16 @@ # Description: Toggle mount status of a device using pmount # If the device is not mounted, it will be mounted. # If the device is mounted, it will be unmounted and powered down. # -# Runs `lsblk` if 'l' is entered, exits on 'Return`. +# Dependencies: lsblk # -# Note: -# - The script uses Linux-specific lsblk to list block devices. Alternatives: +# Usage: Runs `lsblk` on 'l', exits on 'Return`. +# +# Notes: +# - The script uses Linux-specific lsblk to list block devices. Alternatives: # macOS: "diskutil list" # BSD: "geom disk list" -# - The script uses udisksctl (from udisks2) to power down devices. This is also Linux-specific. -# Users on non-Linux platforms can comment it and use an alterntive to power-down disks. +# - The script uses udisksctl (from udisks2) to power down devices. This is also Linux-specific. +# Users on non-Linux platforms can comment it and use an alterntive to power-down disks. # # Shell: POSIX compliant # Author: Arun Prakash Jana diff --git a/plugins/nuke b/plugins/nuke index 1018a621af38e4c0eaf5024f392d55f5aad6a78c..d65565b664e25369af6d3058e3d066a22cc33732 100755 --- a/plugins/nuke +++ b/plugins/nuke @@ -1,6 +1,5 @@ #!/usr/bin/env sh -# ############################################################################# # Description: Sample script to play files in apps by file type or mime # # Shell: POSIX compliant @@ -60,10 +59,9 @@ # text/troff: man -l # text/* | */xml: vi # image/vnd.djvu): djvutxt, exiftool # -# ToDo: +# TODO: # 1. Adapt, test and enable all mimes # 2. Clean-up the unnecessary exit codes -# ############################################################################# # set to 1 to enable GUI apps GUI="${GUI:-0}" diff --git a/plugins/pdfview b/plugins/pdfview index 262e34fea4b34b6b4c8ce7414d9b96a14df5f323..e21b34861c7f3c9ae60e2153c58ce207939c9121 100755 --- a/plugins/pdfview +++ b/plugins/pdfview @@ -3,8 +3,8 @@ # Description: View a PDF file in pager # # Notes: -# - $PAGER must be 'less -R' or 'most' -# - To use mutool, uncomment the relevant lines and comment the pdftotext line +# - $PAGER must be 'less -R' or 'most' +# - To use mutool, uncomment the relevant lines and comment the pdftotext line # # Shell: POSIX compliant # Author: Arun Prakash Jana diff --git a/plugins/preview-tabbed b/plugins/preview-tabbed index 0fcb31488f772d919ef7c10a6cdf9a84c29e91b5..a4921786b91299ccc992818142ae4993920193ff 100755 --- a/plugins/preview-tabbed +++ b/plugins/preview-tabbed @@ -2,33 +2,30 @@ #!/usr/bin/env bash # Description: tabbed/xembed based file previewer # -# Note: This plugin needs a "NNN_FIFO" to work. See man. -# # Dependencies: -# - tabbed (https://tools.suckless.org/tabbed): xembed host -# - xterm (or urxvt or st) : xembed client for text-based preview -# - mpv (https://mpv.io): xembed client for video/audio -# - sxiv (https://github.com/muennich/sxiv): xembed client for images -# - zathura (https://pwmt.org/projects/zathura): xembed client for PDF documents -# - nnn's nuke plugin for text preview and fallback (should be in plugins directory) -# nuke is a fallback for 'mpv', 'sxiv', and 'zathura', but it has has its own -# dependencies, see the script itself -# - vim (or any editor/pager really) -# - file -# - mktemp -# - xdotool (optional, to keep main window focused) +# - tabbed (https://tools.suckless.org/tabbed): xembed host +# - xterm (or urxvt or st) : xembed client for text-based preview +# - mpv (https://mpv.io): xembed client for video/audio +# - sxiv (https://github.com/muennich/sxiv): xembed client for images +# - zathura (https://pwmt.org/projects/zathura): xembed client for PDF +# - nnn's nuke plugin for text preview and fallback +# nuke is a fallback for 'mpv', 'sxiv', and 'zathura', but has its +# own dependencies, see the script for more information +# - vim (or any editor/pager really) +# - file +# - mktemp +# - xdotool (optional, to keep main window focused) # -# How to use: -# First, install the dependencies. Then you need to set a NNN_FIFO path -# and set a key for the plugin, then start `nnn`: +# Usage: +# - Install the dependencies. Then set a NNN_FIFO +# and set a key for the plugin, then start `nnn`: +# $ NNN_FIFO=/tmp/nnn.fifo nnn +# - Launch the plugin with the designated key from nnn # -# $ NNN_FIFO=/tmp/nnn.fifo nnn -# -# Then in `nnn`, launch the `preview-tabbed` plugin. -# -# If you provide the same NNN_FIFO to all nnn instances, there will be a -# single common preview window. I you provide different FIFO path, they -# will be independent. +# Notes: +# 1. This plugin needs a "NNN_FIFO" to work. See man. +# 2. If the same NNN_FIFO is used in multiple nnn instances, there will be one +# common preview window. With different FIFO paths, they will be independent. # # How it works: # We use `tabbed` [1] as a xembed [2] host, to have a single window @@ -45,7 +42,7 @@ # # [1]: https://tools.suckless.org/tabbed/ # [2]: https://specifications.freedesktop.org/xembed-spec/xembed-spec-latest.html # -# Shell: bash (job control is weakly specified in POSIX) +# Shell: Bash (job control is weakly specified in POSIX) # Author: Léo Villeveygoux diff --git a/plugins/preview-tui b/plugins/preview-tui index a69cf2249ad7f8ef36f620708f3cc10cbc24c11d..e649a279b21648302c8e25866754287df14197da 100755 --- a/plugins/preview-tui +++ b/plugins/preview-tui @@ -6,28 +6,26 @@ # Note: This plugin needs a "NNN_FIFO" to work. See man. # For a more extended version of this script with additional optional dependencies, see preview-tui-ext. # # Dependencies: -# - Supports 4 independent methods to preview with: -# - tmux (>=3.0), or -# - kitty with allow_remote_control and listen_on set in kitty.conf, or -# - QuickLook on WSL (https://github.com/QL-Win/QuickLook) -# - $TERMINAL set to a terminal (it's xterm by default). -# - less or $PAGER -# - tree or exa or ls -# - mediainfo or file -# - mktemp -# - unzip -# - tar -# - man -# - optional: bat for code syntax highlighting -# - optional: ueberzug, kitty terminal, viu or catimg for images. -# - optional: scope.sh file viewer from ranger. -# To use: -# 1. drop scope.sh executable in $PATH -# 2. set/export $USE_SCOPE as 1 -# - optional: pistol file viewer (https://github.com/doronbehar/pistol). -# To use: -# 1. install pistol -# 2. set/export $USE_PISTOL as 1 +# - Supports 4 independent methods to preview with: +# - tmux (>=3.0), or +# - kitty with allow_remote_control and listen_on set in kitty.conf, or +# - QuickLook on WSL (https://github.com/QL-Win/QuickLook) +# - $TERMINAL set to a terminal (it's xterm by default). +# - less or $PAGER +# - tree or exa or ls +# - mediainfo or file +# - mktemp +# - unzip +# - tar +# - man +# - optional: bat for code syntax highlighting +# - optional: ueberzug, kitty terminal, viu or catimg for images. +# - optional: scope.sh file viewer from ranger. +# 1. drop scope.sh executable in $PATH +# 2. set/export $USE_SCOPE as 1 +# - optional: pistol file viewer (https://github.com/doronbehar/pistol). +# 1. install pistol +# 2. set/export $USE_PISTOL as 1 # # Usage: # You need to set a NNN_FIFO path and a key for the plugin with NNN_PLUG, @@ -39,7 +37,7 @@ # or # # $ NNN_FIFO=/tmp/nnn.fifo nnn # -# Then in `nnn`, launch the `preview-tui` plugin. +# Then launch the `preview-tui` plugin in `nnn`. # # If you provide the same NNN_FIFO to all nnn instances, there will be a # single common preview window. If you provide different FIFO path (e.g. diff --git a/plugins/renamer b/plugins/renamer index eb79435f76aebe6396c0baa03db7a9ac6e3cb2b4..d01cca66f412ef2c9b4bd01f4f853abbca078463 100755 --- a/plugins/renamer +++ b/plugins/renamer @@ -3,11 +3,11 @@ # Description: Batch rename selection or current directory with qmv # # Notes: -# - Try to mimic current batch rename functionality but with correct -# handling of edge cases by qmv or vidir. -# Qmv opens with hidden files if no selection is used. Selected -# directories are shown. -# Vidir don't show directories nor hidden files. +# - Try to mimic current batch rename functionality but with correct +# handling of edge cases by qmv or vidir. +# - Qmv opens with hidden files if no selection is used. Selected +# directories are shown. +# - Vidir don't show directories nor hidden files. # # Shell: POSIX compliant # Author: José Neder diff --git a/plugins/uidgid b/plugins/uidgid index d72f1e0a4f1bbb7c362390f69f1fcef548637450..261ac60fd96c16bdd351eb16de5dfee65cb82197 100755 --- a/plugins/uidgid +++ b/plugins/uidgid @@ -3,7 +3,6 @@ # Description: list uid and gid of files # # Note: To list UID and GID of all users in a pretty format, run: -# # cut -d':' -f1,3,4,5 < /etc/passwd | column -ts ":" # # Shell: POSIX compliant diff --git a/plugins/unmount-parent b/plugins/unmount-parent index 4abf6ab0931d746516c532dcc3fb1792a99ee251..3a89f650671113e11720d27f9fb6e19793e99194 100755 --- a/plugins/unmount-parent +++ b/plugins/unmount-parent @@ -1,15 +1,19 @@ #!/usr/bin/env sh -# Description: Autodetects a nnn remote mountpoint (mounted with `c`) from any of its subfolders and allows unmounting it -# from there without first going back to the top or entering the remote name. Also works when hovering the mountpoint -# directly like vanilla `u`. +# Description: Autodetects a nnn remote mountpoint (mounted with `c`) +# from any of its subfolders and allows unmounting it +# from the subdir without navigating to the mountppoint +# or entering the remote name. Also works when hovering +# the mountpoint directly like vanilla `u`. # # Dependencies: fusermount +# # Shell: POSIX compliant # Authors: Kabouik & 0xACE # -# TODO: Try better avoiding lazy unmount by forcing nnn context to leave the subfolder before fusermount. -# I tried `printf "%s" "0c$m" > "$NNN_PIPE"` but this would break nnn UI all the time, see #854. +# TODO: +# - Avoid lazy unmount by forcing nnn context to leave the subfolder before fusermount. +# Tried `printf "%s" "0c$m" > "$NNN_PIPE"` but it breaks the nnn interfacee, see #854. err=0 m=$HOME/.config/nnn/mounts diff --git a/plugins/upgrade b/plugins/upgrade index b2170f7be508df26c3a9f38f5e478ba1148c8b79..3be9a837dd5450ced87460e647f524b5f455eb04 100755 --- a/plugins/upgrade +++ b/plugins/upgrade @@ -4,7 +4,7 @@ # Description: Check and update to latest version of nnn manually on Debian 9 Stretch # # Note: This script installs a package, should be issued with admin privilege # -# Shell: POSIX-compliant +# Shell: POSIX compliant # Author: Arun Prakash Jana cur="$(nnn -v)" diff --git a/plugins/upload b/plugins/upload index 0bbf5626d978c8d722daaa5afa559fe4611c0e8b..733cf87da8fb747e9a62b45395f80b3469013942 100755 --- a/plugins/upload +++ b/plugins/upload @@ -3,7 +3,9 @@ # Description: Upload to Firefox Send if ffsend is found, else # Paste contents of a text a file http://ix.io # Upload a binary file to file.io +# # Dependencies: ffsend (https://github.com/timvisee/ffsend), curl, jq, tr +# # Note: Binary file set to expire after a week # # Shell: POSIX compliant diff --git a/plugins/vidthumb b/plugins/vidthumb index 248abd76327c455ea010a27ddaf5b80ddaf4d6e0..590cf81a4985006d30cf85d26bf28bcf696a9761 100755 --- a/plugins/vidthumb +++ b/plugins/vidthumb @@ -3,8 +3,8 @@ # Description: Generate video thumbnails and view them # # Dependencies: -# ffmpegthumbnailer: https://github.com/dirkvdb/ffmpegthumbnailer -# lsix: https://github.com/hackerb9/lsix +# - ffmpegthumbnailer: https://github.com/dirkvdb/ffmpegthumbnailer +# - lsix: https://github.com/hackerb9/lsix # # Shell: POSIX compliant # Author: Arun Prakash Jana diff --git a/plugins/wall b/plugins/wall index a154134665826bf3b144e4ad1046973071e97781..deea19a6f2bb075b2247084b4532e140cf16a133 100755 --- a/plugins/wall +++ b/plugins/wall @@ -1,9 +1,10 @@ #!/usr/bin/env sh # Description: Set the selected image as wallpaper using nitrogen or pywal. +# # Usage: Hover on an image and run the script to set it as wallpaper. # -# Shell: POSIX Compliant +# Shell: POSIX compliant # Author: juacq97 if [ -n "$1" ]; then diff --git a/plugins/x2sel b/plugins/x2sel index 0e6cbad73077b5ac4de84c2d868479d5df575fe7..70104d77c90433b83b6bf9c6dab1e7e45b7245ae 100755 --- a/plugins/x2sel +++ b/plugins/x2sel @@ -1,17 +1,19 @@ #!/usr/bin/env sh # Description: Copy system clipboard newline-separated file list to selection +# # Dependencies: -# - tr -# - xclip/xsel (Linux) -# - pbpaste (macOS) -# - termux-clipboard-get (Termux) -# - powershell (WSL) -# - cygwim's /dev/clipboard (Cygwin) -# - wl-paste (Wayland) -# - clipboard (Haiku) +# - tr +# - xclip/xsel (Linux) +# - pbpaste (macOS) +# - termux-clipboard-get (Termux) +# - powershell (WSL) +# - cygwim's /dev/clipboard (Cygwin) +# - wl-paste (Wayland) +# - clipboard (Haiku) # -# Limitation: breaks if a filename has newline in it +# Note: +# - Limitation: breaks if a filename has newline in it # # Shell: POSIX compliant # Author: Léo Villeveygoux, after Arun Prakash Jana's .cbcp @@ -21,7 +23,6 @@ selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} getclip () { - if type xsel >/dev/null 2>&1; then # Linux xsel -bo @@ -47,7 +48,6 @@ elif type clipboard >/dev/null 2>&1; then # Haiku clipboard --print fi - } CLIPBOARD=$(getclip) diff --git a/plugins/xdgdefault b/plugins/xdgdefault index 366190a4ffd35105971248d5c71028a13b1dbf15..a302b22aab5e1218e7018075f46d99cbcc523a5b 100755 --- a/plugins/xdgdefault +++ b/plugins/xdgdefault @@ -1,13 +1,13 @@ #!/usr/bin/env sh -# Description: Sets the xdg-open's default application for the current entry's -# file type. ${XDG_DATA_DIRS} and ${XDG_DATA_HOME} are set to the recommended -# defaults if unset, as specified in XDG Base Directory Specification, -# [ http://specifications.freedesktop.org/basedir-spec/ ]. +# Description: Sets the xdg-open's default application for the current entry's file +# type. ${XDG_DATA_DIRS} and ${XDG_DATA_HOME} are set to the recommended +# defaults if unset, as specified in XDG Base Directory Specification +# - http://specifications.freedesktop.org/basedir-spec/. # # Dependencies: xdg-utils, fzf # -# Shell: POSIX +# Shell: POSIX compliant # Author: lwnctd if [ -z "$1" ] || ! command -v fzf > /dev/null 2>& 1; then