diff options
Diffstat (limited to '')
-rw-r--r-- | .config/env | 2 | ||||
-rwxr-xr-x | .config/nnn/plugins/joe_rand | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/.config/env b/.config/env index fb65d71..1df9a2d 100644 --- a/.config/env +++ b/.config/env @@ -123,7 +123,7 @@ export NNN_BATSTYLE='plain' export NNN_PREVIEWIMGPROG='icat' export NNN_PREVIEWVIDEO='tct' export NNN_ICONLOOKUP=0 -export NNN_PLUG='t:joe_fzfcd;p:-preview-tui;s:-!gdu -s;f:-fzopen;c:-joe_clipper;d:-joe_dragdrop;q:-joe_cmusq' +export NNN_PLUG='t:joe_fzfcd;p:-preview-tui;s:-!gdu -s;f:-fzopen;c:-joe_clipper;d:-joe_dragdrop;q:-joe_cmusq;r:joe_rand' export RUSTFLAGS='-L /usr/local/lib' export SFEED_AUTOCMD="t<<<<<<" export SFEED_PLUMBER="linkview" diff --git a/.config/nnn/plugins/joe_rand b/.config/nnn/plugins/joe_rand new file mode 100755 index 0000000..edc71c1 --- /dev/null +++ b/.config/nnn/plugins/joe_rand @@ -0,0 +1,22 @@ +#!/usr/bin/env sh + +# 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, Michel DHOOGE + +# shellcheck disable=SC1090,SC1091 +. "$(dirname "$0")"/.nnn-plugin-helper + +file=$(command ls | shuf | head -n1 | tr -d '\n') +printf "%s" "0l$file" > "$NNN_PIPE" +# printf "%s" "+l" > "$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 |