diff --git a/README.md b/README.md index fe1b159..9a87309 100644 --- a/README.md +++ b/README.md @@ -253,7 +253,7 @@ output.ShowCursor() output.Copy(message) // Trigger notification -output.Notification(title, body) +output.Notify(title, body) ``` ## Mouse diff --git a/examples/hello-world/main.go b/examples/hello-world/main.go index 556136a..d70f87c 100644 --- a/examples/hello-world/main.go +++ b/examples/hello-world/main.go @@ -53,7 +53,7 @@ func main() { fmt.Printf("\t%q copied to clipboard\n", hw) fmt.Println() - termenv.Notification("Termenv", hw) + termenv.Notify("Termenv", hw) fmt.Print("\tTriggered a notification") fmt.Println() diff --git a/notification.go b/notification.go index dc11025..2a8cf06 100644 --- a/notification.go +++ b/notification.go @@ -1,11 +1,11 @@ package termenv -// Notification triggers a notification using OSC777. -func Notification(title, body string) { - output.Notification(title, body) +// Notify triggers a notification using OSC777. +func Notify(title, body string) { + output.Notify(title, body) } -// Notification triggers a notification using OSC777. -func (o *Output) Notification(title, body string) { +// Notify triggers a notification using OSC777. +func (o *Output) Notify(title, body string) { _, _ = o.WriteString(OSC + "777;notify;" + title + ";" + body + ST) }