mirror of https://github.com/miguelmota/cointop
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
504 B
Go
22 lines
504 B
Go
// +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)
|
|
}
|