Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TiagoDanin/Polybar-Helpers
Polybar - Helpers to create plugin/module using NodeJS
https://github.com/TiagoDanin/Polybar-Helpers
helpers polybar polybar-scripts
Last synced: about 1 month ago
JSON representation
Polybar - Helpers to create plugin/module using NodeJS
- Host: GitHub
- URL: https://github.com/TiagoDanin/Polybar-Helpers
- Owner: TiagoDanin
- License: mit
- Created: 2018-10-23T13:00:16.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-18T04:07:01.000Z (almost 2 years ago)
- Last Synced: 2024-11-09T02:52:22.716Z (about 1 month ago)
- Topics: helpers, polybar, polybar-scripts
- Language: JavaScript
- Homepage: https://tiagodanin.github.io/Polybar-Helpers/
- Size: 24.4 KB
- Stars: 9
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- Awesome-Polybar - Node Helpers
README
# Polybar-Helpers
Polybar - Helpers to create plugin/module using NodeJS
## Installation
This is a [Node.js](https://nodejs.org/) module available through the
[npm registry](https://www.npmjs.com/). It can be installed using the
[`npm`](https://docs.npmjs.com/getting-started/installing-npm-packages-locally)
or
[`yarn`](https://yarnpkg.com/en/)
command line tools.```sh
npm install polybar-helpers --save
```## Usage
Config in polybar
```
; My Module
[module/test]
type = custom/script
exec = node App.js
click-left = echo left >> $HOME/.config/polybar/events
click-middle = echo middle >> $HOME/.config/polybar/events
click-right = echo right >> $HOME/.config/polybar/events
scroll-up = echo scrollUp >> $HOME/.config/polybar/events
scroll-down = echo scrollDown >> $HOME/.config/polybar/events
tail = true
```App.js
```js
const polybarHelpers = require('polybar-helpers')polybarHelpers(
(app) => {
app.file('/home/tiago/.config/polybar/events')
app.on(['left', 'right'], (ctx) => {
console.log(ctx)
})
app.on('middle', (ctx) => {
console.log(ctx)
console.log(ctx.lastEvent) //return last event, e.g: left
})
app.on(['scrollUp', 'scrollDown'], (ctx) => {
console.log(ctx)
console.log(ctx.event) //return current event, e.g: scrollUp or scrollDown
})
app.error((msg, ctx) => {
console.error(msg, ctx)
})
}
)
```## Dependencies
- [tail](https://ghub.io/tail): tail a file in node
## License
MIT