From df8f09caf2c88ee815ad31519754486561f4dbf6 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 25 Apr 2018 11:59:18 +0200 Subject: remove notification --- main.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/main.go b/main.go index 921cc5e..85520dd 100644 --- a/main.go +++ b/main.go @@ -5,9 +5,7 @@ import ( "flag" "fmt" "os" - "os/exec" "os/signal" - "runtime" "strings" "time" ) @@ -64,7 +62,6 @@ func (o *Opt) longBreak(ctx context.Context) stateFn { } func (o *Opt) display(ctx context.Context, s string) { - go notify("Pomodoro timer", s) dl, ok := ctx.Deadline() if !ok { return @@ -99,21 +96,6 @@ func progress(total, left time.Duration) string { return s } -func notify(title, s string) error { - s = time.Now().Format(time.Kitchen) + " " + s - switch runtime.GOOS { - case "darwin": - msg := fmt.Sprintf("display notification %q with title %q", s, title) - return exec.Command("osascript", "-e", msg).Run() - case "linux": - msg := fmt.Sprintf("%s", s) - return exec.Command("notify-send", title, msg).Run() - default: // *BSD - msg := fmt.Sprintf("%s\n%s", title, s) - return exec.Command("xmessage", "-center", "-timeout", "5", msg).Run() - } -} - func round(d time.Duration) time.Duration { return d - d%time.Second } func main() { -- cgit v1.2.3