2026-06-29 19:31:33 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
# One-shot wallpaper setter for Antergos NeXT
|
|
|
|
|
# Runs at first login via autostart, then disables itself
|
|
|
|
|
|
2026-07-01 18:10:41 +02:00
|
|
|
LOG="/tmp/antergos-wallpaper.log"
|
2026-06-29 19:31:33 +02:00
|
|
|
MARKER="$HOME/.config/antergos-wallpaper-set"
|
2026-07-01 18:10:41 +02:00
|
|
|
WALLPAPER="/usr/share/wallpapers/antergos-wallpaper/contents/images/adwaita-morning.webp"
|
|
|
|
|
|
|
|
|
|
echo "[$(date)] Starting" > "$LOG"
|
2026-06-29 19:31:33 +02:00
|
|
|
|
|
|
|
|
if [[ -f "$MARKER" ]]; then
|
2026-07-01 18:10:41 +02:00
|
|
|
echo "[$(date)] Marker exists, exiting" >> "$LOG"
|
2026-06-29 19:31:33 +02:00
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
2026-07-01 18:10:41 +02:00
|
|
|
if [[ ! -f "$WALLPAPER" ]]; then
|
|
|
|
|
echo "[$(date)] Wallpaper not found: $WALLPAPER" >> "$LOG"
|
|
|
|
|
ls -la /usr/share/wallpapers/antergos-wallpaper/contents/images/ >> "$LOG" 2>&1
|
|
|
|
|
touch "$MARKER"
|
|
|
|
|
exit 1
|
2026-06-29 19:31:33 +02:00
|
|
|
fi
|
|
|
|
|
|
2026-07-01 18:10:41 +02:00
|
|
|
echo "[$(date)] Wallpaper found, applying..." >> "$LOG"
|
|
|
|
|
|
|
|
|
|
# Retry a few times in case desktop isn't ready yet
|
|
|
|
|
for i in 1 2 3; do
|
|
|
|
|
/usr/bin/plasma-apply-wallpaperimage "$WALLPAPER" >> "$LOG" 2>&1
|
|
|
|
|
RC=$?
|
|
|
|
|
echo "[$(date)] plasma-apply-wallpaperimage attempt $i exit code: $RC" >> "$LOG"
|
|
|
|
|
if [[ $RC -eq 0 ]]; then
|
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
sleep 2
|
|
|
|
|
done
|
|
|
|
|
|
2026-06-29 19:31:33 +02:00
|
|
|
touch "$MARKER"
|
2026-07-01 18:10:41 +02:00
|
|
|
echo "[$(date)] Done" >> "$LOG"
|