Skip to content

daily-wallpaper: add bar widget, panel, and desktop widget for the caption - #409

Closed
jstehn wants to merge 1 commit into
noctalia-dev:mainfrom
jstehn:add-bar-panel-desktop-widgets
Closed

daily-wallpaper: add bar widget, panel, and desktop widget for the caption#409
jstehn wants to merge 1 commit into
noctalia-dev:mainfrom
jstehn:add-bar-panel-desktop-widgets

Conversation

@jstehn

@jstehn jstehn commented Aug 19, 2026

Copy link
Copy Markdown

Plugin

  • Id: nzlov/daily-wallpaper
  • New plugin
  • Update to an existing plugin (version bumped in plugin.toml)

What it does

Bing and NASA both ship a caption alongside their photo of the day, but the
service only ever used it to build the wallpaper's cache filename — the text
itself was discarded. This adds three pure-view surfaces that show it: a bar
widget (glyph + optional short caption; click opens the panel), a panel with
the full caption, credit, and a "learn more" link, and a matching desktop
widget card. The background service is unchanged in what it fetches; it now
additionally captures and publishes the caption at the point each source
resolves.

  • Bing's copyright field (e.g. "Caption text (© Photographer/Source)") is
    split into a title and a credit.
  • NASA's gallery-item caption has no separate credit line, so credit stays
    empty; its own article link is used as "learn more" instead of Bing's quiz
    link.
  • Metadata is (re-)fetched even when today's image is already cached (e.g.
    after a process restart before this session ever resolved a source), so
    the caption doesn't stay blank until the next day's fetch.

Also fixes a real bug found while testing the NASA path, unrelated to the
caption feature itself: the pre-existing primary-image regex scanned the
whole page with a lazy .- span, and intermittently exceeded Noctalia's
per-callback CPU budget against the real nasa.gov page (confirmed live —
same line, unmodified from main, before I touched it). All three NASA
extractions (image, caption, link) are now bounded to a small substring
around the first gallery item instead.

Smaller fix: panel height 320 → 250, closer to the actual content size.

External dependencies

Adds xdg-open (from xdg-utils) for the panel's "Learn more" button, opening
the caption's source link. Already declared in dependencies in plugin.toml.

Testing

  • Tested on Hyprland
  • Tested on Niri
  • Tested on Sway
  • Tested on another compositor:
  • Noctalia version tested against: 5.0.0
  • Plugin API level: 3

Tested live via a path plugin source pointing at this branch, on both
source = "bing" (the default) and source = "nasa": noctalia plugins lint and the repo's own validate-plugins.py both pass; the existing
wallpaper-download/apply behavior is unaffected for either source
(Daily Wallpaper applied: ... logs and the wallpaper is actually set,
confirmed by screenshot for both); the today state publishes the correct
title/credit for both sources on a fresh resolve and on a forced refresh
via noctalia msg plugin nzlov/daily-wallpaper:service all refresh; the
panel opens/closes with no runtime errors for either source; the NASA
CPU-budget fix was confirmed by reproducing the original error live, then
confirming it's gone after the fix, across several repeated refreshes.

Screenshots / Videos

Not yet included — opening as Draft for that reason. I have real
screenshots from live testing (bar widget + desktop widget on Bing, panel
open on both Bing and NASA), but I'd rather have a person look at what's in
frame before anything from a live desktop goes into a public PR. Will add
before this comes out of Draft.

Checklist

  • The directory name matches the part of id after the / in plugin.toml exactly.
  • It ships plugin.toml, README.md, thumbnail.webp, and translations/en.json.
  • README.md follows the README template, documents every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
  • I created thumbnail.webp with the thumbnail generator. (Unchanged from the existing plugin — happy to update if maintainers want the new surfaces reflected.)
  • version follows semver and is bumped in this PR; plugin_api is the oldest API level this plugin requires.
  • Every non-English translation in this PR uses a locale supported by Noctalia core, and I can read, write, and understand that language well enough to review and maintain it (no unreviewed machine/LLM translations).
  • I did not edit catalog.toml; CI generates it.
  • This PR touches exactly one plugin directory.

Code review attestation

  • The code is readable and not obfuscated, minified, or generated.
  • It does not download and execute remote code.
  • Every network call, filesystem write, and spawned process is something the description above accounts for.
  • I have the right to publish this code under the license declared in plugin.toml.

…ption

Bing and NASA both ship a caption with their photo of the day, but the
service only ever used it to build the wallpaper filename before now,
discarding the actual text. Captures it at the point each source resolves
and publishes it as plugin state, then adds three pure-view surfaces to
show it: a bar glyph (click opens the panel), a panel with the full
caption/credit/"learn more" link, and a matching desktop widget card.

- Bing's `copyright` field is split into a title and a "(© ...)" credit.
- NASA's gallery-item caption has no separate credit line; its own
  article link is used as "learn more" instead of the Bing quiz link.
- Metadata is fetched even when the day's image is already cached (e.g.
  after a process restart), independent of the download step.
@github-actions

Copy link
Copy Markdown
Contributor

This pull request was automatically closed because its description no longer contains
every part of the pull request template
that this repository requires.

Missing:

  • the checklist entry: README.md follows the README template, documents every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
  • the checklist entry: I created thumbnail.webp with the thumbnail generator.
  • the checklist entry: version follows semver and is bumped in this PR; plugin_api is the oldest API level this plugin requires.

Please add the items listed above back to the description, keeping their exact wording, then
reopen the pull request. Reopening re-runs this check. Draft pull requests may leave boxes
unchecked. Before a pull request is ready for review, exactly one plugin type, at least one
tested compositor, and every item under Checklist and Code review attestation must be checked.

@github-actions github-actions Bot closed this Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CC @nzlov

@jstehn

jstehn commented Aug 19, 2026

Copy link
Copy Markdown
Author

This PR was auto-closed by the template-enforcement bot (I'd paraphrased a few checklist lines instead of keeping their exact wording). GitHub's reopen API is refusing this one for some reason without a specific error, so continuing here instead: #410

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant