config

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Directory string
	Path      string
)

Functions

func GetPlayer

func GetPlayer(conf *Config) (player.Player, error)

GetPlayer returns a player based on config values

func Save

func Save(config *Config) error

Types

type Config

type Config struct {
	Player         string `default:"spotify" yaml:"player"`
	IgnoreErrors   bool   `default:"true" yaml:"ignoreErrors"`
	TimerInterval  int    `default:"200" yaml:"timerInterval"`
	UpdateInterval int    `default:"2000" yaml:"updateInterval"`

	Style struct {
		HAlignment string `default:"center" yaml:"hAlignment"`

		Before  Style `default:"{\"bold\": true}" yaml:"before"`
		Current Style `default:"{\"bold\": true}" yaml:"current"`
		After   Style `default:"{\"faint\": true}" yaml:"after"`
	} `yaml:"style"`

	Pipe struct {
		Length   int    `yaml:"length"`
		Overflow string `default:"word" yaml:"overflow"`
	} `yaml:"pipe"`

	Mpd struct {
		Address  string `default:"127.0.0.1:6600" yaml:"address"`
		Password string `yaml:"password"`
	} `yaml:"mpd"`

	Mopidy struct {
		Address string `default:"127.0.0.1:6680" yaml:"address"`
	} `yaml:"mopidy"`

	Mpris struct {
		Players []string `default:"[]" yaml:"players"`
	} `yaml:"mpris"`

	Browser struct {
		Port int `default:"8974" yaml:"port"`
	} `yaml:"browser"`

	Local struct {
		Folder string `yaml:"folder"`
	} `yaml:"local"`
}

func Load

func Load() (*Config, error)

func New

func New() *Config

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(f func(interface{}) error) error

https://stackoverflow.com/a/56080478

type Style

type Style struct {
	Background string `yaml:"background"`
	Foreground string `yaml:"foreground"`

	Bold          bool `yaml:"bold"`
	Italic        bool `yaml:"italic"`
	Underline     bool `yaml:"underline"`
	Strikethrough bool `yaml:"strikethrough"`
	Blink         bool `yaml:"blink"`
	Faint         bool `yaml:"faint"`
}

func (Style) Parse

func (s Style) Parse() gloss.Style

Jump to

Keyboard shortcuts

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