mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-01-30 09:48:11 +01:00
add msdocx xlsx like doc preview support
This commit is contained in:
parent
749f74f84e
commit
9c26507b01
@ -45,6 +45,16 @@ case "$(file --dereference --brief --mime-type -- "$1")" in
|
||||
[ ! -f "$CACHE.jpg" ] && gnome-epub-thumbnailer "$1" "$CACHE.jpg"
|
||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1"
|
||||
;;
|
||||
application/vnd.* | msword )
|
||||
CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)"
|
||||
[ ! -f "$CACHE.jpg" ] && libreoffice --convert-to jpg "$1" --outdir "$CACHE" >/dev/null
|
||||
# 将绝对路径转换为文件名
|
||||
tmpfile=$(echo "$1"| rev | cut -f 1 -d"/" | rev | sed -r 's/.[^\.]*$//')
|
||||
mv $CACHE/$tmpfile.jpg $CACHE.jpg && rmdir $CACHE
|
||||
# 典中点之利用 output debug
|
||||
# echo -e "\$CACHE=$CACHE\n\$1=$1\n\$tempfile=$tmpfile" > $HOME/log
|
||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1"
|
||||
;;
|
||||
application/*zip) atool --list -- "$1" ;;
|
||||
*opendocument*) odt2txt "$1" ;;
|
||||
application/pgp-encrypted) gpg -d -- "$1" ;;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user