nnn/plugins/mimelist

15 lines
347 B
Plaintext
Raw Normal View History

#!/usr/bin/env sh
2020-11-22 14:39:14 +00:00
# Description: Find and list files by mime type in smart context
#
# Shell: POSIX compliant
2020-05-04 00:47:38 +00:00
# Author: Arun Prakash Jana
. "$(dirname "$0")"/.nnn-plugin-helper
2020-11-12 02:47:14 +00:00
printf "mime (e.g., video/audio/image): "
read -r mime
printf "%s" "+l" > "$NNN_PIPE"
2020-11-22 14:39:14 +00:00
find . | file -if- | grep "$mime" | awk -F: '{printf "%s\0", $1}' > "$NNN_PIPE"