summaryrefslogtreecommitdiff
path: root/.config/lf/previewer
blob: e755ce288bc6b8b5974f08ee207c39327a5cc455 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/sh
file=$1
w=$2
h=$3
x=$4
y=$5

case "$(file -Lb --mime-type -- "$1")" in
    image/*)
        kitty +kitten icat --silent --stdin no --transfer-mode file --place "${w}x${h}@${x}x${y}" "$file" < /dev/null > /dev/tty
        exit 1
        ;;
    *)
        pistol "$1"
        ;;
esac