summaryrefslogtreecommitdiff
path: root/.local/bin/convwall
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2021-08-13 00:36:28 -0700
committerxyz <gky44px1999@gmail.com>2021-08-13 00:36:28 -0700
commit4134757d5ef6470edee1165f3c3f5c8ac251b4d0 (patch)
tree5b0132f230b2d36a9aa5fe1e95875562bc891130 /.local/bin/convwall
parent78ddb6b8a5e8fbf400706cf60b9f1a47056587a1 (diff)
screen width and height env var, refactor
Diffstat (limited to '.local/bin/convwall')
-rwxr-xr-x.local/bin/convwall10
1 files changed, 5 insertions, 5 deletions
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