Documentation

Custom icons

Give the weather card and the shortcuts glyphs from a set that ships inside the theme.

Custom icons: the urdeck.widgets.weather widget at 4x2.
The urdeck.widgets.weather widget at 4x2, drawn by UrDeck from this theme.

The theme

This is the theme.json of the recipe, exactly as it is in the repository (site/cookbook/custom-icons/). Save it as themes/my-theme/theme.json next to UrDeck.Host.exe and set "theme": "my-theme", or copy the keys you like into your own theme.

{
  "$schema": "https://urdeck.app/schemas/v1/theme.json",
  "meta": {
    "name": "Custom icons",
    "description": "The weather card drawn with an icon set of the theme's own.",
    "mode": "dark"
  },
  "colors": {
    "cardFill": "#10131f",
    "accent": "#7fd1ff"
  },
  "icons": {
    "set": "mine",
    "stroke": 0.075,
    "tint": "accent"
  }
}

How it works

An icon set is a folder icons/<set>/ next to theme.json, and icons.set names it. The folder needs a manifest.json, which says which file shows which of the product’s icon names, and the SVG files themselves. See icon sets for the full rules.

  • This set draws only eight icons: sun, moon, partly cloudy, overcast, rain and snow, and two for shortcuts (app/terminal and app/home). Every other key is answered by the built-in outline set, so the weather card never shows a hole.
  • Each file is a 24 by 24 outline made of a few path, circle and line elements. The deck strokes every shape with icons.stroke (0.075 of the icon’s size) in icons.tint, so the colours and widths written in the files are ignored.
  • source and license in the manifest say where the icons come from. These were drawn for this recipe and are given away under CC0, with the licence text in LICENSE.txt beside them, which keeps theme validate quiet about licences.
  • A shortcut uses a glyph with "icon": "theme:app/terminal".

Draw your own icons the same way, or take a set you like the licence of, name the keys in the manifest, and run urdeck-cli theme validate to see which rule a file breaks.

All recipes · Theme reference