u
This commit is contained in:
@@ -1,13 +1,32 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
file="$1"
|
file="$1"
|
||||||
case "$file" in
|
w="$2" h="$3" x="$4" y="$5"
|
||||||
*.png|*.jpg|*.jpeg|*.gif|*.bmp|*.tiff|*.webp)
|
|
||||||
# 260227: img2sixel is (currently) not supported by kitty
|
case "$(file -Lb --mime-type "$file")" in
|
||||||
img2sixel -w "$(tput cols)" "$file"
|
image/*)
|
||||||
#kitty +kitten icat "$file"
|
kitten icat --stdin no --transfer-mode memory --place "${w}x${h}@${x}x${y}" "$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"
|
less "$file"
|
||||||
exit 1
|
|
||||||
;;
|
;;
|
||||||
esac
|
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"
|
||||||
|
# ;;
|
||||||
|
# *)
|
||||||
|
# echo "Unsupported image format"
|
||||||
|
# exit 1
|
||||||
|
# ;;
|
||||||
|
#esac
|
||||||
|
|||||||
Reference in New Issue
Block a user