https://github.com/zaaack/aria2c-node-gui
An aria2c gui by node-systray
https://github.com/zaaack/aria2c-node-gui
Last synced: about 2 months ago
JSON representation
An aria2c gui by node-systray
- Host: GitHub
- URL: https://github.com/zaaack/aria2c-node-gui
- Owner: zaaack
- License: mit
- Created: 2017-09-19T08:17:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-19T07:21:37.000Z (over 8 years ago)
- Last Synced: 2025-03-11T07:52:49.034Z (over 1 year ago)
- Language: JavaScript
- Size: 1.06 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-systray
> SysTray library for nodejs using [systray-portable](https://github.com/zaaack/systray-portable) (a portable version of [the go systray library](https://github.com/getlantern/systray)).
## Install
```sh
npm i systray
# or
yarn add systray
```
## Usage
```ts
import SysTray from 'systray'
const systray = new SysTray({
menu: {
icon: "",
title: "标题",
tooltip: "Tips",
items: [{
title: "aa",
tooltip: "bb",
checked: true, // checked not implemented on Linux yet.
enabled: true
}, {
title: "aa2",
tooltip: "bb",
checked: false,
enabled: true
}, {
title: "Exit",
tooltip: "bb",
checked: false,
enabled: true
}]
},
debug: false,
copyDir: true, // copy go tray binary to outside directory, useful for packing tool like pkg.
})
systray.onClick(action => {
if (action.seq_id === 1) {
if (action.seq_id === 0) {
systray.sendAction({
type: 'update-item',
item: {
...action.item,
checked: !action.item.checked,
},
seq_id: action.seq_id,
})
} else if (action.seq_id === 2) {
systray.kill()
}
}
})
```
For more API info please see https://zaaack.github.io/node-systray/
## License
MIT