The registry
The registry is the list of applets that may run. The runtime starts nothing that is not in it.
{
"default": "settings",
"applets": [
{
"id": "calculator",
"title": "Calculator",
"titles": { "ru": "Калькулятор" },
"manifestPath": "applets/calculator/Cargo.toml",
"packageName": "calculator",
"window": { "width": 360, "height": 620, "minWidth": 300, "minHeight": 460 }
}
]
}
| Field | Meaning |
|---|---|
id | What the applet is started by (etyde-applet <id>). Lower-case letters, digits and dashes. The window’s app id is etyde-<id>. |
title, titles | The window’s title, and its translations by language code. |
manifestPath, packageName | The crate and its binary. Two entries may share one crate: files and chooser are the same program in two roles, and it tells them apart by NIRVANA_APPLET_ID. |
window | How the window is made (below). |
environment | "full" lets the applet’s process inherit the whole session environment. By default it gets a short list of variables. A terminal needs "full"; a calculator does not. |
media | true allows the window to show local pictures, video and sound (MediaView, Preview, thumbnails). |
webview | true allows <webview> pages inside the window. Only the browser has it. |
The window
| Option | Meaning |
|---|---|
width, height | The size it opens at. |
minWidth, minHeight | How small it may be made. |
resizable | false for a fixed size. |
autoSize | The window follows the size of its content. |
keepAlive | Closing the window hides it and the applet keeps running, to come back at once. |
The shell’s own surfaces (the dock, the lock screen) have a few more options that an ordinary applet has no use for.
Starting an applet
etyde-applet calculator
If the applet is already running, it is asked directly to show its window: no second copy is started.
More than one window
An applet can open further windows. All of them belong to the one process and share its state.
// in event:
"about" => commands.open_window("about", &tr("About"), 420, 280),
// in render:
fn render(&mut self, window: &Window) -> Node {
if window.role.as_deref() == Some("about") {
return self.about();
}
self.main_page()
}
role is a word of your choosing (lower-case letters, digits, dashes). The
first window has no role. window_opened and window_closed tell the applet
when windows come and go; when the last one closes, run returns and the
process ends. An applet that does not end in time is killed.
Windows that stay ready
With "keepAlive": true in the registry:
commands.hide_window()(and the window’s close button) hides the window; the applet keeps running.handle.show_window()brings it back, after a freshrender.- Starting the applet with
--hiddenwarms it up without showing it. - When it is put away, the applet gets
dismisson@host: the moment to clear what should not be there next time.
This is how the launcher opens within a frame. Use it for things that are called up all day, not for ordinary applications: a kept window is memory held.
Glass
Every Nirvana window has an alpha channel. A component that is glass (the
sidebar of a SplitView, the dock, the launcher) is painted with a
translucent fill, and the runtime tells YAWC where it is; the compositor
blurs what is behind it. Outside YAWC nothing is blurred, and the fill alone
reads as a frosted panel.
An applet does not ask for glass: it uses the components that are glass.