desktop_toast.go 332 B

123456789101112131415
  1. package notifications
  2. import "github.com/gen2brain/beeep"
  3. func sendDesktopNotification(title string, message string, image string, playSound bool, duration int) error {
  4. if err := beeep.Notify(title, message, image); err != nil {
  5. return err
  6. }
  7. if playSound {
  8. return beeep.Beep(beeep.DefaultFreq, duration)
  9. }
  10. return nil
  11. }