#!/bin/bash

START_TIME=`date +"%b %d, %Y %T"`
LOG_FILE="${XDG_STATE_HOME}"/waylock.log
echo "--- ${START_TIME} ---" > "$LOG_FILE"

if pgrep -u $UID -x waylock >/dev/null; then 
  exit 1
else
  waylock \
    -fork-on-lock \
    -init-color 0x000000 \
    -fail-color 0x000000 \
    -input-color 0x525c62 \
    2>&1 | tee -a "$LOG_FILE" & disown
fi