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.
21 lines
445 B
Go
21 lines
445 B
Go
// +build darwin,!linux,!freebsd,!netbsd,!openbsd,!windows,!js
|
|
|
|
package beeep
|
|
|
|
import (
|
|
"os/exec"
|
|
)
|
|
|
|
// Notify sends desktop notification.
|
|
//
|
|
// On macOS this executes AppleScript with `osascript` binary.
|
|
func Notify(title, message, appIcon string) error {
|
|
osa, err := exec.LookPath("osascript")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
cmd := exec.Command(osa, "-e", `display notification "`+message+`" with title "`+title+`"`)
|
|
return cmd.Run()
|
|
}
|