Skip to content

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

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

daily-wallpaper: add bar widget, panel, and desktop widget for the caption#410
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.

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.

@github-actions

Copy link
Copy Markdown
Contributor

CC @nzlov

…ption

Bing and NASA both ship a caption alongside their photo of the day, but the
service only used it to build the wallpaper's cache filename, discarding the
text itself. Captures it at the point each source resolves and publishes it
as plugin state, then adds three views: 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.

- 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.
- NASA extraction (image, caption, link) is bounded to a small substring
  around the first gallery item rather than scanning the whole page: the
  original whole-page regex intermittently exceeded Noctalia's per-callback
  CPU budget against the real nasa.gov page.
@jstehn
jstehn force-pushed the add-bar-panel-desktop-widgets branch from 473e200 to e7b0861 Compare August 19, 2026 10:16
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