godock: github.com/sqp/godock/services/Notifications Index | Files

package Notifications

import "github.com/sqp/godock/services/Notifications"

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

Package Files

Notifications.go config.go

Constants

const (
    ActionNone = iota
    ActionShowAll
    ActionClear
)

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

func NewApplet Uses

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

NewApplet creates a new applet instance.

type Applet Uses

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

Applet defines a dock applet.

func (*Applet) Init Uses

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

Init loads user configuration if needed and initialise applet.

func (*Applet) UpdateCount Uses

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 Uses

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

Notif defines a single Dbus notification.

type NotifConfig Uses

type NotifConfig struct {
    MaxSize   int
    Blacklist []string
}

NotifConfig defines the notification service configuration.

type Notifs Uses

type Notifs struct {
    NotifConfig

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

Notifs handles Dbus notifications management.

func (*Notifs) Add Uses

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

Add a new notifications to the list.

func (*Notifs) Clear Uses

func (notifs *Notifs) Clear()

Clear resets the list of notifications.

func (*Notifs) List Uses

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

List returns the list of notifications.

func (*Notifs) Listen Uses

func (notifs *Notifs) Listen()

Listen to eavesdropped messages to find notifications..

func (*Notifs) SetOnCount Uses

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

SetOnCount sets the callback for notifications count change.

func (*Notifs) Start Uses

func (notifs *Notifs) Start() error

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

Package Notifications imports 5 packages (graph) and is imported by 1 packages. Updated 2017-10-01. Refresh now. Tools for package owners.