1
0
Fork 0
dotfiles/.config/lf/preview

21 lines
408 B
Text
Raw Normal View History

2022-07-06 13:21:33 +02:00
#!/usr/bin/env bash
file=$1
w=$2
h=$3
x=$4
y=$5
2022-07-04 21:36:33 +02:00
2022-07-06 13:21:33 +02:00
filetype="$( file -Lb --mime-type "$file")"
2022-07-04 21:36:33 +02:00
2022-07-06 13:21:33 +02:00
if [[ "$filetype" =~ ^image ]]; then
kitty +icat --silent --transfer-mode file --place "${w}x${h}@${x}x${y}" "$file"
exit 1
fi
2022-07-04 21:36:33 +02:00
2022-07-06 13:21:33 +02:00
if [[ "$filetype" =~ ^video ]]; then
kitty +icat --silent --transfer-mode file --place "${w}x${h}@${x}x${y}" "$(vidthumb "$file")"
exit 1
fi
2022-07-04 21:36:33 +02:00
2022-07-06 13:21:33 +02:00
~/.config/lf/pistol "$file"