xenon-widgets

v1.2.0
io.github.marcimastro98/xenon-widgets Checked 2 hours ago Published 1 day ago

Widgets, themes and animated backgrounds for the Xenon dashboard: SDK, install, errors, screenshots.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

xenon_status

Check that Xenon is running on this computer and ready for widgets: its version, the Widget SDK version, whether community widgets are on and whether a dashboard is open. Call it first.

sdk_reference

Read the Xenon Widget SDK reference: the manifest, the message protocol, data streams, actions, storage, sizing and the sandbox rules. With no section you get the table of contents. Read it before writing a widget.

ParameterTypeDescription
sectionstringA section name from the table of contents.

new_widget

Write a working starter widget (manifest, HTML, CSS, JS showing live CPU and memory) into a new or empty folder. Edit it from there, then install_widget.

ParameterTypeDescription
folder *stringAbsolute path of the widget folder (the one holding manifest.json). Its name is the widget id unless `id` is given.
bitbooleanA widget that draws the person's own Bit (Xenon 5.3): the "bit" stream and action, and bit-kit.js, the Bit engine the widget loads before its script.
idstringWidget id: 2 to 41 characters, a-z, 0-9 and dashes.
namestringThe name people see. Defaults to the id.
overwritebooleanReplace files with the same names in a folder that is not empty.
pumpbooleanAlso made for the round screen on an AIO pump cooler (Xenon 5.3): manifest "pump": true and a layout that stays inside the circle.
pumpStylebooleanA whole pump screen's style (Xenon 5.3), offered beside Xenon and Gauge: "pump" and "pumpStyle" in the manifest, and the widget draws the line placement.line names and moves the ring of lights with pu…
sizestringTile size. Defaults to medium.

check_widget

Run the checks Xenon runs before installing, without installing: the package rules, what the sandbox will refuse (inline scripts, remote code, hosts) and the Store's review notes.

ParameterTypeDescription
folder *stringAbsolute path of the widget folder (the one holding manifest.json). Its name is the widget id unless `id` is given.
idstringWidget id: 2 to 41 characters, a-z, 0-9 and dashes.

install_widget

Install or update the widget from its folder put it on the dashboard and show its page (a new page when the one in view is full). Permissions it asks for still wait for the person to approve them on the dashboard. Then call widget_issues and widget_screenshot.

ParameterTypeDescription
folder *stringAbsolute path of the widget folder (the one holding manifest.json). Its name is the widget id unless `id` is given.
idstringWidget id: 2 to 41 characters, a-z, 0-9 and dashes.

widget_issues

What went wrong in an installed widget while it ran: errors and console.error lines, requests the sandbox blocked, whether its permissions are approved, how heavy it is, and what its tile cuts off (fit: a part past the edge of the tile, text its box cuts or that runs out of it, by class name and pixels, measured a few seconds after it drew; an empty list means it all fits). Errors thrown in widget code show as "Script error." because of the sandbox: wrap code in try/catch and console.error the message to see it.

ParameterTypeDescription
id *stringWidget id: 2 to 41 characters, a-z, 0-9 and dashes.

widget_screenshot

A picture of the widget's tile as it is on screen now. Anything on top of the dashboard shows too. Not available on Linux under Wayland.

ParameterTypeDescription
id *stringWidget id: 2 to 41 characters, a-z, 0-9 and dashes.

my_widgets

List the widgets the person made (not Store downloads). With an id and a folder, write that widget's files into the folder to keep working on it.

ParameterTypeDescription
folderstringWith id: a new or empty folder to write the widget into.
idstringWidget id: 2 to 41 characters, a-z, 0-9 and dashes.
overwritebooleanReplace files with the same names in a folder that is not empty.

share_widget

A share code for one of the person's own widgets, which anyone can paste into Xenon, plus the Store review notes. To put it in the Store the person sends it from xenon-app.com/submit.

ParameterTypeDescription
id *stringWidget id: 2 to 41 characters, a-z, 0-9 and dashes.

preset_reference

Read the exact rules of a theme, animated background or other share code (Xenon 5.3): every field, its range and a minimal valid example. With no kind you get the list of kinds. Read it before writing one. Widgets have their own tools (sdk_reference, new_widget).

ParameterTypeDescription
kindstringtheme (colours, glass, fonts of the whole dashboard), bg (an animated background), bundle (a package: theme + bg + pages + more), page, deck, topbar, icons, ambient-layout (a native Ambient scene).

check_preset

Check a theme, animated background or other share code without opening it (Xenon 5.3): what the import would drop or change, design and performance notes, and the share code anyone can paste in Xenon.

ParameterTypeDescription
data *objectThe preset itself, as preset_reference describes it for this kind.
kind *stringtheme (colours, glass, fonts of the whole dashboard), bg (an animated background), bundle (a package: theme + bg + pages + more), page, deck, topbar, icons, ambient-layout (a native Ambient scene).
codeFilestringAbsolute path of a .js file holding a background's code (the body that defines draw(ctx, t, w, h), and optionally drawFront(ctx, t, w, h) for what falls in front of the widgets). It goes into data.cod…
namestringThe name people see.

import_preset

Open a theme, animated background or other share code in Xenon's import window on the dashboard (Xenon 5.3). The person reviews and confirms it there; nothing changes before that. Then call dashboard_screenshot.

ParameterTypeDescription
data *objectThe preset itself, as preset_reference describes it for this kind.
kind *stringtheme (colours, glass, fonts of the whole dashboard), bg (an animated background), bundle (a package: theme + bg + pages + more), page, deck, topbar, icons, ambient-layout (a native Ambient scene).
codeFilestringAbsolute path of a .js file holding a background's code (the body that defines draw(ctx, t, w, h), and optionally drawFront(ctx, t, w, h) for what falls in front of the widgets). It goes into data.cod…
namestringThe name people see.

dashboard_screenshot

A picture of the whole Xenon dashboard as it is on screen now, to see a theme or background after the person confirmed it (Xenon 5.3). Anything on top of the dashboard shows too. Not available on Linux under Wayland.