This commit is contained in:
committer@tuxwarrior
2026-02-27 18:58:35 -05:00
parent 9c564be381
commit 5f9e4134d4
4 changed files with 27 additions and 28 deletions

View File

@@ -1,33 +1,32 @@
#!/usr/bin/env bash
file="$1"
w="$2" h="$3" x="$4" y="$5"
case "$(file -Lb --mime-type "$file")" in
image/*)
# kitten icat --stdin no --transfer-mode memory --place "${w}x${h}@${x}x${y}" "$file" /dev/tty
kitten icat --stdin no --transfer-mode memory "$file" /dev/tty
;;
application/pdf)
pdftoppm -f 1 -singlefile "$file" "/tmp/lfoutput"
kitten icat --stdin no --transfer-mode memory --place "${w}x${h}@${x}x${y}" "/tmp/lfoutput.ppm" /dev/tty
;;
*)
less "$file"
;;
esac
exit 1
#file="$1"
#case "$file" in
# *.png|*.jpg|*.jpeg|*.gif|*.bmp|*.tiff|*.webp)
# # 260227: img2sixel is (currently) not supported by kitty
# kitty +kitten icat "$file"
# #img2sixel -w "$(tput cols)" "$file"
#w="$2" h="$3" x="$4" y="$5"
#
#case "$(file -Lb --mime-type "$file")" in
# image/*)
## kitten icat --stdin no --transfer-mode memory --place "${w}x${h}@${x}x${y}" "$file" /dev/tty
# kitten icat --stdin no --transfer-mode memory "$file" /dev/tty
# ;;
# application/pdf)
# pdftoppm -f 1 -singlefile "$file" "/tmp/lfoutput"
# kitten icat --stdin no --transfer-mode memory --place "${w}x${h}@${x}x${y}" "/tmp/lfoutput.ppm" /dev/tty
# ;;
# *)
# echo "Unsupported image format"
# exit 1
# less "$file"
# ;;
#esac
#exit 1
file="$1"
case "$file" in
*.png|*.jpg|*.jpeg|*.gif|*.bmp|*.tiff|*.webp)
# 260227: img2sixel is (currently) not supported by kitty
#img2sixel -w "$(tput cols)" "$file"
kitty +kitten icat "$file"
;;
*)
echo "Unsupported image format"
exit 1
;;
esac

View File

@@ -31,8 +31,8 @@ set cursorpreviewfmt "\033[7;2m"
#set sixel true
set preview true
set cleaner ~/.config/lf/lf_kitty_clean.sh
set previewer ~/.config/lf/lf_kitty_preview.sh
set cleaner lf_kitty_clean.sh
set previewer lf_kitty_preview.sh
#set previewer imgPreviewer.sh