desktop_toast.go 352 B

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