Use custom icon on launcher item

Yeah, kernels are needfully special, as they serve up pngs from the backend, rather than a LabIcon.

The svgStr of a LabIcon needs to be an actual SVG. You’ll want to

  • (optionally) make a typing override
  • prepare your SVG
    • make sure it’s well formed (proper XML declarations, etc)
      • get rid of all id attributes
      • clean up all the cruft you can
      • inkscape is good for this, with it’s Optimized SVG export format
      • svgo can be useful if you have a ton of icons, but does have some binary dependencies that can be… exciting…
    • add class hints, so that it looks good on light and dark backgrounds
  • import your SVG
  • make your icon
  • use it in a command

and i think you have the rest!

2 Likes