summaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2021-08-11 18:24:36 -0700
committerxyz <gky44px1999@gmail.com>2021-08-11 18:24:36 -0700
commit80b765b49e529e8574e2887dd9f35a4e46c0ab47 (patch)
tree8e24a16b475d8975bd96ca6d652ad426dfe2cc16 /.local
parente0eb28ab7924a9328e4e382b7deb96e78110b1d9 (diff)
maximize wallpaper, refactor
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/convwall3
-rwxr-xr-x.local/bin/shufwall2
2 files changed, 3 insertions, 2 deletions
diff --git a/.local/bin/convwall b/.local/bin/convwall
index dbd9c795..21645240 100755
--- a/.local/bin/convwall
+++ b/.local/bin/convwall
@@ -1,6 +1,6 @@
#!/bin/sh
-# 16:9 screen resolution ratio
+# 16:9 screen aspect ratio
# 16*100/9 == 177
wratio=16
hratio=9
@@ -24,6 +24,7 @@ if [ "$dim" -ne "$ratio" ]; then
# caused by head exit (or close stdin) before sort output complete, can ignore
# https://stackoverflow.com/questions/46202653/bash-error-in-sort-sort-write-failed-standard-output-broken-pipe
bgcolor=$(convert "$1" -gravity center -chop "$chopgeom" -define histogram:unique-colors=true -format %c histogram:info:- | sort -rn | head -n1 | awk \{print\ \$3\} | cut -c1-7)
+ # 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
diff --git a/.local/bin/shufwall b/.local/bin/shufwall
index 831e614f..489b6307 100755
--- a/.local/bin/shufwall
+++ b/.local/bin/shufwall
@@ -6,4 +6,4 @@ else
file=$(find -L "$@" -maxdepth 1 -type f | shuf -n 1)
fi
-display -backdrop -window root "$file"
+display -resize '1600x900' -backdrop -window root "$file"