themeable

package
v0.1.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Registry = map[string]NewThemeable{
	"OneCommander":    newOneCommander,
	"PythonIDLE":      newPythonIDLE,
	"Spyder":          newSpyder,
	"WindowsTerminal": newWindowsTerminal,
}

Registry of themeable program creators

Functions

func LoadConfig

func LoadConfig() (map[string]ThemeConfig, error)

LoadConfig loads the config file and returns the ThemeConfig If the config file does not exist, it will return an error If the config file is not valid, it will return an error

func SetTheme

func SetTheme(program Themeable, theme string) error

SetTheme sets the theme for the program Given a themeable program and a theme name, it will set the theme If the theme name is not valid, it will return an error

Types

type NewThemeable

type NewThemeable func(ThemeConfig) Themeable

type OneCommander

type OneCommander struct {
	ThemeConfig // theme config
}

OneCommander is a program that can be themed

func (OneCommander) SetTheme

func (programTheme OneCommander) SetTheme(theme string) error

OneCommander.SetTheme sets the theme for OneCommander Given a theme name, it will set the theme If the theme name is not valid, it will return an error

type PythonIDLE

type PythonIDLE struct {
	ThemeConfig // theme config
}

PythonIDLE is a program that can be themed

func (PythonIDLE) SetTheme

func (programTheme PythonIDLE) SetTheme(theme string) error

PythonIDLE.SetTheme sets the theme for PythonIDLE Given a theme name, it will set the theme If the theme name is not valid, it will return an error

type Spyder

type Spyder struct {
	ThemeConfig // theme config
}

Spyder is a program that can be themed

func (Spyder) SetTheme

func (programTheme Spyder) SetTheme(theme string) error

Spyder.SetTheme sets the theme for Spyder Given a theme name, it will set the theme If the theme name is not valid, it will return an error

type ThemeConfig

type ThemeConfig struct {
	Light      string `json:"light"`      // prefered theme name for light mode
	Dark       string `json:"dark"`       // prefered theme name for dark mode
	ConfigPath string `json:"configpath"` // config file path
}

light and dark theme names, and config file path

func (ThemeConfig) GetTheme

func (programTheme ThemeConfig) GetTheme(theme string) string

GetTheme returns the theme name based on the theme flag If the theme flag is not valid, it will return the default theme

type Themeable

type Themeable interface {
	SetTheme(string) error
}

Interface for program that can be themed.

type WindowsTerminal

type WindowsTerminal struct {
	ThemeConfig // theme config
}

WindowsTerminal is a program that can be themed

func (WindowsTerminal) SetTheme

func (programTheme WindowsTerminal) SetTheme(theme string) error

WindowsTerminal.SetTheme sets the theme for WindowsTerminal Given a theme name, it will set the theme If the theme name is not valid, it will return an error

Jump to

Keyboard shortcuts

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