Add image and vid previews in lf
This commit is contained in:
21
.config/lf/lf_kitty_preview
Executable file
21
.config/lf/lf_kitty_preview
Executable file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
file=$1
|
||||
w=$2
|
||||
h=$3
|
||||
x=$4
|
||||
y=$5
|
||||
|
||||
filetype="$( file -Lb --mime-type "$file")"
|
||||
|
||||
if [[ "$filetype" =~ ^image ]]; then
|
||||
kitty +kitten icat --silent --stdin no --transfer-mode file --place "${w}x${h}@${x}x${y}" "$file" < /dev/null > /dev/tty
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$filetype" =~ ^video ]]; then
|
||||
kitty +kitten icat --silent --stdin no --transfer-mode file --place "${w}x${h}@${x}x${y}" "$(vidthumb "$file")" < /dev/null > /dev/tty
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pistol "$file"
|
Reference in New Issue
Block a user