Notifications

package
v0.0.0-...-0caaa62 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: GPL-3.0-or-later Imports: 5 Imported by: 0

Documentation

Overview

Package Notifications is a desktop notifications history applet for Cairo-Dock.

requires a hacked version of the dbus api (that wont stop after eavesdropping a message).

Index

Constants

View Source
const (
	ActionNone = iota
	ActionShowAll
	ActionClear
)

List of actions defined in this applet. Order must match defineActions declaration order.

Variables

This section is empty.

Functions

func NewApplet

func NewApplet(base cdtype.AppBase, events *cdtype.Events) cdtype.AppInstance

NewApplet creates a new applet instance.

Types

type Applet

type Applet struct {
	cdtype.AppBase // Applet base and dock connection.
	// contains filtered or unexported fields
}

Applet defines a dock applet.

func (*Applet) Init

func (app *Applet) Init(def *cdtype.Defaults, confLoaded bool)

Init loads user configuration if needed and initialise applet.

func (*Applet) UpdateCount

func (app *Applet) UpdateCount(count int)

UpdateCount shows the number of messages on the icon, and displays the alternate icon if count > 0.

type Notif

type Notif struct {
	Sender, Icon, Title, Content string
	ID                           uint32
	// contains filtered or unexported fields
}

Notif defines a single Dbus notification.

type NotifConfig

type NotifConfig struct {
	MaxSize   int
	Blacklist []string
}

NotifConfig defines the notification service configuration.

type Notifs

type Notifs struct {
	NotifConfig

	C chan *dbus.Message
	// contains filtered or unexported fields
}

Notifs handles Dbus notifications management.

func (*Notifs) Add

func (notifs *Notifs) Add(newtif *Notif)

Add a new notifications to the list.

func (*Notifs) Clear

func (notifs *Notifs) Clear()

Clear resets the list of notifications.

func (*Notifs) List

func (notifs *Notifs) List() []*Notif

List returns the list of notifications.

func (*Notifs) Listen

func (notifs *Notifs) Listen()

Listen to eavesdropped messages to find notifications..

func (*Notifs) SetOnCount

func (notifs *Notifs) SetOnCount(call func(int))

SetOnCount sets the callback for notifications count change.

func (*Notifs) Start

func (notifs *Notifs) Start() error

Start the message eavesdropping loop and forward notifs changes to the callback.

Jump to

Keyboard shortcuts

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