Skip to content

stuartleeks/toast

 
 

Repository files navigation

Toast

This repo contains a fork of the original go-toast/toast with the following changes:

A go package for Windows 10 toast notifications.

As seen in 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 the latest release and extract toast.exe

C:\Users\Example\Downloads\toast.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

Example

package main

import (
    "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

Action centre

About

A go package for Windows 10 toast notifications

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 69.4%
  • Dockerfile 13.9%
  • Shell 11.7%
  • Makefile 5.0%