get-icon-path

0.0.1 • Public • Published

Get icon path from theme - freedesktop spec

documentation Standard - JavaScript Style Guide

An alternative to hardcode tray for electron apps !

What's this

A lot of electron apps use hardcoded icons for tray icon, such as discord, rambox, etc... This module allows those apps to use icons from icons themes installed for Gnome, KDE... It was originally developped for rambox. It's based on freedesktop icon theme specification.

USAGE

npm i --save get-icon-path

const { getIcon, getIconSync } = require('get-icon-path')
getIcon({ iconName: 'rambox-notification', size: 32 }, 'test.path', function (e) {
  console.log(e, 'Promised')
})
getIcon('rambox-notification', 'test.path', function (e) {
  //e will equals to 'test.path' if no icons is found
  console.log(e, 'Promised')
})
var res = getIconSync({ iconName: 'rambox-notification' }, 'text.path')
console.log(res, 'Non promised')

DOCUMENTATION

https://maxerbox.github.io/get-icon-path/

TO DO

  • Herited theme parsing
  • KDE enabled theme detection

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    1

Package Sidebar

Install

npm i get-icon-path

Weekly Downloads

1

Version

0.0.1

License

ISC

Unpacked Size

22.4 kB

Total Files

11

Last publish

Collaborators

  • maxerbox