66 lines
1.7 KiB
Text
66 lines
1.7 KiB
Text
Source: golang-github-lack-gowaybarplug
|
|
Section: golang
|
|
Priority: optional
|
|
Maintainer: Penelope Gwen <support@pogmom.me>
|
|
Uploaders: Penelope Gwen <support@pogmom.me>
|
|
Rules-Requires-Root: no
|
|
Build-Depends: debhelper-compat (= 13),
|
|
dh-sequence-golang,
|
|
golang-any,
|
|
golang-github-stretchr-testify-dev,
|
|
golang-github-xorcare-pointer-dev
|
|
Testsuite: autopkgtest-pkg-go
|
|
Standards-Version: 4.6.2
|
|
Homepage: https://git.pogmom.me/pogmommy/gowaybarplug
|
|
XS-Go-Import-Path: github.com/lack/gowaybarplug
|
|
|
|
Package: golang-github-lack-gowaybarplug-dev
|
|
Architecture: all
|
|
Multi-Arch: foreign
|
|
Depends: golang-github-stretchr-testify-dev,
|
|
golang-github-xorcare-pointer-dev,
|
|
${misc:Depends}
|
|
Description: Go framework for custom waybar plugins (library)
|
|
gowaybarplug
|
|
.
|
|
Go framework for custom Waybar (https://github.com/Alexays/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
|
|
}
|
|
}
|
|
|