Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 826 Bytes

README.md

File metadata and controls

44 lines (35 loc) · 826 Bytes

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
    }
}