A short-hand for you to build something like:
Install
$ npm install --save menus
Usage
const Menus = require('menus')
const menus = new Menus()
menus.setMenu([
{
label: 'My First Menu Item',
click() {
console.log('clicked!')
}
}
])
menus.start()
menus.on('ready', () => {
console.log('Menus app is ready!')
})
For a more complete example, please check out example.
API
const menus = new Menus()
options.icon
Path to tray icon.
options.showDockIcon
Default: false
Whether to show dock icon.
options.tooltip
Default: ''
The tooltip to show when tray icon is hovered.
Emitted when a tray is created on the menubar.
Set context menu for the tray icon. The doc of menu is here.
Bootstrap the menus app.
The electron.app instance.
The created tray instance.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
MIT © EGOIST