1
1
mirror of https://github.com/jarun/nnn.git synced 2024-09-19 08:47:13 +03:00
nnn/plugins/mimelist

16 lines
382 B
Plaintext
Raw Normal View History

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