https://github.com/bubkoo/electron-tray-indicator
🍓A progress indicator in tray for your Electron app.
https://github.com/bubkoo/electron-tray-indicator
electron indicator progress progress-circle tray tray-icon
Last synced: about 1 year ago
JSON representation
🍓A progress indicator in tray for your Electron app.
- Host: GitHub
- URL: https://github.com/bubkoo/electron-tray-indicator
- Owner: bubkoo
- License: mit
- Created: 2019-04-21T03:40:53.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-26T02:23:14.000Z (about 7 years ago)
- Last Synced: 2024-10-03T15:47:57.175Z (over 1 year ago)
- Topics: electron, indicator, progress, progress-circle, tray, tray-icon
- Language: TypeScript
- Homepage:
- Size: 24.5 MB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# electron-tray-indicator

> A progress indicator in tray for your Electron app.
## Install
```shell
$ npm install electron-tray-indicator --save
```
## Usage
Working with a determinate progress:
```ts
import { Tray } from 'electron'
import { progress, clean } from 'electron-tray-indicator'
function start(tray: Tray) {
let p = 0
const tick = () => {
progress({
tray: tray,
progress: p,
})
p += 0.5
if (p < 100) {
setTimeout(tick, 16)
} else {
// update the tray with your `img`
tray.setImage(img)
// clean the background resources (a hidden window)
clean()
}
}
tick()
}
start()
```
Working with an indeterminate progress:
```ts
import { Tray } from 'electron'
import { indeterminate, clean } from 'electron-tray-indicator'
const stop = indeterminate({
tray,
})
// just call `stop` when some task finished
stop()
// then update the tray with your `img`
tray.setImage(img)
// finally you can call `clean` to release the background resources
clean()
```
## Examples
Find more examples see the [./examples](https://github.com/bubkoo/electron-tray-indicator/tree/master/examples).
## Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please [create an issue](https://github.com/bubkoo/electron-tray-indicator/issues/new).