#!/bin/sh

WALLPAPER="$HOME/.config/sway/wallpapers/maxresdefault.jpg"
STYLE_TMP=$(mktemp /tmp/gtklock-XXXXXX.css)

cat "$HOME/.config/gtklock/style.css" > "$STYLE_TMP"
printf '\nwindow { background-image: url("file://%s"); background-size: cover; background-position: center; background-repeat: no-repeat; }\n' \
    "$WALLPAPER" >> "$STYLE_TMP"

gtklock --style "$STYLE_TMP"
rm -f "$STYLE_TMP"
