mirror of
https://github.com/muesli/telephant
synced 2025-02-16 19:48:24 +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
|
package main
|
||||||
|
|
||||||
import "github.com/gen2brain/beeep"
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/gen2brain/beeep"
|
||||||
|
)
|
||||||
|
|
||||||
func notify(title string, body string) {
|
func notify(title string, body string) {
|
||||||
err := beeep.Notify(title, body, "")
|
err := beeep.Notify(title, body, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
fmt.Println("Error sending notification:", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
err := beeep.Beep(beeep.DefaultFreq, beeep.DefaultDuration)
|
err := beeep.Beep(beeep.DefaultFreq, beeep.DefaultDuration)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
fmt.Println("Error initializing notifications:", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue