aboutsummaryrefslogtreecommitdiff
path: root/files/.config/nnn/plugins/mimelist
blob: ccfe05a96c7d6b6110ac2b6687ccdf003f3b5207 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env sh

# Description: Find and list files by mime type in smart context
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana

# shellcheck disable=SC1090,SC1091
. "$(dirname "$0")"/.nnn-plugin-helper

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"