[Unit]
Description=Wallpaper setter ({{ wallpaper_engine }})

[Service]
Type=simple
{% if wallpaper_engine == 'swaybg' %}
ExecStart={{ xdg_dir.libexec_dir }}/wayland/launch_wallpaper
{% elif wallpaper_engine == 'swww' %}
ExecStartPre=rm -rf {{ xdg_dir.cache_home }}/swww {{ ansible_env.XDG_RUNTIME_DIR }}/swww.socket
ExecStart=/usr/bin/swww-daemon
ExecStartPost={{ xdg_dir.libexec_dir }}/wayland/launch_wallpaper
{% endif %}
Restart=on-failure
RestartSec=2
