An open API service indexing awesome lists of open source software.

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.

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).