feat(ytfzf): Kitty thumbnail previews

This commit is contained in:
Price Hiller 2022-02-16 00:53:16 -06:00
parent deb24af254
commit 6dc6f2acae
2 changed files with 19 additions and 0 deletions

3
.config/ytfzf/conf.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
thumbnail_viewer=./thumbnail-viewers/kitty-viewer

View File

@ -0,0 +1,16 @@
#!/bin/bash
action="$1"
case "$action" in
start)
command -v "kitty" &>/dev/null || die 3 "\nkitty is not installed\n"
;;
view)
kitty +kitten icat --clear --transfer-mode file
Y_POSITION_ICAT="${4}"
Y_POSITION_ICAT=$(( Y_POSITION_ICAT * 2 ))
kitty +kitten icat --place "${5}x${6}@${3}x${Y_POSITION_ICAT}" --scale-up --transfer-mode file "$2"
;;
no-img) kitty +kitten icat --clear --transfer-mode file ;;
stop) : ;;
esac