Skip to content

feat: Windows Task Scheduler automation scripts for daily wallpaper (refs #106) #119

Description

@Vukung

Overview

While the full CLI tool proposed in #106 is still in development, I've built a lightweight Windows-only automation suite that achieves the core use case right now: generating a fresh Wallendar calendar wallpaper daily, fully automatically, with zero manual effort after a one-time setup.

This is a complementary contribution - not a replacement for #106. It targets Windows power users who want a working solution today.


What's Included

Two files under scripts/daily-wallpaper/:

File Purpose
wallendar_scheduler.py Core Python script - calls /api/create, saves the PNG, sets it as the Windows wallpaper
setup_task_scheduler.bat One-time interactive installer - registers two Windows Task Scheduler tasks

Key Features

  • Zero daily effort - runs at midnight and on every logon via Windows Task Scheduler
  • Background rotation - cycles through all 7 Wallendar sample backgrounds in round-robin order
  • Fixed background mode - optionally pin one background so only the calendar changes each day
  • Resolution presets - supports Desktop HD/FHD/4K and Mobile HD/FHD/4K
  • Interactive setup wizard - the .bat guides the user through configuration with a menu and previews the wallpaper before committing
  • Reconfiguration loop - if the user isn't happy with the result, they can change settings and regenerate without re-running the script
  • Persistent state - preferences are saved to wallendar_state.json so automated runs never prompt interactively
  • Robust error handling - clear timestamped logs, graceful network failure messages, and safe exit codes for Task Scheduler

How It Works

  1. User runs setup_task_scheduler.bat once as Administrator
  2. Selects resolution and background mode interactively
  3. Two tasks are registered: WallendarDailyUpdate (midnight) and WallendarOnLogon (on login + 1 min delay)
  4. Each run: downloads the next background → resizes to target resolution → POSTs to /api/create → saves PNG → applies via SystemParametersInfoW

Relationship to #106

Issue #106 proposes a full cross-platform npx-style CLI. This PR is intentionally narrower in scope:

  • Windows-only (uses ctypes, winreg, Task Scheduler)
  • No npm/Node dependency - pure Python
  • Already working - no CLI framework or publishing pipeline needed
  • Lives under scripts/ rather than a dedicated cli/ workspace

The two can coexist. Once #106 lands, power users can choose between the npm CLI or these scripts.


Requirements

  • Windows 10/11
  • Python 3.8+
  • pip install requests Pillow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions