scripts/zat: Fix position saving

Calling zathura over stdin prevents saving position.
We use stdin for non-supported files only.
master
Pierre Neidhardt 2017-02-15 13:40:49 +01:00
parent e95d5048e4
commit babe5876d6
1 changed files with 7 additions and 13 deletions

View File

@ -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