gdbus

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SessionBusSync added in v0.1.0

func SessionBusSync() (*gio.DBusConnection, error)

SessionBusSync gets the global session bus.

Types

type Action

type Action struct {
	ID       string
	Label    string
	Callback func() // called in main event loop
}

type MPRISWatcher added in v0.0.4

type MPRISWatcher struct {
	*gio.DBusConnection

	OnPlayback func(m Metadata, playing bool)
	// contains filtered or unexported fields
}

MPRISWatcher wraps around a GIO DBus Connection to listen to the system's MPRIS events.

func NewMPRISWatcher added in v0.0.4

func NewMPRISWatcher(c *gio.DBusConnection) *MPRISWatcher

NewMPRISWatcher creates a new MPRIS watcher instance.

func (*MPRISWatcher) Close added in v0.1.0

func (w *MPRISWatcher) Close()

Close stops the watcher.

func (*MPRISWatcher) IsEnabled added in v0.0.4

func (w *MPRISWatcher) IsEnabled() bool

func (*MPRISWatcher) SetEnabled added in v0.0.4

func (w *MPRISWatcher) SetEnabled(enabled bool)

type Metadata added in v0.0.4

type Metadata struct {
	Title   string
	Artists []string
	Album   string
}

Metadata maps some fields from https://www.freedesktop.org/wiki/Specifications/mpris-spec/metadata/#index5h3

type Notification

type Notification struct {
	AppName string
	AppIcon string
	Title   string
	Message string
	Actions []*Action
	Expiry  int32
}

type Notifier

type Notifier struct {
	*gio.DBusConnection
	// contains filtered or unexported fields
}

Notifier wraps around a GIO DBus Connection and allows sending notifications using the DBus method.

func NewNotifier

func NewNotifier(c *gio.DBusConnection) *Notifier

NewNotifier creates a new notifier.

func (*Notifier) Notify

func (c *Notifier) Notify(n Notification) (uint32, error)

Notify is blocking.

Jump to

Keyboard shortcuts

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