#!/bin/sh
# shellcheck disable=2034
coded_by='

In the name of Allah, the most Gracious, the most Merciful.

 ▓▓▓▓▓▓▓▓▓▓
░▓ Author ▓ Abdullah Khabir <https://abdullah.solutions>
░▓▓▓▓▓▓▓▓▓▓ YouTube <https://YouTube.com/@AbdullahSolutions>
░░░░░░░░░░

░▀█▀░▀▀█░█░░░█▀█░█▀▀░█░█
░░█░░░▀▄░█░░░█░█░█░░░█▀▄
░▀▀▀░▀▀░░▀▀▀░▀▀▀░▀▀▀░▀░▀
'

# random image from walls dir
# convert image to png format because i3lock only supports png format

walls_dir="$HOME/pix/wall/collection/dark"
random_wall="$(shuf -en 1 $walls_dir/*)"

revert() {
    xset dpms 0 0 0
}

trap revert HUP INT TERM
xset +dpms dpms 5 5 5
/usr/bin/i3lock -enfi "$random_wall"
revert
