diff --git a/plugins/README.md b/plugins/README.md index 3f8fc4b4..0a23369b 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -27,10 +27,9 @@ Plugins extend the capabilities of `nnn`. They are _executable_ scripts (or bina | gutenread | Browse, download, read from Project Gutenberg | sh | curl, unzip, w3m
[epr](https://github.com/wustho/epr) (optional) | | hexview | View a file in hex in `$PAGER` | sh | xxd | | imgresize | Resize images in dir to screen resolution | sh | [imgp](https://github.com/jarun/imgp) | -| imgsxiv | Browse images, set wallpaper, copy path ([config](https://wiki.archlinux.org/index.php/Sxiv#Assigning_keyboard_shortcuts)), [rename](https://github.com/jarun/nnn/wiki/Basic-use-cases#browse-rename-images)| sh | sxiv | | imgthumb | View thumbnail of an image or dir of images | sh | [lsix](https://github.com/hackerb9/lsix) | | imgur | Upload an image to imgur (from [imgur-screenshot](https://github.com/jomo/imgur-screenshot)) | bash | - | -| imgviu | View an image or images in dir in `$PAGER` | sh | [viu](https://github.com/atanunq/viu), less | +| imgview | Browse images, set wallpaper, copy path ([config](https://wiki.archlinux.org/index.php/Sxiv#Assigning_keyboard_shortcuts)), [rename](https://github.com/jarun/nnn/wiki/Basic-use-cases#browse-rename-images)| sh | sxiv/[viu](https://github.com/atanunq/viu), less| | ipinfo | Fetch external IP address and whois information | sh | curl, whois | | kdeconnect | Send selected files to an Android device | sh | kdeconnect-cli | | launch | GUI application launcher | sh | fzf/fzy | diff --git a/plugins/imgsxiv b/plugins/imgsxiv deleted file mode 100755 index cbe4a18e..00000000 --- a/plugins/imgsxiv +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env sh - -# Description: Open images in hovered directory and thumbnails -# open hovered image in sxiv and browse other images in the directory -# -# Shell: POSIX compliant -# Author: Arun Prakash Jana - -if command -v sxiv >/dev/null 2>&1; then - if ! [ -z "$1" ]; then - if [ -f "$1" ]; then - sxiv -q "$1" "$PWD" - elif [ -d "$1" ] || [ -h "$1" ]; then - sxiv -qt "$1" - fi - fi -else - echo "sxiv missing" - read -r _ -fi diff --git a/plugins/imgview b/plugins/imgview new file mode 100755 index 00000000..dc4d3a4d --- /dev/null +++ b/plugins/imgview @@ -0,0 +1,27 @@ +#!/usr/bin/env sh + +# Description: Open images in hovered directory and thumbnails +# open hovered image in sxiv or viu and browse other images in the directory +# +# Shell: POSIX compliant +# Author: Arun Prakash Jana + +if [ -z "$1" ] || ! [ -s "$1" ]; then + printf "empty file" + read -r _ + exit 1 +fi + +if command -v sxiv >/dev/null 2>&1; then + if [ -f "$1" ]; then + sxiv -q "$1" "$PWD" + elif [ -d "$1" ] || [ -h "$1" ]; then + sxiv -qt "$1" + fi +elif command -v viu >/dev/null 2>&1; then + viu -n "$1" | less -R +else + printf "install sxiv or viu" + read -r _ + exit 2 +fi diff --git a/plugins/imgviu b/plugins/imgviu deleted file mode 100755 index 200a4591..00000000 --- a/plugins/imgviu +++ /dev/null @@ -1,10 +0,0 @@ -#!/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 - viu -n "$1" | less -R -fi