From 4134757d5ef6470edee1165f3c3f5c8ac251b4d0 Mon Sep 17 00:00:00 2001 From: xyz Date: Fri, 13 Aug 2021 00:36:28 -0700 Subject: screen width and height env var, refactor --- .local/bin/convwall | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '.local/bin/convwall') diff --git a/.local/bin/convwall b/.local/bin/convwall index 21645240..9db84d06 100755 --- a/.local/bin/convwall +++ b/.local/bin/convwall @@ -1,9 +1,9 @@ #!/bin/sh -# 16:9 screen aspect ratio -# 16*100/9 == 177 -wratio=16 -hratio=9 +# target image aspect ratio +wratio=$SCRWIDTH +hratio=$SCRHEIGHT +# chop how much from center chopnum=99% width=$(identify -format '%w' "$1") @@ -27,6 +27,6 @@ if [ "$dim" -ne "$ratio" ]; then # another approach is to use "$width" or "x$height" for geometry, current approach is more readable convert "$1" -gravity center -background "$bgcolor" -extent "${width}x$height" "$2" else - echo 'same resolution ratio, no need to convert' >&2 + echo 'same aspect ratio, no need to convert' >&2 exit 1 fi -- cgit v1.2.3-70-g09d2