config

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

ConfigDir returns the abs-cli configuration directory path.

func EnsureExists added in v0.5.0

func EnsureExists(path string, cfg Config) error

EnsureExists creates a default config file when path does not exist.

func Save added in v0.5.0

func Save(path string, cfg Config) error

Save writes a Config struct to path in TOML format.

Types

type Config

type Config struct {
	Player     PlayerConfig   `toml:"player"`
	Theme      ui.ThemeConfig `toml:"theme"`
	Keybinds   KeybindsConfig `toml:"keybinds"`
	DeviceName string         `toml:"device_name"`
	DeviceID   string         `toml:"device_id"`
}

func Default

func Default() Config

func Load

func Load(path string) (Config, error)

Load reads a TOML config file at path, merging with defaults. If path is empty or the file doesn't exist, defaults are returned.

type KeybindsConfig

type KeybindsConfig struct {
	Quit         string `toml:"quit"`
	PlayPause    string `toml:"play_pause"`
	SeekForward  string `toml:"seek_forward"`
	SeekBackward string `toml:"seek_backward"`
	NextInQueue  string `toml:"next_in_queue"`
	SpeedUp      string `toml:"speed_up"`
	SpeedDown    string `toml:"speed_down"`
	VolumeUp     string `toml:"volume_up"`
	VolumeDown   string `toml:"volume_down"`
	SleepTimer   string `toml:"sleep_timer"`
	Back         string `toml:"back"`
}

type PlayerConfig

type PlayerConfig struct {
	Speed       float64 `toml:"speed"`
	SeekSeconds int     `toml:"seek_seconds"`
}

Jump to

Keyboard shortcuts

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