#!/usr/bin/env bash
# Author: Dolores Portalatin <hello@doloresportalatin.info>
# Dependencies: imagemagick, i3lock-color-git, scrot
set -o errexit -o noclobber -o nounset

PARAM=("--insidecolor=0000001c" "--ringcolor=0000003e" \
    "--linecolor=00000000" "--keyhlcolor=ffffff80" "--ringvercolor=ffffff00" \
    "--separatorcolor=22222260" "--insidevercolor=ffffff1c" \
    "--ringwrongcolor=ffffff55" "--insidewrongcolor=ffffff1c" \
    "--verifcolor=ffffff00" "--wrongcolor=ff000000" "--timecolor=ffffff00" \
    "--datecolor=ffffff00" "--layoutcolor=ffffff00")

IMAGE="/home/recolic/scripts/fake-lock/fake-screen.png"

# try to use a forked version of i3lock with prepared parameters
if ! i3lock -n "${PARAM[@]}" -i "$IMAGE" > /dev/null 2>&1; then
    # We have failed, lets get back to stock one
    i3lock -n -i "$IMAGE"
fi
