# snarchio/ewinwallpaper architecture

> Architecture diagram of the GitHub repository snarchio/ewinwallpaper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/snarchio/ewinwallpaper
- Repository: https://github.com/snarchio/ewinwallpaper

## Overview

eWinWallpaper is a single-script Windows utility that selects and applies a Wikimedia Commons featured picture suited to the primary monitor. The script detects display dimensions, fetches and ranks image candidates, downloads and scales the selection, then asks Windows to apply it and checks the result. It also records run transcripts and prunes old logs. The README documents Task Scheduler automation, but its referenced task-definition file is not in the supplied tree; source-level details were unavailable, so the graph reflects documented behavior only.

Main entry points: [`wallpaper.ps1`](https://github.com/snarchio/ewinwallpaper/blob/main/wallpaper.ps1) (Wallpaper script)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_scheduler(("Task Scheduler"))
node_script["Wallpaper script<br/>[wallpaper.ps1]"]
node_display["Screen detection<br/>[wallpaper.ps1]"]
node_commons{{"Wikimedia Commons"}}
node_selection["Image selection<br/>[wallpaper.ps1]"]
node_image["Download and scale<br/>[wallpaper.ps1]"]
node_windows["Windows wallpaper"]
node_verification["Apply verification<br/>[wallpaper.ps1]"]
node_logs["Run logs<br/>[wallpaper.ps1]"]

node_user -->|"runs"| node_script
node_scheduler -.->|"runs daily"| node_script
node_script -->|"detects resolution"| node_display
node_display -->|"provides dimensions"| node_selection
node_script -->|"queries"| node_commons
node_commons -->|"provides candidates"| node_selection
node_selection -->|"chooses image"| node_image
node_image -->|"saves wallpaper"| node_windows
node_script -->|"sets wallpaper"| node_windows
node_script -->|"confirms application"| node_verification
node_verification -->|"checks applied state"| node_windows
node_script -->|"records transcript"| node_logs
node_script -->|"prunes old logs"| node_logs

click node_script "https://github.com/snarchio/ewinwallpaper/blob/main/wallpaper.ps1"
click node_display "https://github.com/snarchio/ewinwallpaper/blob/main/wallpaper.ps1"
click node_selection "https://github.com/snarchio/ewinwallpaper/blob/main/wallpaper.ps1"
click node_image "https://github.com/snarchio/ewinwallpaper/blob/main/wallpaper.ps1"
click node_verification "https://github.com/snarchio/ewinwallpaper/blob/main/wallpaper.ps1"
click node_logs "https://github.com/snarchio/ewinwallpaper/blob/main/wallpaper.ps1"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user,node_display toneBlue
class node_scheduler toneRose
class node_script,node_selection,node_image,node_verification,node_logs toneTeal
class node_commons,node_windows toneIndigo
```

## Components

### Other components

- **User**
- **Task Scheduler**
- [Wallpaper script](https://github.com/snarchio/ewinwallpaper/blob/main/wallpaper.ps1): `wallpaper.ps1`
- [Screen detection](https://github.com/snarchio/ewinwallpaper/blob/main/wallpaper.ps1): `wallpaper.ps1`
- **Wikimedia Commons**
- [Image selection](https://github.com/snarchio/ewinwallpaper/blob/main/wallpaper.ps1): `wallpaper.ps1`
- [Download and scale](https://github.com/snarchio/ewinwallpaper/blob/main/wallpaper.ps1): `wallpaper.ps1`
- **Windows wallpaper**
- [Apply verification](https://github.com/snarchio/ewinwallpaper/blob/main/wallpaper.ps1): `wallpaper.ps1`
- [Run logs](https://github.com/snarchio/ewinwallpaper/blob/main/wallpaper.ps1): `wallpaper.ps1`

## Connections

- User → Wallpaper script: runs (evidence: `README.md`)
- Task Scheduler → Wallpaper script: runs daily (evidence: `README.md`)
- Wallpaper script → Screen detection: detects resolution (evidence: `README.md`)
- Screen detection → Image selection: provides dimensions (evidence: `README.md`)
- Wallpaper script → Wikimedia Commons: queries (evidence: `README.md`)
- Wikimedia Commons → Image selection: provides candidates (evidence: `README.md`)
- Image selection → Download and scale: chooses image (evidence: `README.md`)
- Download and scale → Windows wallpaper: saves wallpaper (evidence: `README.md`)
- Wallpaper script → Windows wallpaper: sets wallpaper (evidence: `README.md`)
- Wallpaper script → Apply verification: confirms application (evidence: `README.md`)
- Apply verification → Windows wallpaper: checks applied state (evidence: `README.md`)
- Wallpaper script → Run logs: records transcript (evidence: `README.md`)
- Wallpaper script → Run logs: prunes old logs (evidence: `README.md`)
