/ adjust gravity and add brightness

This commit is contained in:
committer@tuxwarrior
2025-04-14 07:58:12 -05:00
parent f603e7a12e
commit 88fbafdf8b

View File

@@ -8,13 +8,20 @@
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
gravity=("northeast" "southeast") # "center" "northwest" "northeast" "southwest" "southeast"
# get random gravity to use for the overlay image, take the number of displays into account
numberOfDisplays=$(xrandr --query | grep -o " connected " | wc -l)
gravity=("center") # "center" "northwest" "northeast" "southwest" "southeast"
if [[ numberOfDisplays == 1 ]] ; then
gravity=("center" "northwest" "northeast" "southwest" "southeast")
elif [[ numberOfDisplays == 2 ]] ; then
gravity=("northeast" "southeast")
fi
random_gravity=${gravity[ $RANDOM % ${#gravity[@]} ]}
# take a screenshot of the entire screen, and blur this
# take a screenshot of the entire screen, blur it, and adjust white balance
scrot --overwrite /tmp/currentworkspace.png
magick /tmp/currentworkspace.png -blur 0x9 /tmp/currentworkspaceblur.png
mogrify -brightness-contrast 50 /tmp/currentworkspaceblur.png
# send a notification to the user after the screenshot is taken, to avoid including the notification
notify-send "LOCKING SCREEN" "The system is about to be locked.\nPress any key to stop this from happening.\n\n${random_image_filname} @ ${random_gravity}"