mirror of
https://github.com/make-42/hayai.git
synced 2025-01-18 18:47:10 +01:00
23 lines
586 B
Go
23 lines
586 B
Go
//go:build windows && !linux && !freebsd && !netbsd && !openbsd && !darwin && !js
|
|
// +build windows,!linux,!freebsd,!netbsd,!openbsd,!darwin,!js
|
|
|
|
package beeep
|
|
|
|
import (
|
|
toast "github.com/go-toast/toast"
|
|
)
|
|
|
|
// Alert displays a desktop notification and plays a default system sound.
|
|
func Alert(title, message, appIcon string) error {
|
|
if isWindows10 {
|
|
note := toastNotification(title, message, pathAbs(appIcon))
|
|
note.Audio = toast.Default
|
|
return note.Push()
|
|
}
|
|
|
|
if err := Notify(title, message, appIcon); err != nil {
|
|
return err
|
|
}
|
|
return Beep(DefaultFreq, DefaultDuration)
|
|
}
|