config

package
v0.0.0-...-c3f8d49 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bar

type Bar struct {
	ID string
}

Bar defines the configuration of a bar.

type Binding

type Binding struct {
	Modifiers uint32
	Keys      []xkb.KeySym
	Command   *Command
	Raw       string
}

Binding defines a keybinding with related command.

func (*Binding) Bigger

func (b *Binding) Bigger(a *Binding) bool

Bigger returns true if binding b is bigger than binding a.

func (*Binding) Equal

func (b *Binding) Equal(a *Binding) bool

Equal returns true if two keybindings are identical.

func (*Binding) Less

func (b *Binding) Less(a *Binding) bool

Less returns true if binding b is less than binding a.

type Bindings

type Bindings []*Binding

Bindings is a list of keybindings.

func (Bindings) Len

func (b Bindings) Len() int

Len returns the length of the binding list.

func (Bindings) Less

func (b Bindings) Less(i, j int) bool

Less returns true if binding at index i should be sorted before binding at index j.

func (Bindings) Swap

func (b Bindings) Swap(i, j int)

Swap swaps two bindings in the bindings list.

type Command

type Command struct {
	Executer
	// TODO: criteria
	Criteria *Criteria
	Next     *Command
}

Command defines a command with criteria and possible chained sub commands.

func (*Command) Run

func (c *Command) Run(ctx context.Context) error

Run runs a command and any subsequent commands if it's chained.

func (*Command) String

func (c *Command) String() string

String returns the string representation of a command.

type Config

type Config struct {
	Modes      map[string][]*Binding
	Workspaces map[uint]string
	Bars       map[string]Bar
	Outputs    map[string]Output
	Gaps       struct {
		Inner uint
		Outer uint
	}
	// contains filtered or unexported fields
}

Config defines the configuration of a compositor.

func Get

func Get(ctx context.Context) *Config

Get config from context.

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads config file from disk.

func New

func New() *Config

New initializes a new default config.

func (*Config) AddBinding

func (c *Config) AddBinding(mode string, b *Binding) error

AddBinding adds a binding to the current mode.

func (*Config) Bindings

func (c *Config) Bindings() []*Binding

Bindings returns a list of bindings for the current mode.

func (*Config) VarReplace

func (c *Config) VarReplace(str string) string

VarReplace replaces variables with the actual value. TODO: implement this better

type Criteria

type Criteria int

Criteria - TODO: not implemented.

type Exec

type Exec string

Exec implements the exec command.

func (Exec) Exec

func (e Exec) Exec(ctx context.Context) error

Exec executes the exec command.

func (Exec) String

func (e Exec) String() string

String returns a string formatting of the exec command.

type Executer

type Executer interface {
	Exec(context.Context) error
	String() string
}

Executer is an interface describing how to execute commands.

type Exit

type Exit struct{}

Exit implements the exit command.

func (Exit) Exec

func (e Exit) Exec(ctx context.Context) error

Exec executes the exit command.

func (Exit) String

func (e Exit) String() string

String returns a string formatting of the exit command.

type Output

type Output struct {
	ID         string
	Enabled    bool
	Size       wlc.Size
	Pos        wlc.Point
	Background struct {
		Path string
		Mode string
	}
}

Output defines the configuration of an output.

Jump to

Keyboard shortcuts

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