config

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2019 License: GPL-3.0 Imports: 8 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	DebugMode: false,
	ColourScheme: ColourScheme{
		Cursor:       strToColourNoErr("#e8dfd6"),
		Foreground:   strToColourNoErr("#e8dfd6"),
		Background:   strToColourNoErr("#021b21"),
		Black:        strToColourNoErr("#000000"),
		Red:          strToColourNoErr("#800000"),
		Green:        strToColourNoErr("#008000"),
		Yellow:       strToColourNoErr("#808000"),
		Blue:         strToColourNoErr("#000080"),
		Magenta:      strToColourNoErr("#800080"),
		Cyan:         strToColourNoErr("#008080"),
		LightGrey:    strToColourNoErr("#f2f2f2"),
		DarkGrey:     strToColourNoErr("#808080"),
		LightRed:     strToColourNoErr("#ff0000"),
		LightGreen:   strToColourNoErr("#00ff00"),
		LightYellow:  strToColourNoErr("#ffff00"),
		LightBlue:    strToColourNoErr("#0000ff"),
		LightMagenta: strToColourNoErr("#ff00ff"),
		LightCyan:    strToColourNoErr("#00ffff"),
		White:        strToColourNoErr("#ffffff"),
		Selection:    strToColourNoErr("#333366"),
	},
	KeyMapping:            KeyMappingConfig(map[string]string{}),
	SearchURL:             "https://www.google.com/search?q=$QUERY",
	MaxLines:              1000,
	CopyAndPasteWithMouse: true,
}

Functions

This section is empty.

Types

type Colour

type Colour [3]float32

func (Colour) MarshalText

func (c Colour) MarshalText() (text []byte, err error)

func (*Colour) UnmarshalText

func (c *Colour) UnmarshalText(data []byte) error

type ColourScheme

type ColourScheme struct {
	Cursor       Colour `toml:"cursor"`
	Foreground   Colour `toml:"foreground"`
	Background   Colour `toml:"background"`
	Black        Colour `toml:"black"`
	Red          Colour `toml:"red"`
	Green        Colour `toml:"green"`
	Yellow       Colour `toml:"yellow"`
	Blue         Colour `toml:"blue"`
	Magenta      Colour `toml:"magenta"`
	Cyan         Colour `toml:"cyan"`
	LightGrey    Colour `toml:"light_grey"`
	DarkGrey     Colour `toml:"dark_grey"`
	LightRed     Colour `toml:"light_red"`
	LightGreen   Colour `toml:"light_green"`
	LightYellow  Colour `toml:"light_yellow"`
	LightBlue    Colour `toml:"light_blue"`
	LightMagenta Colour `toml:"light_magenta"`
	LightCyan    Colour `toml:"light_cyan"`
	White        Colour `toml:"white"`
	Selection    Colour `toml:"selection"`
}

type Config

type Config struct {
	DebugMode             bool             `toml:"debug"`
	Slomo                 bool             `toml:"slomo"`
	ColourScheme          ColourScheme     `toml:"colours"`
	DPIScale              float32          `toml:"dpi-scale"`
	Shell                 string           `toml:"shell"`
	KeyMapping            KeyMappingConfig `toml:"keys"`
	SearchURL             string           `toml:"search_url"`
	MaxLines              uint64           `toml:"max_lines"`
	CopyAndPasteWithMouse bool             `toml:"copy_and_paste_with_mouse"`
}

func Parse

func Parse(data []byte) (*Config, error)

func (*Config) Encode

func (c *Config) Encode() ([]byte, error)

type KeyCombination added in v0.5.0

type KeyCombination struct {
	// contains filtered or unexported fields
}

func (KeyCombination) Match added in v0.5.0

func (combi KeyCombination) Match(pressedMods glfw.ModifierKey, pressedChar rune) bool

type KeyMappingConfig added in v0.5.0

type KeyMappingConfig map[string]string

func (KeyMappingConfig) GenerateActionMap added in v0.5.0

func (keyMapConfig KeyMappingConfig) GenerateActionMap() (map[UserAction]*KeyCombination, error)

type KeyMod added in v0.5.0

type KeyMod string

type UserAction added in v0.5.0

type UserAction string
const (
	ActionCopy        UserAction = "copy"
	ActionPaste       UserAction = "paste"
	ActionSearch      UserAction = "search"
	ActionReportBug   UserAction = "report"
	ActionToggleDebug UserAction = "debug"
	ActionToggleSlomo UserAction = "slomo"
)

Jump to

Keyboard shortcuts

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