Simon Vieille
f384772e81
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
35 lines
578 B
Go
35 lines
578 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
r "gitnet.fr/deblan/i3-blocks-go/rendering"
|
|
"os"
|
|
"os/exec"
|
|
"sync"
|
|
)
|
|
|
|
func runCmd(wg *sync.WaitGroup, value string) {
|
|
defer wg.Done()
|
|
command := exec.Command("tmux", "new", "-d", value)
|
|
command.Run()
|
|
}
|
|
|
|
func main() {
|
|
var wg sync.WaitGroup
|
|
|
|
if os.Getenv("BLOCK_BUTTON") == "1" {
|
|
wg.Add(1)
|
|
go runCmd(&wg, os.Args[5])
|
|
}
|
|
|
|
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)
|
|
wg.Wait()
|
|
}
|