ctpv/prev/image.sh

14 lines
450 B
Bash
Raw Normal View History

2022-05-25 23:57:50 +02:00
fifo="$(get_fifo "$id")"
# tell ctpv to fallback to another preview
[ -e "$fifo" ] || exit 127
path="$(printf '%s' "$f" | sed 's/\\/\\\\/g; s/"/\\"/g')"
fifo_open "$fifo" && {
printf '{ "action": "add", "identifier": "preview", "x": %d, "y": %d, "width": %d, "height": %d, "scaler": "contain", "scaling_position_x": 1, "scaling_position_y": 1, "path": "%s"}\n' "$x" "$y" "$w" "$h" "$path" > "$fifo"
}
# tell lf to disable preview caching
exit 1