mirror of
https://github.com/muesli/telephant
synced 2024-11-22 19:33:06 +00:00
Don't panic if sending notification fails
This commit is contained in:
parent
f97938d514
commit
5532064e71
1 changed files with 9 additions and 3 deletions
|
@ -1,17 +1,23 @@
|
|||
// +build linux
|
||||
|
||||
package main
|
||||
|
||||
import "github.com/gen2brain/beeep"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gen2brain/beeep"
|
||||
)
|
||||
|
||||
func notify(title string, body string) {
|
||||
err := beeep.Notify(title, body, "")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
fmt.Println("Error sending notification:", err)
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
err := beeep.Beep(beeep.DefaultFreq, beeep.DefaultDuration)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
fmt.Println("Error initializing notifications:", err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue