Make plugins›Settings, menus and texts

How extensions add settings pages, sections and song menu entries, hide settings rows and rename Glyph's texts.

Extensions change Glyph's interface through the manifest. Glyph draws everything with its own controls, so a plugin's rows look exactly like Glyph's. Anything a plugin adds names the plugin.

Settings

settings is a list of sections. Each section has rows (items) and a place (page):

"settings": [
  {
    "id": "account",
    "title": { "en": "Last.fm account", "de": "Last.fm-Konto" },
    "items": [
      { "id": "user", "type": "text", "label": "User name", "placeholder": "your-name" },
      { "id": "connect", "type": "button", "label": "Connection", "caption": "Connect" }
    ]
  },
  {
    "id": "quick",
    "page": "playback",
    "after": "sp.crossfade",
    "items": [
      { "id": "scrobble", "type": "toggle", "label": "Scrobble to Last.fm", "default": true }
    ]
  }
]

Settings and menus need code: nothing else would answer them.

Where a section goes

pageShows up
own (default)on your plugin's own page: a tab under Settings › Plugins named like your plugin
playbackSettings › Playback › General
playback.contentSettings › Playback › Content
playback.sourcesSettings › Playback › Sources
audioSettings › Equalizer
appearanceSettings › Appearance
integrationsSettings › Integrations
storageSettings › Cache & Storage
systemSettings › System (desktop only)
aboutSettings › About › Version & updates

On Glyph's pages a section sits at the end of the page, or right under the row whose label key you give in after. Its heading reads <title> · <plugin name> with a puzzle icon, so users know where it comes from. If the row is not on the page (another tab, or a newer Glyph renamed it), the section moves to the end.

Common after keys:

PageRow label keys
playbacksp.audio.quality, sp.audio.dl_quality, sp.crossfade, sp.output, sp.level, sp.normalize, sp.devices, sp.audio.channels
playback.contentsp.shuffle, sp.stats, sp.explicit, sp.radio, sp.hidden
playback.sourcessp.extractor, sp.search.mode, settings.sources.fallback, settings.priority
audiosp.eq.enable, sp.eq.preset, sp.eq.share
appearancesettings.language, settings.visuals.intensity, settings.visuals.music_reactivity, settings.visuals.ascii_covers, sp.appearance.theme, sp.appearance.ascii_fx, sp.appearance.mini, sp.appearance.throttle, sp.appearance.startup
integrationssp.discord, sp.discord.id, sp.mcp
storagesp.storage.limit, sp.storage.saver, sp.storage.usage
systemsp.system.autostart, sp.system.start_mode
aboutupdate.auto, update.channel

Rows

Every row has an id (1-40 of a-z, 0-9, _, -, unique across all your sections), a type, a label (60 characters) and an optional desc (300 characters, shown behind the (i)). Texts are plain strings or the same text per language: {"en": "Scrobble", "de": "Scrobbeln"}; Glyph picks the user's language, then English.

typeControlExtra fieldsValue
toggleswitchdefault (bool)true / false
sliderbar with the value beside itmin (0), max (100), step, unit (8 characters, e.g. %), defaultnumber
selectdropdownoptions (1-50 × { "value", "label" }), default (a value)the option's value
texttext fieldplaceholder, secret (secure credential), required, default (non-secret only)text (500 characters)
buttonbuttoncaption (the text on the button; default: the label)– (sends an action event)
linkbutton that opens a web pageurl (https), caption–
notetext only, no controllabel (optional), desc (the text)–

Glyph stores non-secret values per plugin (<data>/plugins/<id>/values.json) and sends a setting event on every change. Your code reads them with ui.get or ui.values and can set them with ui.set.

Changing rows at run time

ui.update changes a row until the plugin restarts:

{ "fn": "ui.update", "args": { "id": "connect", "status": "Connected as milo", "label": "Disconnect" } }
{ "fn": "ui.update", "args": { "id": "user", "disabled": true } }
{ "fn": "ui.update", "args": { "id": "device", "options": [ { "value": "a1", "label": "Living room" } ] } }
{ "fn": "ui.update", "args": { "id": "advanced", "hidden": true } }

status is a second line under the label, good for live state ("Connected", "Last sync 2 min ago", a counter).

Song menu

"menus": [
  { "id": "love", "label": { "en": "Love on Last.fm", "de": "Auf Last.fm lieben" } }
]

Up to 10 entries appear in the song menu (right click on a song, or the song's sheet on phones), after Glyph's own entries and before Go to artist, each with a puzzle icon. A click sends {"type": "menu", "id": "love", "song": …}. Entries show only while the plugin's code runs.

Hiding Glyph's rows

"hide": ["sp.appearance.throttle", "sp.devices"]

Hides those settings rows everywhere they appear. Works without code, so community plugins can do it too. The rows of the plugin settings, the account and assistant access (plugins.*, account.*, mcp.*) can't be hidden. Switching the plugin off brings the rows back.

Glyph's texts

"strings": {
  "en": { "sp.crossfade": "Blend songs", "my-plugin.connected": "Connected as {user}" },
  "de": { "sp.crossfade": "Songs überblenden", "my-plugin.connected": "Verbunden als {user}" }
}
  • A key starting with your plugin's id (my-plugin.…) is your own text. Your code gets it in the user's language with app.text.
  • Any other key replaces Glyph's text with that key. Your English text also fills in where Glyph has no translation.
  • Language codes are two letters: en, de, ru, es, fr, pt, it, pl, tr, uk, af.
  • plugins.*, account.* and mcp.* can't be replaced, so a plugin can't reword the install warning or the account and assistant screens.
  • Placeholders like {n} in Glyph's texts are filled in by Glyph; keep them in your replacement.

Finding keys

All of Glyph's texts are in assets/i18n/en.toml. Search it for the text you see in the app; the key is on the left:

"sp.crossfade" = "Crossfade"
"ctx.radio" = "Start radio"

Settings row keys work for hide and after too: they are the keys of the rows' labels.

When several plugins touch the same thing

  • Two plugins replacing the same text: the one whose name comes later in alphabetical order wins.
  • Hidden rows add up.
  • Sections after the same row appear in the order Glyph lists the plugins (by name).
  • Switching a plugin off removes its texts, hidden rows, sections, menu entries and stops its code, without removing it.

Credentials and live progress

A text item with secret: true is a credential managed by Glyph. It must be on the plugin's own page, declare a credential with exact host, path, location (query or headers) and field name, cannot have a default and cannot be patched or set by plugin code. Set required: true to keep the code stopped until the value is saved. The masked field saves on Enter, clears after a successful save and shows whether a value is already stored. An empty submission deletes it. See Services and keys.

A progress row is a read-only bar. Declare its id, type: "progress" and label, then call ui.update with id and value from 0 to 1. Its optional status carries a readable value. It has no stored setting value.

Edit this page on GitHub · Markdown