Skip to main content
Version: 2.2

Dux Labs

Dux Icons Usage

Dux Icons Usage

Commands​

dux-icons --from-dms # colors from the running DMS theme
dux-icons --from-dms --mode light # use the light scheme
dux-icons --from-dms --mono # app icons in your colors
dux-icons --from-dms --shape squircle --gradient
dux-icons --palette colors.json # colors from a file
dux-icons --out DIR --name NAME # build somewhere else, under another name

From a checkout without installing, python3 scripts/build.py takes the same options.

Options​

OptionDoes
--from-dmsRead colors from DMS
--mode dark|lightWhich scheme to read, default follows DMS
--badge HEXBadge and folder front color
--glyph HEXColor of marks drawn on the badge
--back HEXFolder back color, default is a darker --badge
--mono, --no-monoPaint app icons in tones of your colors, or keep their own
--shape NAMEBadge shape: circle, squircle, rounded, square, hexagon, cookie or clover
--gradient, --no-gradientShade the badge from lighter at the top to darker at the bottom, or keep it flat
--palette FILEJSON file with badge and glyph
--out DIRWhere to write the theme
--name NAMETheme name written to index.theme
-vList every icon that was skipped, with the reason

The build only writes to a directory it created itself, and refuses a symlink or a folder with other files in it.

How It Works​

Vector icons are placed into the badge as vectors. Bitmap icons are embedded, so the result is always a single self-contained SVG. An icon that cannot be placed cleanly is skipped and falls back to hicolor. The build prints how many were skipped and why, and -v lists them.

src/recipe.json controls the build:

KeyDoes
templateThe default badge shape, a file in src/templates/
shapesLayout changes a shape needs, such as more padding inside a hexagon
gradienttrue shades the badge
vendorThemesInstalled icon themes searched, in order, for an Icon= name the app did not install itself
monofalse keeps app colors, true paints them in tones between @glyph and @back
monoContrastHow hard mono pushes tones apart, 1 leaves them as they are
tokensThe Material roles behind @badge, @glyph and optionally @back
layoutHow far content sits inside the badge
overridesLayout changes for icons matching a name pattern
inheritsThe themes used for anything Dux Icons does not provide

Drawing an Icon​

Own icons live in src/own/<context>/<name>.svg.

  • Draw on a 0 0 24 24 viewBox, without the badge.
  • Use only the tokens @glyph, @badge and @back as colors.
  • If several icon names share the picture, list them in src/aliases.json instead of copying the file.

Development​

python3 -m unittest