Sfoglia il codice sorgente

Fix directory view with viuimg

master
Arun Prakash Jana 5 anni fa
parent
commit
a25165d1bd
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: A75979F35C080412
1 ha cambiato i file con 14 aggiunte e 1 eliminazioni
  1. +14
    -1
      plugins/viuimg

+ 14
- 1
plugins/viuimg Vedi File

@@ -2,12 +2,25 @@

# Description: View an image or images in a directory in pager
#
# Note: While it's very easy to fix this in Bash (sample commented), with the
# current POSIX shell script implementation the unmatched patterns are spewed.
# A patch to fix this is highly appreciated.
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana

if ! [ -z "$1" ]; then
if [ -d "$1" ]; then
viu -n "$1"/* 2>/dev/null | less -R
cd "$1"

# Bash implementation
# shopt -s nullglob
# viu -n *.bmp *.BMP *.gif *.GIF *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.svg *.SVG 2>/dev/null | less -R

for file in *.bmp *.BMP *.gif *.GIF *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.svg *.SVG
do
viu -n "$file" 2>/dev/null
done | less -R
else
viu -n "$1" | less -R
fi


||||||
x
 
000:0
Loading…
Annulla
Salva