Skip to content

feat(better-clock): add digital clock widget - #265

Draft
yugaaank wants to merge 6 commits into
noctalia-dev:mainfrom
yugaaank:better-clock-clean
Draft

feat(better-clock): add digital clock widget#265
yugaaank wants to merge 6 commits into
noctalia-dev:mainfrom
yugaaank:better-clock-clean

Conversation

@yugaaank

@yugaaank yugaaank commented Aug 5, 2026

Copy link
Copy Markdown

Plugin

  • Id: yugaaank/better-clock

  • Noctalia version tested against: 5.0.0-beta.7

  • Plugin API level: 19

  • New plugin

  • Update to an existing plugin (version bumped in plugin.toml)

What it does

A minimal digital clock desktop widget with customizable time and date format strings. Uses noctalia.formatTime() for locale-aware formatting with a monospace font and primary color palette.

External dependencies

None

Testing

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:

Screenshots / Videos

Desktop widget showing time and date below it.

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.
  • 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

Plugins run as trusted, unsandboxed Luau in the user's session. Confirm:

  • 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.

- Customizable time and date format strings
- Toggle date visibility via settings
- Uses noctalia.formatTime() for locale-aware formatting
- Lightweight, no dependencies, zero configuration
- Monospace font, primary color palette
@ItsLemmy

ItsLemmy commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
  1. blocking - better-clock/thumbnail.webp
    The thumbnail is a generic template image reading "Example - A minimal
    reference plugin" with a "Demo" button. It does not depict the Better
    Clock widget or any clock-related content. Thumbnails should represent
    the actual plugin.

  2. non-blocking - better-clock/widget.luau:5,12
    Labels are constructed with value = "" but updated via .text.
    Every other plugin in the repository uses text in the ui.label
    constructor (e.g. todo/panel.luau, w-engine/w-engine-panel.luau).
    value is likely an unrecognized property and may result in no
    initial content or a runtime warning.

  3. non-blocking - better-clock/widget.luau:2,7,14
    Properties use snake_case (font_size, h_align, v_align) while
    every other plugin in the repository uses camelCase (fontSize,
    fontWeight). If the API does not alias these, the properties will
    be silently ignored, resulting in default sizing and alignment.

  4. non-blocking - better-clock/README.md:14
    README states the widget "updates every 30 seconds" but
    widget.luau:29 creates the timer with a 1000ms (1 second) interval.

  5. non-blocking - better-clock/widget.luau:29
    The timer handle is assigned to a local variable timer that is
    never referenced again. If cleanup or cancellation is expected on
    widget teardown, this is a potential resource leak. Minor for a
    simple clock widget.

@ItsLemmy
ItsLemmy marked this pull request as draft August 5, 2026 21:52
@yugaaank

yugaaank commented Aug 6, 2026

Copy link
Copy Markdown
Author

I've addressed the feedback from the review:

  1. Thumbnail: Updated to a 960x540 WebP image showing a simple 12:34 clock representation.
  2. Labels: Changed value to text in ui.label constructors.
  3. Properties: Changed snake_case properties (font_size, h_align, v_align) to camelCase (fontSize, hAlign, vAlign).
  4. Timer: Updated the interval from 1000ms to 30000ms (30 seconds) to match the documentation.
  5. Memory Leak: Removed the unused local timer = variable assignment.

@spiros132
spiros132 force-pushed the main branch 5 times, most recently from 8d53319 to d59cdac Compare August 7, 2026 22:57
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