1.1.1 • Published 7 years ago

linux-icons v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

linux-icons

Build Status

Use Native Linux icons on NodeJS

Improve Linux support on your NodeJS application by using system icon themes. The icons should be placed under one of the freedesktop icons location standards like /usr/share/icons/hicolor/

Status

The current version supports:

  • Inherits
  • Sizes (SVG icons are resized when using getIconBuffer)
  • Icon Contexts

How to use

Install the package

npm install --save linux-icons

In order to get the full path of an icon

const icons = require('linux-icons')

let iconPath = icons.getIcon.sync('myicon-name', 22, icons.Context.STATUS)

Async

const icons = require('linux-icons')

icons.getIcon('myicon-name', 22, icons.Context.STATUS, iconPath => {
  console.log(iconPath)
})

Or to get the buffer of it

const icons = require('linux-icons')

let icon = icons.getIconBuffer.sync('myicon-name', 22, icons.Context.STATUS)

Async

const icons = require('linux-icons')

icons.getIconBuffer('myicon-name', 22, icons.Context.STATUS, buffer => {
  console.log(buffer)
})

Note: Electron tray icons does not support SVG icons. You will have to use getIconBuffer with nativeImage.createFromBuffer. See the examples folder.

TODO

  • Auto-detect the DE and get the right icon theme name
  • Async version
  • Clean the code!
  • Scaling Factor
1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago