/ gravity change

This commit is contained in:
fro
2026-01-18 18:10:53 -05:00
parent 4c7b6fc0c6
commit 2031e36359

View File

@@ -9,6 +9,8 @@ random_image=$(ls -1 /home/${USER}/.local/share/img/*.png | shuf | head -1)
random_image_filname="$(basename -- $random_image)"
# get random gravity to use for the overlay image, take the number of displays into account
# https://imagemagick.org/script/command-line-options.php#gravity
# $ magick -list gravity
numberOfDisplays=$(xrandr --query | grep -o " connected " | wc -l)
gravity=("center") # "center" "northwest" "northeast" "southwest" "southeast"
if [[ numberOfDisplays == 1 ]] || [[ numberOfDisplays == 3 ]] ; then
@@ -16,7 +18,7 @@ if [[ numberOfDisplays == 1 ]] || [[ numberOfDisplays == 3 ]] ; then
elif [[ numberOfDisplays == 2 ]] ; then
gravity=("northeast" "southeast")
else
gravity=("southeast")
gravity=("east")
fi
random_gravity=${gravity[ $RANDOM % ${#gravity[@]} ]}