18 lines
393 B
Go
18 lines
393 B
Go
//go:build !darwin
|
|
|
|
package notifications
|
|
|
|
import "github.com/gen2brain/beeep"
|
|
|
|
func sendDesktopNotification(title string, body string, image string, playSound bool, duration int) error {
|
|
beeep.DefaultDuration = duration
|
|
|
|
if err := beeep.Notify(title, body, image); err != nil {
|
|
return err
|
|
}
|
|
|
|
if playSound {
|
|
return beeep.Beep(beeep.DefaultFreq, beeep.DefaultDuration)
|
|
}
|
|
return nil
|
|
}
|