]> Sergey Matveev's repositories - nnn.git/commitdiff
Add plugin to view image and browse image dir
authorArun Prakash Jana <engineerarun@gmail.com>
Fri, 31 May 2019 19:29:59 +0000 (00:59 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 2 Jun 2019 16:07:42 +0000 (21:37 +0530)
plugins/README.md
plugins/viuimg [new file with mode: 0755]

index 1e739d397283173af9c0bfab438faf2b66e0a3d9..c37a88067da1b96defaf58e8f5db550f6281adb8 100644 (file)
@@ -19,6 +19,7 @@
 | sxiv | sh | sxiv | Browse images in a dir in sxiv, set wallpaper, copy path ([config](https://wiki.archlinux.org/index.php/Sxiv#Assigning_keyboard_shortcuts))|
 | transfer | sh | curl | Upload current file to transfer.sh |
 | upgrade | sh | wget | Upgrade to latest nnn version manually on Debian 9 Stretch |
+| viuimg | sh | [viu](https://github.com/atanunq/viu), less | View an image or images in a directory |
 
 #### Installing plugins
 
diff --git a/plugins/viuimg b/plugins/viuimg
new file mode 100755 (executable)
index 0000000..8505be8
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/env sh
+
+# Description: View an image or images in a directory in pager
+#
+# Shell: POSIX compliant
+# Author: Arun Prakash Jana
+
+if ! [ -z "$1" ]; then
+    if [ -d "$1" ]; then
+        viu -n "$1"/* 2>/dev/null | less -R
+    else
+        viu -n "$1" | less -R
+    fi
+fi