summaryrefslogtreecommitdiffstats
path: root/.config/nnn/plugins/joe_rand
diff options
context:
space:
mode:
authorjoe <rbo@gmx.us>2025-10-11 21:33:23 +0200
committerjoe <rbo@gmx.us>2025-10-11 21:33:23 +0200
commitf975bf85ad62247c5b9686a24a549c3932d4c3ea (patch)
tree8b5f44baa34b817768717d72a5bc1ccbf7cca941 /.config/nnn/plugins/joe_rand
parentup (diff)
downloaddotfiles-bsd-f975bf85ad62247c5b9686a24a549c3932d4c3ea.tar.gz
dotfiles-bsd-f975bf85ad62247c5b9686a24a549c3932d4c3ea.tar.bz2
dotfiles-bsd-f975bf85ad62247c5b9686a24a549c3932d4c3ea.tar.xz
dotfiles-bsd-f975bf85ad62247c5b9686a24a549c3932d4c3ea.tar.zst
dotfiles-bsd-f975bf85ad62247c5b9686a24a549c3932d4c3ea.zip
Diffstat (limited to '.config/nnn/plugins/joe_rand')
-rwxr-xr-x.config/nnn/plugins/joe_rand22
1 files changed, 22 insertions, 0 deletions
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