add block app

This commit is contained in:
Simon Vieille 2022-08-28 15:36:24 +02:00
parent 8fc099e249
commit c94b697b0f
Signed by: deblan
GPG key ID: 579388D585F70417

25
blocks/app/main.go Normal file
View file

@ -0,0 +1,25 @@
package main
import (
"fmt"
r "gitnet.fr/deblan/i3-blocks-go/rendering"
"os"
"os/exec"
)
func main() {
if os.Getenv("BLOCK_BUTTON") == "1" {
command := exec.Command("bash", "-c", os.Args[5])
command.Run()
}
options := r.NewBlockOptions()
options.FullText = r.TextWithPadding(os.Args[2], r.FB{
Background: os.Args[3],
Foreground: os.Args[4],
})
block := r.Block(os.Args[1], options)
fmt.Println(block)
}