This repository has been archived on 2025-03-19. You can view files and clone it, but cannot push or open issues or pull requests.
gowaybarplug/README.md
Jim Ramsay d76d56b393 Initial waybar plugin framework for go
Signed-off-by: Jim Ramsay <i.am@jimramsay.com>
2022-08-01 12:19:10 -04:00

44 lines
826 B
Markdown

# gowaybarplug
Go framework for custom [Waybar](https://github.com/Alexays/Waybar) plugins
# Usage
First build a plugin that reports some interesting status:
```go
package main
import (
"time"
waybar "github.com/lack/gowaybarplug"
)
main() {
updater := waybar.NewUpdater()
for {
status := waybar.Status{
Text: "Some text",
Toolbar: "Other text",
}
// Obviously do something more interesting than just static text in the status...
updater.Status <- &status
time.Sleep(15 * time.Second)
}
}
```
Then add it to your ~/.config/waybar/config:
```json
{
// ... Other waybar config
"custom/mything": {
"format": "{} {icon}",
"return-type": "json",
"exec": "/path/to/my/new/plugin"
// etc
}
}
```