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