Documentation ¶
Overview ¶
Package cfg allows for reading the user's configuration.
Index ¶
Constants ¶
const ( ActionIngameReset int = iota ActionIngameFocus ActionIngameRes )
Keybind actions
Variables ¶
This section is empty.
Functions ¶
func GetDirectory ¶
GetDirectory returns the path to the user's configuration directory.
func MakeProfile ¶
MakeProfile makes a new configuration profile with the given name and the default settings.
Types ¶
type Action ¶
type Action struct { // The type of action. Type int // Extra detail for the action (e.g. instance number.) Extra *int }
Action represents a single keybind action.
type ActionList ¶
ActionList contains a list of actions to perform when a keybind is pressed.
func (*ActionList) UnmarshalTOML ¶
func (a *ActionList) UnmarshalTOML(value any) error
UnmarshalTOML implements toml.Unmarshaler.
type AltRes ¶ added in v0.6.0
type AltRes []Rectangle
AltRes represents a list of alternate resolutions.
func (*AltRes) UnmarshalTOML ¶ added in v0.6.0
UnmarshalTOML implements toml.Unmarshaler.
type AltResHook ¶ added in v0.6.0
type AltResHook []string
AltResHook represents a list of hooks to run for each alternate resolution (in order).
func (*AltResHook) UnmarshalTOML ¶ added in v0.6.0
func (a *AltResHook) UnmarshalTOML(value any) error
UnmarshalTOML implements toml.Unmarshaler.
type Bind ¶
type Bind struct { Button *xproto.Button // The button for this keybind (if any.) Key *xproto.Keycode // The key for this keybind (if any.) Mods [4]xproto.Keycode // The list of key modifiers for this keybind (if any.) ModCount int // The number of modifiers in use. // contains filtered or unexported fields }
Bind represents a single keybinding.
func (*Bind) UnmarshalTOML ¶
UnmarshalTOML implements toml.Unmarshaler.
type Hooks ¶
type Hooks struct { Reset string `toml:"reset"` // Command to run on ingame reset AltRes AltResHook `toml:"alt_res"` // Command to run on alternate resolution NormalRes NormalResHook `toml:"normal_res"` // Command to run on normal resolution FocusLost string `toml:"focus_lost"` // Command to run when instance loses focus FocusGained string `toml:"focus_gained"` // Command to run when instance gains focus }
Hooks contains various commands to run whenever the user performs certain actions.
type Keybinds ¶
type Keybinds map[Bind]ActionList
Keybinds contains the user's keybindings.
func (*Keybinds) UnmarshalTOML ¶
UnmarshalTOML implements toml.Unmarshaler.
type NormalResHook ¶ added in v0.6.0
type NormalResHook []string
AltResHook represents a list of hooks to run for each alternate resolution (in order) when switching from that resolution to the normal resolution.
func (*NormalResHook) UnmarshalTOML ¶ added in v0.6.0
func (a *NormalResHook) UnmarshalTOML(value any) error
UnmarshalTOML implements toml.Unmarshaler.
type Profile ¶
type Profile struct { PollRate int `toml:"poll_rate"` // Polling rate for input handling NormalRes *Rectangle `toml:"play_res"` // Normal resolution AltRes AltRes `toml:"alt_res"` // Alternate ingame resolution Hooks Hooks `toml:"hooks"` Keybinds Keybinds `toml:"keybinds"` }
Profile contains an entire configuration profile.
func GetProfile ¶
GetProfile returns a parsed configuration profile.