common

package
v0.0.0-...-2e55a2e Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Build BuildInfo // Build information
	Args  Arguments // Parsed arguments
)

Functions

func ConfigFilePath

func ConfigFilePath(name string) string

func InitArgs

func InitArgs(name, version, commit, date string)

func InitConfig

func InitConfig()

func InitFiles

func InitFiles(toml []byte)

func IsInIntList

func IsInIntList(item int, items []int) bool

func IsInList

func IsInList(item string, items []string) bool

func IsInsideRect

func IsInsideRect(p *Pointer, r xrect.Rect) bool

func Truncate

func Truncate(s string, max int) string

Types

type Arguments

type Arguments struct {
	Config       string // Argument for config file path
	PrintDisplay bool   // Print the number of the current display
	Lock         string // Argument for lock file path
	Sock         string // Argument for sock file path
	Log          string // Argument for log file path
	VVV          bool   // Argument for very very verbose mode
	VV           bool   // Argument for very verbose mode
	V            bool   // Argument for verbose mode
}

type BuildInfo

type BuildInfo struct {
	Name    string // Build name
	Version string // Build version
	Commit  string // Build commit
	Date    string // Build date
	Summary string // Build summary
}

type Configuration

type Configuration struct {
	StickyDisplays []int             `toml:"sticky_displays"` // Display numbers to sticky windows on
	WindowIgnore   [][]string        `toml:"window_ignore"`   // Regex to ignore windows
	Keys           map[string]string `toml:"keys"`            // Event bindings for keyboard shortcuts
}
var (
	Config Configuration // Decoded config values
)

type FileData

type FileData struct {
	Toml []byte // Default config file
}
var File FileData

type Pointer

type Pointer struct {
	X      int16  // Pointer X position relative to root
	Y      int16  // Pointer Y position relative to root
	Button uint16 // Pointer button states of device
}

Jump to

Keyboard shortcuts

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