config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvaluateRules added in v0.2.1

func EvaluateRules(conditions []Rules, sourceFile string) bool

func SaveState

func SaveState(file string, state *DotfileState) error

func StateFile

func StateFile() string

Types

type Dir

type Dir struct {
	Path          string      `yaml:"path"`
	Paths         []string    `yaml:"paths"` // Can be used to specify multiple possible paths, first one that exists will be used.
	Target        string      `yaml:"target"`
	Rules         []Rules     `yaml:"rules"`         // At least one condition must match for the rule to apply
	TemplateFiles []string    `yaml:"templateFiles"` // Files that need to be processed as templates, allowing the use of theme properties
	ThemeFiles    []ThemeFile `yaml:"themeFiles"`    // Theme-specific files to copy
}

type DotfileState

type DotfileState struct {
	Theme        string       `json:"theme"`
	ActiveTheme  *ThemeConfig `json:"active_theme"`
	Source       string       `json:"source"`
	ManagedFiles []string     `json:"managed_files"`
}

func LoadState

func LoadState(file string) (*DotfileState, error)

type DotfilesConfig

type DotfilesConfig struct {
	Themes      []ThemeConfig  `yaml:"themes"`             // Themes defines theme-specific configurations
	Commands    []ThemeCommand `yaml:"activationCommands"` // Commands to run when a theme is activated
	Directories []Dir          `yaml:"directories"`        // Directories to copy
	Includes    []string       `yaml:"includes"`           // Include optional configuration files
}

func Load

func Load(file string, require bool) (*DotfilesConfig, error)

func (*DotfilesConfig) GetTheme added in v0.2.10

func (c *DotfilesConfig) GetTheme(name string) *ThemeConfig

type Rules added in v0.2.1

type Rules struct {
	Rule    string   `yaml:"rule"`
	Exclude []string `yaml:"exclude"` // Exclude paths or files
}

type ThemeCommand added in v0.2.7

type ThemeCommand struct {
	Command   string `yaml:"command"`
	OnChange  bool   `yaml:"onChange"`
	Condition string `yaml:"condition"`
}

type ThemeConfig added in v0.2.6

type ThemeConfig struct {
	Name         string            `yaml:"name"`
	ColorScheme  string            `yaml:"colorScheme"`
	WallpaperDir string            `yaml:"wallpaperDir"`
	FontFamily   string            `yaml:"fontFamily"`
	FontSize     string            `yaml:"fontSize"`
	GtkTheme     string            `yaml:"gtkTheme"`
	IconTheme    string            `yaml:"iconTheme"`
	CursorTheme  string            `yaml:"cursorTheme"`
	Properties   map[string]string `yaml:"properties"`
	Commands     []ThemeCommand    `yaml:"commands"`
}

type ThemeFile added in v0.2.6

type ThemeFile struct {
	Target  string            `yaml:"target"`
	Sources map[string]string `yaml:"sources"`
}

Jump to

Keyboard shortcuts

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