github.com/lack/gowaybarplug

Go framework for custom waybar plugins


License
MIT
Install
go get github.com/lack/gowaybarplug

Documentation

gowaybarplug

Go framework for custom Waybar plugins

Usage

First build a plugin that reports some interesting status:

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:

{
    // ... Other waybar config
    "custom/mything": {
        "format": "{} {icon}",
        "return-type": "json",
        "exec": "/path/to/my/new/plugin"
        // etc
    }
}