common

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Process ProcessInfo // Process information
	Build   BuildInfo   // Build information
	Source  SourceInfo  // Source information
)

Functions

func AllTrue added in v2.5.0

func AllTrue(items []bool) bool

func AllZero added in v2.5.0

func AllZero(items []uint) bool

func CacheDisabled added in v2.5.1

func CacheDisabled() bool

func CacheFolderPath

func CacheFolderPath(name string) string

func ConfigFolderPath

func ConfigFolderPath(name string) string

func FlagParse added in v2.5.1

func FlagParse(flags *flag.FlagSet, args []string)

func HasFlag added in v2.5.1

func HasFlag(name string) bool

func HasIssueInfos added in v2.5.1

func HasIssueInfos() bool

func HasReleaseInfos added in v2.5.1

func HasReleaseInfos() bool

func HasUnseenInfos added in v2.5.1

func HasUnseenInfos() bool

func HashString added in v2.5.0

func HashString(text string, max int) string

func InitArgs

func InitArgs(introspect map[string][]string)

func InitCache

func InitCache()

func InitConfig

func InitConfig()

func InitFiles

func InitFiles(toml, logo []byte)

func InitInfo added in v2.5.0

func InitInfo(name, target, version, commit, date, source string)

func IsDevVersion added in v2.5.1

func IsDevVersion() bool

func IsInList

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

func IsInMap added in v2.5.1

func IsInMap(m Map, keys []string) bool

func IsInsideRect

func IsInsideRect(p Point, g Geometry) bool

func RemoveChars added in v2.5.1

func RemoveChars(s string, chars []string) string

func ReverseList added in v2.5.0

func ReverseList[T any](items []T) []T

func SemverUpdateInfos added in v2.5.1

func SemverUpdateInfos() (bool, bool, bool)

func StringsToInts added in v2.5.1

func StringsToInts(items []string) []int

func TruncateString added in v2.5.0

func TruncateString(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
	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
	P      []string // Argument for positional values
	Dbus   struct {
		Listen   bool     // Argument for dbus listen flag
		Method   string   // Argument for dbus method name
		Property string   // Argument for dbus property name
		P        []string // Argument for dbus positional values
	}
}
var (
	Args Arguments // Parsed arguments
)

type BuildInfo

type BuildInfo struct {
	Name    string // Build name
	Target  string // Build target
	Version string // Build version
	Commit  string // Build commit
	Date    string // Build date
	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
}
var (
	File FileData // Embedded file bytes
)

type Geometry added in v2.5.0

type Geometry struct {
	X      int // Object geometry x position
	Y      int // Object geometry y position
	Width  int // Object geometry width dimension
	Height int // Object geometry height dimension
}

func CreateGeometry added in v2.5.0

func CreateGeometry(r xrect.Rect) *Geometry

func (*Geometry) Center added in v2.5.0

func (g *Geometry) Center() Point

func (*Geometry) Pieces added in v2.5.0

func (g *Geometry) Pieces() (int, int, int, int)

func (*Geometry) Rect added in v2.5.0

func (g *Geometry) Rect() xrect.Rect

type Info added in v2.5.1

type Info struct {
	Id      int    // Source item id
	Url     string // Source item url
	Name    string // Source item name
	Created string // Source item date
	Type    string // Source item type
	Extra   *Info  // Source extra info
}

func FetchIssues added in v2.5.1

func FetchIssues(hostname, repository, labels string) []Info

func FetchReleases added in v2.5.1

func FetchReleases(hostname, repository string) []Info

func (*Info) Cache added in v2.5.1

func (i *Info) Cache() Cache[*Info]

func (*Info) Seen added in v2.5.1

func (i *Info) Seen() bool

func (*Info) Unseen added in v2.5.1

func (i *Info) Unseen() bool

type List added in v2.5.1

type List = []Map // Generic list type

type Map added in v2.5.0

type Map = map[string]interface{} // Generic map type

type Point added in v2.5.0

type Point struct {
	X int // Object point x position
	Y int // Object point y position
}

func CreatePoint added in v2.5.0

func CreatePoint(x int, y int) *Point

type ProcessInfo added in v2.5.0

type ProcessInfo struct {
	Id   int            // Process id
	Path string         // Process path
	User *user.User     // Process user
	Host *host.InfoStat // Process host
}

type SourceInfo added in v2.5.1

type SourceInfo struct {
	Hostname   string // Source code hostname
	Repository string // Source code repository
	Releases   []Info // Source code releases
	Issues     []Info // Source code issues
}

Jump to

Keyboard shortcuts

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