awww: make config template-driven from data.monitors

Replaces hardcoded outputs with a range over .chezmoi.config.data.monitors,
using optional wallpaper-dir, wallpaper-resize, wallpaper-filter, and
wallpaper-transition-type keys per monitor entry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthias Puchstein
2026-03-22 20:44:18 +01:00
parent f97689afb3
commit 7a61586feb

View File

@@ -8,33 +8,19 @@ backend = "swww"
# transition_fps = 30
# transition_duration = 3
# fill_color = "000000ff"
{{ range .chezmoi.config.data.monitors }}
[[output]]
name = "DP-1"
name = "{{ .name }}"
mode = "cycle"
dir = "~/.config/wallpaper/dp-1"
dir = "{{ if index . "wallpaper-dir" }}{{ index . "wallpaper-dir" }}{{ else }}~/.config/wallpaper/{{ .name | lower }}{{ end }}"
extensions = ["png", "jpg", "jpeg", "gif", "webp"]
# Optional per-output overrides:
# resize = "crop"
# filter = "Lanczos3"
# transition_type = "simple"
[[output]]
name = "DP-2"
mode = "cycle"
dir = "~/.config/wallpaper/dp-2"
extensions = ["png", "jpg", "jpeg", "gif", "webp"]
# Optional per-output overrides:
# resize = "crop"
# filter = "Lanczos3"
# transition_type = "simple"
[[output]]
name = "HDMI-A-2"
mode = "cycle"
dir = "~/.config/wallpaper/hdmi-a-2"
extensions = ["png", "jpg", "jpeg", "gif", "webp"]
# Optional per-output overrides:
# resize = "crop"
# filter = "Lanczos3"
# transition_type = "simple"
{{- if index . "wallpaper-resize" }}
resize = "{{ index . "wallpaper-resize" }}"
{{- end }}
{{- if index . "wallpaper-filter" }}
filter = "{{ index . "wallpaper-filter" }}"
{{- end }}
{{- if index . "wallpaper-transition-type" }}
transition_type = "{{ index . "wallpaper-transition-type" }}"
{{- end }}
{{ end -}}