drawbars37 / BAWicons

A collection of SVG icons for Home Assistant in a .js file suitable for execution
GNU General Public License v3.0
11 stars 0 forks source link

BAWicons

A collection of SVG icons for Home Assistant in a .js file suitable for execution

These are icons I've created for personal use. They started as a small enhancement of hass-bha-icons, a similar collection from github user 'hulkhaugen'. This author is indebted to the availability of this prior work as a how-to guide. (I'm a lifetime software and firmware programmer, but a relative novice in all things HA-related.)

PLEASE READ THIS ENTIRE FILE BEFORE PROCEEDING. The icon library has minimal functionality, other than that of its primary purpose: providing a set of icons for Home Assistant not available in the standard MDI set. If the library "doesn't seem to work," the reason is likely related to one or both of the two notes added near the end of the file. This is also true if my library is used as a template for others' work.


ADDITIONAL ICONS

At the time of this writing, this library contains (54) 24x24 pixel SVG-based icons. The mix is somewhat eclectic, and heavily music-based because, well, I'm a musician. The MDI icon list is huge, but it doesn't have many icons specific to music and audio -- so I fixed that. Some readers may find the library highly useful; others may think it's all a bunch of nonsense. YMMV.

If you enjoy programming and drawing icons, this is a great start for you. Instructions to modify and install your library are shown below.

If you don't program and can't draw/modify existing icon files, feel free to suggest updates to this library. I make no promise that I will add them, though. I am retired and this programming is something of a hobby:


MODIFYING THE LIBRARY

Users are encouraged to hack and modify this library to meet personal needs. If you release the results of your work, I ask that you credit both hulkhaugen and myself (drawbars37) as sources, as well as any other icon source used as a starting point for new icons. (These are listed at the top of the file.) I have made every attempt to use public-domain icons, or to contact the icon owner(s) for permission. As such, there are very few product-related icons in the library.

The overall structure of the library is a .js file with an array called 'BAW_ICONS_MAP' -- which can be changed if you create a new library -- containing a series of elements:

There are some other items near the bottom of the .js file that need to be changed:


INSTALLING THE LIBRARY

The .js file must be copied to the www directory of the Home Assistant client that executes HASS (Raspberry Pi, x64, etc.).

The configuration.yaml file must be modified to point to the .js file with the icons. If your file doesn't already have a section called frontend: then create it:

frontend:
  extra_module_url:
    - /local/hass-baw-icons.js

If you plan to use more than one icon library, add it/them in this section.


USING THE LIBRARY

These icons can be used in a similar manner to the MDI set that are native to Home Assistant, substituting 'baw' for 'mdi' in the name:

icon: mdi:gauge

icon: baw:sports-car