diff --git a/README.md b/README.md index 59d76ec..705007a 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ interval=1000 ### Date -Show the time using given format and run `gnome-calendar` when clicked. +Show the time using given format. ``` [time] diff --git a/blocks/date/main.go b/blocks/date/main.go index 92b40a5..257772b 100644 --- a/blocks/date/main.go +++ b/blocks/date/main.go @@ -6,32 +6,16 @@ import ( "github.com/enescakir/emoji" "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 := flag.String("format", "%H:%M:%S %m-%d-%Y", "time format") flag.Parse() - var wg sync.WaitGroup + symbol := string(emoji.Calendar) for { now := time.Now() - - if os.Getenv("BLOCK_BUTTON") == "1" { - wg.Add(1) - go runCalendar(&wg) - } - - symbol := string(emoji.Calendar) date := timefmt.Format(now, *argFormat) options := r.NewBlockOptions() @@ -44,6 +28,4 @@ func main() { fmt.Println(block) time.Sleep(time.Millisecond * 500) } - - wg.Wait() }