mpris

package
v0.0.0-...-c27737a Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Play plays the song
	Play = "%{A:playerctl pause:} " + string(siji.Pause) + " %{A}"

	// Pause pauses the song
	Pause = "%{A:playerctl play:} " + string(siji.Play) + " %{A}"

	// Prev moves previously
	Prev = "%{A:playerctl previous:} " + string(siji.Previous) + " %{A}"

	// Next skips the song
	Next = "%{A:playerctl next:} " + string(siji.Next) + " %{A}"
)

Variables

View Source
var PlayerColors = map[string]int{
	"":          0x0,
	"spotify":   0x1DB954,
	"rhythmbox": 0xD8BB1F,
}

PlayerColors contains all known players and their colors

Functions

func InitDbus

func InitDbus() (chan *dbus.Message, error)

InitDbus starts a private Dbus connection

Types

type Metadata

type Metadata struct {
	MprisTrackid     string
	MprisLength      uint64
	MprisArtURL      string
	XesamAlbum       string
	XesamAlbumArtist []string
	XesamArtist      []string
	XesamAutoRating  float64
	XesamDiscNumber  int32
	XesamTitle       string
	XesamTrackNumber int32
	XesamURL         string
	XesamGenre       []string
	XesamUserRating  float32
}

Metadata contains player metadata

func (*Metadata) Format

func (m *Metadata) Format(l int) string

Format prints the string

type Player

type Player struct {
	Status   Status
	Metadata *Metadata
}

Player contains the struct for a player

func NewPlayer

func NewPlayer() *Player

NewPlayer returns a new player

func (*Player) ParseMPRISVariant

func (p *Player) ParseMPRISVariant(v dbus.Variant) error

ParseMPRISVariant parses for possible variant info

type Status

type Status string

Status shows playback status

const (
	Playing Status = "Playing"
	Paused  Status = "Paused"
)

type Widget

type Widget struct {
	TrimTitle int
	// contains filtered or unexported fields
}

Widget implements the mpris widget

func NewWidget

func NewWidget(ws *widgets.Widgets) (*Widget, error)

NewWidget makes a new clock with the precision of a second

func (*Widget) Draw

func (w *Widget) Draw() string

Draw draws the clock

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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