mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2025-01-06 00:28:49 +01:00
Minor
This commit is contained in:
parent
d67d10af9f
commit
647f07bab5
@ -23,7 +23,7 @@ cache() {
|
||||
cache_f="$("$ctpv" -C "$f")"
|
||||
}
|
||||
|
||||
show_image() {
|
||||
send_image() {
|
||||
path="$(printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g')"
|
||||
printf '{ "action": "add", "identifier": "preview", "x": %d, "y": %d, "width": %d, "height": %d, "scaler": "contain", "scaling_position_x": 0.5, "scaling_position_y": 0.5, "path": "%s"}\n' "$x" "$y" "$w" "$h" "$path" > "$fifo"
|
||||
}
|
||||
@ -31,6 +31,6 @@ show_image() {
|
||||
convert_and_show_image() {
|
||||
setup_fifo
|
||||
cache || "$@" || check_exist
|
||||
show_image "$cache_f"
|
||||
send_image "$cache_f"
|
||||
exit 1
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
# exit 127 on error so ctpv fallbacks to another preview
|
||||
setup_fifo
|
||||
|
||||
show_image "$f"
|
||||
send_image "$f"
|
||||
|
||||
exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user