Skip to content

add widget overlay system with some sample widgets - #733

Open
nunomdc wants to merge 7 commits into
fatihak:mainfrom
nunomdc:wip-screen_overlays
Open

add widget overlay system with some sample widgets#733
nunomdc wants to merge 7 commits into
fatihak:mainfrom
nunomdc:wip-screen_overlays

Conversation

@nunomdc

@nunomdc nunomdc commented Jul 29, 2026

Copy link
Copy Markdown

Introduces a new widget concept to InkyPi: lightweight overlays rendered on top of plugin-generated images. Widgets can be positioned, reordered, and configured independently from plugins through the web UI.

What's new

Widget system

  • src/widgets/ directory: new widget layer with BaseWidget, a registry (widget_registry.py), and utilities (widget_utils.py)
  • Widgets render as transparent RGBA overlays composited on top of the active plugin image
  • Automatic contrast color calculation: widgets can opt in to get black/white text auto-selected for readability against the background
  • New Widgets page (widgets.html, widget_settings.html) added to the Web UI

Built-in sample widgets

  • Date widget: displays the current date with configurable font size and color
  • IP address widget: displays the device's local IP address
  • Static message widget: displays a user-defined text string

CLI installer

  • New inkypi-widget script: mirrors inkypi-plugin
  • inkypi widget <subcommand> route added to the main inkypi entry script

Screenshots

Widget overlays

image

Widget UI

image

Copilot AI review requested due to automatic review settings July 29, 2026 23:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new widget overlay layer that renders lightweight RGBA overlays on top of plugin-generated images, along with a Web UI for enabling/reordering/configuring widgets and a CLI installer for managing widget installs.

Changes:

  • Adds a widget framework (BaseWidget, widget registry, widget composition utilities) and integrates widget rendering into refresh flows.
  • Adds Web UI pages for widget management and per-widget settings, plus a navigation entry + icon.
  • Adds built-in sample widgets (date, IP address, static message), developer docs, and an inkypi widget CLI.

Reviewed changes

Copilot reviewed 24 out of 27 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
tests/test_widgets.py Adds API + utility tests for widget endpoints and contrast-color behavior.
src/widgets/widget_registry.py Introduces widget loading/registry patterned after plugin registry.
src/widgets/static_message/widget-info.json Declares metadata for the static message widget.
src/widgets/static_message/static_message.py Implements the static message widget image generation.
src/widgets/static_message/settings.html Adds per-widget settings UI for the static message widget.
src/widgets/ip_address/widget-info.json Declares metadata for the IP address widget.
src/widgets/ip_address/ip_address.py Implements the IP address widget image generation.
src/widgets/date_widget/widget-info.json Declares metadata for the date widget.
src/widgets/date_widget/settings.html Adds per-widget settings UI for the date widget.
src/widgets/date_widget/date_widget.py Implements the date widget image generation.
src/widgets/base_widget/settings.html Base widget settings template (currently empty).
src/widgets/base_widget/base_widget.py Adds BaseWidget abstraction for widget implementations.
src/widgets/init.py Establishes widgets package initialization.
src/utils/widget_utils.py Implements widget overlay layout, contrast sampling, and composition.
src/utils/image_utils.py Adds calculate_contrast_color() helper for widgets.
src/templates/widgets.html Adds Widgets management page (enable/disable/reorder + global settings).
src/templates/widget_settings.html Adds per-widget settings page shell and contrast toggle UI.
src/templates/inky.html Adds Widgets navigation button to main UI.
src/static/icons/widgets.svg Adds Widgets icon.
src/refresh_task.py Applies widgets during refresh and when using cached images.
src/inkypi.py Loads widgets and registers widget blueprint + template directory.
src/config.py Adds widget discovery (read_widgets_list) and accessors.
src/blueprints/widget.py Adds widget management + settings API and pages.
src/blueprints/plugin.py Applies widgets to “update now” plugin image generation.
install/inkypi Adds inkypi widget command routing.
install/cli/inkypi-widget Adds widget installer/uninstaller/list CLI.
docs/building_widgets.md Adds documentation for building and integrating widgets.
Comments suppressed due to low confidence (1)

src/templates/widget_settings.html:52

  • widget_settings.html references widget.name, but widget metadata uses display_name; this will leave the settings page header blank/undefined.
                    <h1 class="app-title">{{ widget.name }}</h1>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/templates/widget_settings.html Outdated
Comment thread src/blueprints/widget.py Outdated
Comment thread src/blueprints/widget.py
Comment thread src/blueprints/widget.py
Comment thread src/blueprints/widget.py
Comment thread src/widgets/date_widget/date_widget.py Outdated
Comment thread src/widgets/ip_address/ip_address.py Outdated
Comment thread src/utils/image_utils.py
Comment thread install/cli/inkypi-widget
Comment thread src/widgets/static_message/settings.html Outdated
nunomdc and others added 3 commits July 31, 2026 22:47
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Nuno Duarte <nunomdc@gmail.com>
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.

2 participants