Reference · Panelith 0.1.0 · plain HTML edition; the interactive edition has search and live examples
Command
On this page 3 sections
A Command is an entry in the command bar, with an optional hotkey and a scope; run(ctx) returns actions. See Commands, hotkeys and the launcher.
Attributes#
| Attribute | Type | Default | What it changes |
|---|---|---|---|
id |
str |
required | the id: what run_builtin, row_action and the bar refer to; <kind>.new replaces a generated opener |
title |
str |
'' |
the entry in the bar |
keywords |
str |
'' |
extra text the bar's search matches |
hotkey |
str | None |
None |
the key under the app's modifiers: "g", "\\", "left", "ctrl+]" — Options: 22 optionsa letter or digit \ - = [ ] ; ' , . / |
scope |
str |
'global' |
'global' or 'kind:global · kind:<kind id> |
launcher |
bool |
False |
the launcher shows a tile for this command |
launcher_label |
str | None |
None |
the tile's caption |
launcher_glyph |
str | Glyph | None |
None |
the tile's icon — Options: 49 optionsring square table list grid form file gear bolt star home info bell calendar database globe image play book user chat flask dollar key cube math code prompt terminal output graph chart plot solve steps puzzle puzzle-left puzzle-right text document pen author checklist report timer clipboard folder search commandsGlyph(...); pictured in Glyphs |
launcher_color |
str | None |
None |
the tile's colour |
launcher_tip |
str | None |
None |
the tile's tooltip |
launcher_group |
str | None |
None |
a heading the launcher groups the tile under |
abstract |
bool |
False |
keeps a base class out of the registry |
Hooks and methods#
run#
run(self, ctx: Context) -> Any
Do the command's work and return actions (one, a list, or None). A
list row arrives in ctx.args["row"]; a scoped command finds the focused
pane in ctx.cid.
spec#
spec(modifiers: list[str]) -> s.CommandSpec
OpenKindCommand#
<kind>.new: open a pane of kind in the focused pane. One is generated
for every launcher kind that has no explicit opener, so the launcher tile and
the > command stay one thing.