notificator

package module
v0.0.0-...-ee9b892 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2022 License: BSD-3-Clause Imports: 5 Imported by: 141

README

notificator

Desktop notification with Golang for:

  • Windows with growlnotify;
  • Mac OS X with terminal-notifier (if installed) or osascript (native, 10.9 Mavericks or Up.);
  • Linux with notify-send for Gnome and kdialog for Kde.

Usage

package main

import (
  "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_CRITICAL)
}

TODO

  • Add more options for different notificators.

Сontribution

  • Fork;
  • Make changes;
  • Send pull request;
  • Thank you.

author

@0xAX

Documentation

Index

Constants

View Source
const (
	UR_NORMAL   = "normal"
	UR_CRITICAL = "critical"
)

Variables

This section is empty.

Functions

func CheckMacOSVersion

func CheckMacOSVersion() bool

func CheckTermNotif

func CheckTermNotif() bool

Types

type Notificator

type Notificator struct {
	// contains filtered or unexported fields
}

func New

func New(o Options) *Notificator

func (Notificator) Push

func (n Notificator) Push(title string, text string, iconPath string, urgency string) error

type Options

type Options struct {
	DefaultIcon string
	AppName     string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL