Documentation ¶
Index ¶
- Variables
- func AddEventInfo(infos *string, hotkey string, eventName string, description string)
- func Bind(bindArgs common.BindCmd) error
- func Exec(command string)
- func GetAllInfo() (info string)
- func GetInfo(hotkeyStr string) (res common.Response)
- func GetSocket(socketPath string) (socket net.Listener, err error)
- func HandleConnection(conn net.Conn)
- func HandleEvent(event xgb.Event)
- func HandleHotkeys()
- func MakeDescription(description string, command string) string
- func SocketLoop()
- func StartDaemon(args common.Args) int
- func Unbind(unbindArgs common.UnbindCmd) error
- type Hotkey
- type HotkeyMap
Constants ¶
This section is empty.
Variables ¶
var ( Socket net.Listener X *xgbutil.XUtil KeyPressCommands = NewHotkeyMap() KeyPressDescriptions = NewHotkeyMap() KeyReleaseCommands = NewHotkeyMap() KeyReleaseDescriptions = NewHotkeyMap() )
var IgnoreMods uint16 = xproto.ModMask2 | xproto.ModMaskLock
Functions ¶
func AddEventInfo ¶
AddEventInfo handles the logic behind creating a new line and filling it with the infos necessary for the 'info' command for each bound hotkey
func Exec ¶
func Exec(command string)
Exec executes the given sh command string. This method is blocking.
func GetAllInfo ¶
func GetAllInfo() (info string)
GetAllInfo creates a string with all the bound hotkeys there are, both those bound on press and those bound on release.
func GetInfo ¶
GetInfo returns the information about what is bound to the given hotkeyStr. It returns a Response structure to easily accomodate the need to mention parsing errors if the hotkeyStr is "naughty". The first Hotkey to be parsed should be the main one, which represents our needed description in the description maps.
func HandleConnection ¶
func HandleEvent ¶
func HandleHotkeys ¶
func HandleHotkeys()
func MakeDescription ¶
MakeDescription handles the logic behind generating a dummy description for the commands which don't come with a description (i.e. it is empty) from the command string, or returning the description if it isn't empty
func SocketLoop ¶
func SocketLoop()
func StartDaemon ¶
Types ¶
type Hotkey ¶
type Hotkey struct {
// contains filtered or unexported fields
}
func HotkeysFromStr ¶
HotkeysFromStr parses a hotkey string and returns the according Hotkey's. Mods are unambiguous (though we ignore here the Num and Caps Lock). Keycodes aren't, though. For instance, on some layouts, there are 2 keys with different keycodes which map to 'backslash' AKA '\'. And we want to handle them both. This is why we return an array of Hotkey's here. And an error if the string is "naughty".
type HotkeyMap ¶
func NewHotkeyMap ¶
func NewHotkeyMap() HotkeyMap