i3parse

package
v0.0.0-...-99e368e Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CodeToSymbol

func CodeToSymbol(key string) (string, error)

CodeToSymbol returns a code binding with the symbol equivalent

func ParseFromFile

func ParseFromFile(path string, logError bool) ([]Mode, []Variable, error)

ParseFromFile loads config from path

func ParseFromRunning

func ParseFromRunning(wm string, logError bool) ([]Mode, []Variable, error)

ParseFromRunning loads config from the running i3 instance

Types

type Binding

type Binding struct {
	Key       string   `json:"key"`
	Modifiers []string `json:"modifiers"`
	Command   string   `json:"command"`
	// contains filtered or unexported fields
}

Binding holds one key binding. Can only be a keysymbol

type Mode

type Mode struct {
	Name     string    `json:"name"`
	Bindings []Binding `json:"bindings"`
}

Mode holds i3 bind modes

type ModifierGroup

type ModifierGroup struct {
	Modifiers []string  `json:"modifiers"`
	Bindings  []Binding `json:"bindings"`
}

ModifierGroup holds bindings with the same modifiers

func GetModifierGroups

func GetModifierGroups(bindings []Binding) []ModifierGroup

GetModifierGroups groups bindings that have the same modifiers

type SortByVarbyLen

type SortByVarbyLen []Variable

func (SortByVarbyLen) Len

func (a SortByVarbyLen) Len() int

func (SortByVarbyLen) Less

func (a SortByVarbyLen) Less(i, j int) bool

func (SortByVarbyLen) Swap

func (a SortByVarbyLen) Swap(i, j int)

type Variable

type Variable struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Variable holds one variable in the config file

Jump to

Keyboard shortcuts

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