#!/bin/sh

if [ "$#" -ne 1 ]; then
  echo "Usage: wall.sh <path/to/wallpaper.png>"
  exit 1
fi

cp "$1" ~/.cache/current_wallpaper.png

wal -i ~/.cache/current_wallpaper.png -stne

rm ~/.config/mako/config
cp ~/.cache/wal/colors-mako ~/.config/mako/config
makoctl reload

notify-send "Kleuren geupdate!" -t 2000

for service in swaybg waybar foot-server; do
  dinitctl restart "$service"
done

exit 0
