File: main.go

package info (click to toggle)
golang-github-0xax-notificator 0.0~git20210731.c42e3d4-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 136 kB
  • sloc: makefile: 3
file content (25 lines) | stat: -rw-r--r-- 454 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main

import (
	"log"

	"github.com/0xAX/notificator"
)

var notify *notificator.Notificator

func main() {
	notify = notificator.New(notificator.Options{
		DefaultIcon: "icon/default.png",
		AppName:     "My test App",
	})

	notify.Push("title", "text", "/home/user/icon.png", notificator.UR_NORMAL)

	// Check errors
	err := notify.Push("error", "ops =(", "/home/user/icon.png", notificator.UR_CRITICAL)

	if err != nil {
		log.Fatal(err)
	}
}