notificator

package module
Version: v0.0.0-...-c42e3d4 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: BSD-3-Clause Imports: 5 Imported by: 93

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
}

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL