common

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func CacheEnabled added in v2.4.0

func CacheEnabled() bool

func CacheFolderPath

func CacheFolderPath(name string) string

func ConfigFolderPath

func ConfigFolderPath(name string) string

func Hash

func Hash(text string) string

func InitArgs

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

func InitCache

func InitCache()

func InitConfig

func InitConfig()

func InitFiles

func InitFiles(toml, icon []byte)

func IsInList

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

func IsInsideRect

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

func IsType

func IsType(a interface{}, b interface{}) bool

func IsZero

func IsZero(items []uint) bool

func Latest

func Latest(source string) string

func Truncate

func Truncate(s string, max int) string

func VersionToInt

func VersionToInt(version string) int

Types

type Arguments

type Arguments struct {
	Cache  string // Argument for cache folder path
	Config string // Argument for config file path
	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
	Source  string // Build source
	Latest  string // Build latest
	Summary string // Build summary
}

type Cache

type Cache[T any] struct {
	Folder string // Cache file folder
	Name   string // Cache file name
	Data   T      // Cache file data
}

type Configuration

type Configuration struct {
	TilingEnabled     bool              `toml:"tiling_enabled"`      // Tile windows on startup
	TilingLayout      string            `toml:"tiling_layout"`       // Initial tiling layout
	TilingGui         int               `toml:"tiling_gui"`          // Time duration of gui
	TilingIcon        [][]string        `toml:"tiling_icon"`         // Menu entries of systray
	WindowIgnore      [][]string        `toml:"window_ignore"`       // Regex to ignore windows
	WindowMastersMax  int               `toml:"window_masters_max"`  // Maximum number of allowed masters
	WindowSlavesMax   int               `toml:"window_slaves_max"`   // Maximum number of allowed slaves
	WindowGapSize     int               `toml:"window_gap_size"`     // Gap size between windows
	WindowDecoration  bool              `toml:"window_decoration"`   // Show window decorations
	ProportionStep    float64           `toml:"proportion_step"`     // Master-slave area step size proportion
	ProportionMin     float64           `toml:"proportion_min"`      // Window size minimum proportion
	EdgeMargin        []int             `toml:"edge_margin"`         // Margin values of tiling area
	EdgeMarginPrimary []int             `toml:"edge_margin_primary"` // Margin values of primary tiling area
	EdgeCornerSize    int               `toml:"edge_corner_size"`    // Size of square defining edge corners
	EdgeCenterSize    int               `toml:"edge_center_size"`    // Length of rectangle defining edge centers
	Colors            map[string][]int  `toml:"colors"`              // List of color values for gui elements
	Keys              map[string]string `toml:"keys"`                // Event bindings for keyboard shortcuts
	Corners           map[string]string `toml:"corners"`             // Event bindings for hot-corner actions
	Systray           map[string]string `toml:"systray"`             // Event bindings for systray icon
}
var (
	Config Configuration // Decoded config values
)

type FileData

type FileData struct {
	Toml []byte // Default config file
	Icon []byte // Application icon
}
var (
	File FileData // Embedded file bytes
)

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