Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/go-toast/toast
A go package for Windows 10 toast notifications
https://github.com/go-toast/toast
cli golang toast windows windows-10
Last synced: 27 days ago
JSON representation
A go package for Windows 10 toast notifications
- Host: GitHub
- URL: https://github.com/go-toast/toast
- Owner: go-toast
- License: mit
- Created: 2016-07-27T22:18:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-08-21T03:02:57.000Z (about 1 year ago)
- Last Synced: 2024-09-28T23:01:14.107Z (about 1 month ago)
- Topics: cli, golang, toast, windows, windows-10
- Language: Go
- Homepage: https://godoc.org/gopkg.in/toast.v1
- Size: 239 KB
- Stars: 445
- Watchers: 7
- Forks: 63
- Open Issues: 22
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Toast
A go package for Windows 10 toast notifications.
As seen in [jacobmarshall/pokevision-cli](https://github.com/jacobmarshall/pokevision-cli).
## CLI
As well as using go-toast within your Go projects, you can also utilise the CLI - for any of your projects.
Download [64bit](https://go-toast-downloads.s3.amazonaws.com/v1/toast64.exe) or [32bit](https://go-toast-downloads.s3.amazonaws.com/v1/toast32.exe)
```cmd
C:\Users\Example\Downloads\toast64.exe \
--app-id "Example App" \
--title "Hello World" \
--message "Lorem ipsum dolor sit amet, consectetur adipiscing elit." \
--icon "C:\Users\Example\Pictures\icon.png" \
--audio "default" --loop \
--duration "long" \
--activation-arg "https://google.com" \
--action "Open maps" --action-arg "bingmaps:?q=sushi" \
--action "Open browser" --action-arg "http://..."
```![CLI](./screenshot-cli.png)
## Example
```go
package mainimport (
"log""gopkg.in/toast.v1"
)func main() {
notification := toast.Notification{
AppID: "Example App",
Title: "My notification",
Message: "Some message about how important something is...",
Icon: "go.png", // This file must exist (remove this line if it doesn't)
Actions: []toast.Action{
{"protocol", "I'm a button", ""},
{"protocol", "Me too!", ""},
},
}
err := notification.Push()
if err != nil {
log.Fatalln(err)
}
}
```## Screenshots
![Toast](./screenshot-toast.png)
![Action centre](./screenshot-action-centre.png)