This commit is contained in:
parent
ab4d7c98fa
commit
f384772e81
|
@ -5,12 +5,21 @@ import (
|
|||
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" {
|
||||
command := exec.Command("bash", "-c", os.Args[5])
|
||||
command.Run()
|
||||
wg.Add(1)
|
||||
go runCmd(&wg, os.Args[5])
|
||||
}
|
||||
|
||||
options := r.NewBlockOptions()
|
||||
|
@ -20,6 +29,6 @@ func main() {
|
|||
})
|
||||
|
||||
block := r.Block(os.Args[1], options)
|
||||
|
||||
fmt.Println(block)
|
||||
wg.Wait()
|
||||
}
|
||||
|
|
|
@ -6,14 +6,26 @@ import (
|
|||
"github.com/itchyny/timefmt-go"
|
||||
r "gitnet.fr/deblan/i3-blocks-go/rendering"
|
||||
"os"
|
||||
"os/exec"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
func runCalendar(wg *sync.WaitGroup) {
|
||||
defer wg.Done()
|
||||
command := exec.Command("tmux", "new", "-d", "gnome-calendar")
|
||||
command.Run()
|
||||
}
|
||||
|
||||
func main() {
|
||||
argFormat := os.Args[1]
|
||||
now := time.Now()
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
||||
if os.Getenv("BLOCK_BUTTON") == "1" {
|
||||
wg.Add(1)
|
||||
go runCalendar(&wg)
|
||||
}
|
||||
|
||||
symbol := r.Emoji(emoji.Calendar)
|
||||
|
@ -26,6 +38,6 @@ func main() {
|
|||
})
|
||||
|
||||
block := r.Block("date", options)
|
||||
|
||||
fmt.Println(block)
|
||||
wg.Wait()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue