add block app
This commit is contained in:
parent
8fc099e249
commit
c94b697b0f
25
blocks/app/main.go
Normal file
25
blocks/app/main.go
Normal 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)
|
||||
}
|
Loading…
Reference in a new issue