Files
dotfiles/dot_local/bin/executable_set-wallpapers.tmpl
2026-01-01 18:30:50 +01:00

26 lines
427 B
Bash

#!/usr/bin/env bash
set -euo pipefail
if ! command -v swww >/dev/null 2>&1; then
echo "swww not found in PATH" >&2
exit 1
fi
for _ in {1..50}; do
if swww query >/dev/null 2>&1; then
break
fi
sleep 0.1
done
if ! swww query >/dev/null 2>&1; then
echo "swww-daemon not responding" >&2
exit 1
fi
{{- range .monitors }}
{{- if .wallpaper }}
swww img -o {{ .name }} "{{ .wallpaper }}"
{{- end }}
{{- end }}