mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2024-11-27 23:13:07 +01:00
Rename some previews
This commit is contained in:
parent
23921c51fd
commit
c3ad27a830
@ -22,11 +22,11 @@ exists() {
|
|||||||
send_image() {
|
send_image() {
|
||||||
path="$(printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g')"
|
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"
|
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"
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
convert_and_show_image() {
|
convert_and_show_image() {
|
||||||
setup_fifo
|
setup_fifo
|
||||||
[ -n "$cache_valid" ] || "$@" || exit "$?"
|
[ -n "$cache_valid" ] || "$@" || exit "$?"
|
||||||
send_image "$cache_f"
|
send_image "$cache_f"
|
||||||
exit 1
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,6 @@ pdf() {
|
|||||||
-singlefile \
|
-singlefile \
|
||||||
-jpeg -tiffcompression jpeg \
|
-jpeg -tiffcompression jpeg \
|
||||||
-- "$f" "$cache_f" && mv -- "$cache_f.jpg" "$cache_f"
|
-- "$f" "$cache_f" && mv -- "$cache_f.jpg" "$cache_f"
|
||||||
}
|
}
|
||||||
|
|
||||||
convert_and_show_image pdf
|
convert_and_show_image pdf
|
||||||
|
@ -17,18 +17,18 @@ Preview b_previews[] = {
|
|||||||
PP(NULL, NULL, NULL, wrapper, INT_MAX),
|
PP(NULL, NULL, NULL, wrapper, INT_MAX),
|
||||||
PR(NULL, NULL, NULL, any),
|
PR(NULL, NULL, NULL, any),
|
||||||
|
|
||||||
PR("md", NULL, NULL, markdown),
|
PR("md", NULL, NULL, mdcat),
|
||||||
|
|
||||||
PR(NULL, "text", NULL, bat),
|
PR(NULL, "text", NULL, bat),
|
||||||
PR(NULL, "text", NULL, highlight),
|
PR(NULL, "text", NULL, highlight),
|
||||||
PR(NULL, "text", NULL, source_highlight),
|
PR(NULL, "text", NULL, source_highlight),
|
||||||
PR(NULL, "text", NULL, cat),
|
PR(NULL, "text", NULL, cat),
|
||||||
|
|
||||||
PR(NULL, "image", NULL, image),
|
PR(NULL, "image", NULL, ueberzug),
|
||||||
PR(NULL, "video", NULL, video),
|
PR(NULL, "video", NULL, video),
|
||||||
|
|
||||||
PR(NULL, "application", "pdf", pdf),
|
PR(NULL, "application", "pdf", pdf),
|
||||||
PR(NULL, "application", "json", json),
|
PR(NULL, "application", "json", jq),
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user