Skip to content

feat(fetcher): add fetchers needed by 0.x presets (weather / git_repo_name / github_repo / github_avatar / system Text / clock format) #81

Closed

Description

@unhappychoice

Tracks #76 (0.x release scope).

Background

Round out the fetchers needed for the hero / subtitle / ambient structure of the 0.x presets (#77). Not a new fetcher family — just the minimum filler required to build the presets.

New / extended

New: weather (cached, Safety::Safe)

Call Open-Meteo (no API key — just hit lat/lon) at a fixed host. Config takes no URL (→ Safe classification holds).

  • Shape: Entries (primary) — temp / condition / wind / humidity
  • Options: latitude / longitude / units ("metric" | "imperial")
  • Example output:
🌦 cloudy   18°C
💨 wind     4 m/s
💧 humidity 67%

New: git_repo_name (cached, Safety::Safe)

Pull repo name from the git remote and return it as Text. Reuses src/fetcher/github/common.rs::slug_from_url.

  • Shape: Text
  • Fallback chain: git remote origin → CWD basename → "project"
  • Used by: project_github_activity hero (giant ASCII repo name)

New: github_repo (cached, Safety::Safe)

Identity triple (slug / description / license) sourced from the GitHub REST API /repos/{o}/{n}. Entries for grid_table; TextBlock for stacked lines; Text for a ·-joined subtitle.

  • Shape: Entries (primary) / TextBlock / Text
  • Source: GitHub REST /repos/{owner}/{name} (host-fixed → Safe)
  • Example output:
slug        unhappychoice/splashboard
description terminal splash renderer
license     ISC

New: github_avatar (cached, Safety::Safe)

Fetch the github.com avatar → save to cache → return its local path as Image shape.

  • Shape: Image
  • Options: user (default: $GITHUB_USER env → inferred from git config user.email)
  • Fetch URL: https://github.com/<user>.png?size=200 (fixed host)
  • Long cache TTL (1 week); refresh via a manual splashboard fetch-style trigger.

Extension: Text shape on system fetcher

The existing system emits Entries only. Add a Text variant for hero use:

  • New shape: Text
  • New option: kind — "terminal" | "os" | "os_version" | "hostname" | "shell" | "arch"
  • Detection logic for kind = "terminal" — env-var heuristics:
    • $WT_SESSION → "Windows Terminal"
    • $TERM_PROGRAM=iTerm.app → "iTerm2"
    • $TERM_PROGRAM=Apple_Terminal → "Terminal"
    • $TERM_PROGRAM=ghostty / $GHOSTTY_RESOURCES_DIR → "Ghostty"
    • $TERM=xterm-kitty / $KITTY_WINDOW_ID → "Kitty"
    • $ALACRITTY_WINDOW_ID / $ALACRITTY_LOG → "Alacritty"
    • $WEZTERM_PANE / $TERM_PROGRAM=WezTerm → "WezTerm"
    • $TERM_PROGRAM=Hyper → "Hyper"
    • $TERM_PROGRAM=vscode → "VS Code"
    • Fallback: "terminal"
  • kind = "os" → sysinfo's System::name() ("Linux" / "macOS" / "Windows")
  • kind = "os_version" → System::name() + " " + System::long_os_version() ("macOS 14.3" / "Arch Linux")
  • kind = "hostname" → System::host_name()
  • kind = "shell" → basename of $SHELL
  • kind = "arch" → std::env::consts::ARCH
  • Used by: home_splash hero (terminal name) + attribution line ("powered by macOS 14.3")

Extension: format string option on clock

Needed for the home_daily date line (23 April 2026 · Thursday).

  • New option: format — strftime-style template ("%e %B %Y · %A")
  • Applies to the existing Text shape. When unset, falls back to the legacy HH:MM output.

Definition of Done

Out of scope

  • Avatar support for additional forges (gitlab / bitbucket / gitea)
  • Multi-day weather forecast / high-density icon display (Entries is enough)
  • Non-GitHub forges for github_repo (gitlab / bitbucket / gitea in a follow-up)
  • Calendar event fetching (ICS / Google Calendar) — 0.x uses static + read_store instead

Activity

  1. added
    widget
    feat
    on Apr 22, 2026
  2. changed the title [-]feat(fetcher): add fetchers needed by 0.x presets (weather / project_name / project / github_avatar / system Text / clock format)[/-] [+]feat(fetcher): add fetchers needed by 0.x presets (weather / git_repo_name / github_repo / github_avatar / system Text / clock format)[/+] on Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featwidget

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions