From c94b697b0feae8f9a9cb10e347d0232c6c1176ce Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 28 Aug 2022 15:36:24 +0200 Subject: [PATCH] add block app --- blocks/app/main.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 blocks/app/main.go diff --git a/blocks/app/main.go b/blocks/app/main.go new file mode 100644 index 0000000..6e7a6ee --- /dev/null +++ b/blocks/app/main.go @@ -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) +}