Skip to content

Add ImageMagick Clock plugin#46

Merged
ItsLemmy merged 6 commits into
noctalia-dev:mainfrom
jinliu:feature/imagemagick-clock
Jul 19, 2026
Merged

Add ImageMagick Clock plugin#46
ItsLemmy merged 6 commits into
noctalia-dev:mainfrom
jinliu:feature/imagemagick-clock

Conversation

@jinliu

@jinliu jinliu commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Plugin

  • Id: jinliu/imagemagick-clock
  • New plugin
  • Update to an existing plugin (version bumped in plugin.toml)

What it does

ImageMagick Clock draws a custom clock using ImageMagick (or any other CLI image drawing tool).

External dependencies

imagemagick

Testing

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Noctalia version tested against: v5.0.0-beta.3
  • Plugin API level: 3

Screenshots / Videos

图片

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.

Copilot AI review requested due to automatic review settings July 18, 2026 14:57
@jinliu
jinliu force-pushed the feature/imagemagick-clock branch from f6d3e7b to c06df8a Compare July 18, 2026 14:59

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

Adds a new community plugin (jinliu/imagemagick-clock) that renders a bar clock by shelling out to ImageMagick (or another CLI renderer) to generate an image and display it in the widget.

Changes:

  • Introduces a new Luau bar widget that generates clock-face images on an interval and updates the displayed image.
  • Adds initial plugin manifest (plugin.toml) and user-facing documentation (README.md) for configuration and requirements.
  • Adds English settings translations for the widget configuration UI.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 9 comments.

File Description
imagemagick-clock/widget.luau Implements the async image generation + widget update + click behavior.
imagemagick-clock/plugin.toml Declares plugin metadata, widget entry, settings, and dependencies.
imagemagick-clock/README.md Documents usage, requirements, and settings for the plugin.
imagemagick-clock/translations/en.json Provides English labels/descriptions for settings.

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

Comment thread imagemagick-clock/plugin.toml Outdated
Comment thread imagemagick-clock/plugin.toml
Comment thread imagemagick-clock/plugin.toml
Comment thread imagemagick-clock/plugin.toml
Comment thread imagemagick-clock/README.md Outdated
Comment thread imagemagick-clock/translations/en.json
Comment thread imagemagick-clock/widget.luau
Comment thread imagemagick-clock/widget.luau
Comment thread imagemagick-clock/README.md Outdated
@jinliu
jinliu force-pushed the feature/imagemagick-clock branch 2 times, most recently from 510a7f7 to 2f7714e Compare July 18, 2026 15:05
ImageMagick Clock draws a custom clock using ImageMagick (or any other CLI image drawing tool).
@jinliu
jinliu force-pushed the feature/imagemagick-clock branch from 2f7714e to 3706c25 Compare July 18, 2026 15:07
@ItsLemmy

Copy link
Copy Markdown
Contributor

• 1. blocking - imagemagick-clock/widget.luau:44
imagemagick-clock/widget.luau:58

The move of next.png and generation of the following image run concurrently on independent worker threads. Generation can truncate or open next.png before the move finishes, causing current.png to contain a partial or future image and leaving no next.png for the following update. Start the next generation from the move callback, or use unique temporary filenames.

  1. blocking - imagemagick-clock/widget.luau:5

When XDG_RUNTIME_DIR is unavailable, the plugin uses the predictable shared path /tmp/imagemagick-clock without verifying ownership or securely creating it. Another local user could pre-create that directory and plant next.png as a symlink, causing ImageMagick to overwrite another user-writable file. Use
a private per-plugin directory such as noctalia.pluginDataDir(), or securely create a user-specific temporary directory.

  1. blocking - imagemagick-clock/plugin.toml:9
    imagemagick-clock/widget.luau:23
    imagemagick-clock/widget.luau:44

The manifest declares only imagemagick, but the plugin also executes mkdir and mv. Repository policy requires every external command to be declared in dependencies and documented under README requirements. Add both commands and their README entries.

  1. non-blocking - imagemagick-clock/README.md:26
    imagemagick-clock/plugin.toml:21

The command described as the default is not the manifest default. The documented command uses 300x110 with day/month-name/year, while the actual default uses 270x100 with month/day/weekday. Synchronize the example so users see the behavior they are being told to expect.

Also please regenerate the thumbnail with the generator, I made the title font dynamic to avoid overlapping on the screenshot, so it should look a bit better.

@ItsLemmy
ItsLemmy marked this pull request as draft July 18, 2026 23:01
@jinliu
jinliu marked this pull request as ready for review July 19, 2026 08:20
@jinliu
jinliu requested a review from Copilot July 19, 2026 08:20

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

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Comment thread imagemagick-clock/widget.luau
Comment thread imagemagick-clock/widget.luau
@ItsLemmy

Copy link
Copy Markdown
Contributor

Thank you!

@ItsLemmy
ItsLemmy merged commit 493365b into noctalia-dev:main Jul 19, 2026
1 check passed
@jinliu
jinliu deleted the feature/imagemagick-clock branch July 19, 2026 13:14
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.

3 participants