From a1d9f8d5d99b54ab6d32e8afeecb30d92b6269a8 Mon Sep 17 00:00:00 2001 From: Nikita Ivanov Date: Tue, 31 May 2022 23:47:04 +0500 Subject: [PATCH] Minor --- helpers.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/helpers.sh b/helpers.sh index 52f3f8c..d2130a0 100644 --- a/helpers.sh +++ b/helpers.sh @@ -19,14 +19,6 @@ exists() { command -v "$1" > /dev/null } -check_exists() { - [ $? = 127 ] && exit 127 -} - -cache() { - [ -n "$cache_valid" ] -} - 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" @@ -34,7 +26,7 @@ send_image() { convert_and_show_image() { setup_fifo - cache || "$@" || check_exists + [ -n "$cache_valid" ] || "$@" || exit "$?" send_image "$cache_f" exit 1 }