config

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 35 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

Overview

Package config reads lys-wm's YAML config into validated types. Every error names the file, the line and the key.

Index

Constants

View Source
const (
	SourceBuiltIn = "built-in"
	SourceConfig  = "config"
	SourceRuntime = "runtime"
)
View Source
const RuntimeFile = "runtime.yaml"

Variables

View Source
var Default []byte

Functions

func ParseProp

func ParseProp(key, value string) (wm.Decision, error)

func Schema

func Schema() []byte

Types

type At

type At[T any] struct {
	V    T
	Line int
}

func (*At[T]) UnmarshalYAML

func (a *At[T]) UnmarshalYAML(n *yaml.Node) error

type Bind

type Bind struct {
	Submap string
	Chord  string
	Line   int
	Action wm.Action
	Flags  binds.Flags
	Desc   string
}

type Config

type Config struct {
	File            string
	Warnings        []error
	Keyboard        xkb.Names
	DeviceKeyboards map[string]xkb.Names
	DeviceOutputs   map[string]wm.OutputMatch
	RepeatRate      int32
	RepeatDelay     int32
	StickyKeys      bool
	SlowKeys        time.Duration
	NumLock         bool
	Input           session.InputConfig
	Cursor          compositor.CursorBehavior
	Outputs         compositor.OutputRules
	VirtualOutputs  []compositor.VirtualOutput
	ColorManagement bool
	ClientHotkeys   bool
	HiddenFrame     time.Duration
	PowerSaverRate  int
	HoldOpening     bool
	Decor           compositor.Decor
	Font            string
	IconTheme       string
	WM              wm.Settings
	Binds           []Bind
	Rules           []wm.Rule
	Env             [][2]string
	Autostart       []string
	Xwayland        bool
	ZeroScaling     bool
	GPU             string
	Tearing         bool
	LidSuspend      bool
	Animations      anim.Table
	LayerRules      []wm.LayerRule
	WorkspaceRules  []compositor.WorkspaceRule
	Swallow         compositor.Swallow
	Gestures        compositor.Gestures
	HotCorners      compositor.HotCorners
	Overview        compositor.OverviewStyle
	Switcher        compositor.SwitcherStyle
	Slower          map[render.Speed]compositor.Effects
	// contains filtered or unexported fields
}

func Parse

func Parse(file string, data []byte) (Config, error)

func ParseLayers

func ParseLayers(accent render.Color, layers ...Layer) (Config, error)

func (Config) Compositor

func (c Config) Compositor(keymaps xkb.Keymaps, font *gtext.Typeface) (compositor.Config, error)

type Error

type Error struct {
	File string
	Line int
	Key  string
	Err  error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type KeySource

type KeySource struct {
	Path   []string `json:"path"`
	Source string   `json:"source"`
	File   string   `json:"file"`
	Line   int      `json:"line"`
	Value  any      `json:"value"`
}

func Sources

func Sources(layers ...Layer) ([]KeySource, error)

type Layer

type Layer struct {
	Source string
	File   string
	Data   []byte
}

Jump to

Keyboard shortcuts

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