common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: Unlicense Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoError = Response{0, ""}

Functions

This section is empty.

Types

type Args

type Args struct {
	SocketPath       string   `arg:"-s,--socket" help:"use the given SOCKET file" default:"/tmp/gxhk.sock" json:"-"`
	ConfigFiles      []string `arg:"-c,--config,separate" help:"use the given CONFIG file, besides all the others" json:"-"`
	NoDefaultConfigs bool     `arg:"-C,--no-default-configs" help:"ignore the default config files" json:"-"`

	Bind   *BindCmd   `arg:"subcommand:bind" help:"bind keys to commands" json:",omitempty"`
	Unbind *UnbindCmd `arg:"subcommand:unbind" help:"unbind keys" json:",omitempty"`
	Info   *InfoCmd   `arg:"subcommand:info" help:"show infos about the bound keys and their commands" json:",omitempty"`
}

func ParseArgs

func ParseArgs() (Args, *arg.Parser)

type BindCmd

type BindCmd struct {
	Released    bool   `arg:"-r" help:"bind the HOTKEY on its release instead of its press"`
	Hotkey      string `arg:"positional,required" help:"the hotkey to trigger the RUNCOMMAND"`
	RunCommand  string `arg:"positional,required" help:"the command to be run by 'sh' when the HOTKEY gets triggered"`
	Description string `arg:"positional" help:"an optional description to be shown by the 'info' subcommand"`
}

type InfoCmd

type InfoCmd struct {
	Hotkey string `arg:"positional" help:"if set, show only info about the given HOTKEY"`
}

type Response

type Response struct {
	Status  int
	Message string
}

The Response stores the response which gets displayed. WARNING: Make sure that yout Message doesn't end in a newline!!! That's beacuse the client will display a newline after the Message.

type UnbindCmd

type UnbindCmd struct {
	Released bool   `arg:"-r" help:"unbind the HOTKEY's on-release command instead of the on-press one"`
	Hotkey   string `arg:"positional,required" help:"the hotkey to be unbound"`
}

Jump to

Keyboard shortcuts

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