scripts/zat: Fix position saving
Calling zathura over stdin prevents saving position. We use stdin for non-supported files only.master
parent
e95d5048e4
commit
babe5876d6
20
.scripts/zat
20
.scripts/zat
|
@ -3,17 +3,11 @@
|
|||
[ -z "$VIEWER" ] && VIEWER="zathura --fork"
|
||||
|
||||
for i; do
|
||||
basename=${i##*/}
|
||||
ext=${basename##*.}
|
||||
|
||||
case "$ext" in
|
||||
bz2) bzcat "$i" ;;
|
||||
bz) bzcat "$i" ;;
|
||||
gz) zcat "$i" ;;
|
||||
lrz) lrzcat "$i" ;;
|
||||
lz) lzcat "$i" ;;
|
||||
lz4) lz4cat "$i" ;;
|
||||
xz) xzcat "$i" ;;
|
||||
*) cat "$i" ;;
|
||||
esac | $VIEWER -
|
||||
if $(file -i -b "$i" | grep -qi 'pdf\|postscript\|djvu'); then
|
||||
$VIEWER "$i"
|
||||
else
|
||||
## The drawback of reading from stdin is that zathura will not save the
|
||||
## position.
|
||||
acat "$i" | $VIEWER -
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue