Rename some previews

This commit is contained in:
Nikita Ivanov 2022-06-12 12:57:20 +05:00
parent 23921c51fd
commit c3ad27a830
No known key found for this signature in database
GPG Key ID: 6E656AC5B97B5133
5 changed files with 5 additions and 5 deletions

View File

@ -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
} }

View File

@ -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

View File

@ -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),
}; };