From 153c9344e93662984b1a5368a2722c10117db830 Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Thu, 20 Aug 2026 15:13:47 +0500 Subject: nnn: update plugins --- files/.config/nnn/plugins/mimelist | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'files/.config/nnn/plugins/mimelist') diff --git a/files/.config/nnn/plugins/mimelist b/files/.config/nnn/plugins/mimelist index ccfe05a..3813c09 100755 --- a/files/.config/nnn/plugins/mimelist +++ b/files/.config/nnn/plugins/mimelist @@ -2,8 +2,12 @@ # Description: Find and list files by mime type in smart context # +# Dependencies: +# - file +# - mimetype (optional, PERL File MimeInfo) +# # Shell: POSIX compliant -# Author: Arun Prakash Jana +# Author: Arun Prakash Jana, Michel DHOOGE # shellcheck disable=SC1090,SC1091 . "$(dirname "$0")"/.nnn-plugin-helper @@ -12,4 +16,8 @@ printf "mime (e.g., video/audio/image): " read -r mime printf "%s" "+l" > "$NNN_PIPE" -find . | file -if- | grep "$mime" | awk -F: '{printf "%s\0", $1}' > "$NNN_PIPE" +if type mimetype >/dev/null 2>&1; then + find . | mimetype -f - | grep "$mime" | awk -F: '{printf "%s%c", $1, 0}' > "$NNN_PIPE" +else + find . | file -if- | grep "$mime" | awk -F: '{printf "%s%c", $1, 0}' > "$NNN_PIPE" +fi -- cgit v1.2.3