From 7a61586febeaa3a905f944f41aab22d5bc90fb10 Mon Sep 17 00:00:00 2001 From: Matthias Puchstein Date: Sun, 22 Mar 2026 20:44:18 +0100 Subject: [PATCH] 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 --- dot_config/awww-manager/config.toml.tmpl | 40 ++++++++---------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/dot_config/awww-manager/config.toml.tmpl b/dot_config/awww-manager/config.toml.tmpl index 65bdf91..c46d763 100644 --- a/dot_config/awww-manager/config.toml.tmpl +++ b/dot_config/awww-manager/config.toml.tmpl @@ -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 -}}