#!/bin/bash

style="
window {
  background-color: black
}

window label {
  font-family: \"Cascadia Mono Light\", sans-serif;
}

#input-field {
  background: black;
}

#kbgrid button,
#unlock-button {
  background: black;
  border: 0.5px solid #fff;
  border-radius: 3px;
}
#kbgrid button label {
  font-family: \"Cascadia Mono Light\", sans-serif;
}"
echo "$style" > /tmp/lock-style.css

if ! pgrep -x gtklock >/dev/null; then
    # This is a bit of a hack to ensure keyboard focus is on the
    # lock screen's password input field.
    # Otherwise a mouse is required to focus the input field.
    MONITOR=eDP-1
    niri msg action focus-monitor $MONITOR
    gtklock --daemonize -M $MONITOR -m /usr/local/lib/gtklock/virtkb-module -s /tmp/lock-style.css
fi
