mirror of
https://codeberg.org/scip/swayipc.git
synced 2026-08-24 06:44:19 +02:00
rename non-camel-case vars, refactor, satisfy linter
This commit is contained in:
16
command.go
16
command.go
@@ -7,24 +7,26 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Execute the specified global command[s] (one or more commands can be
|
||||
// given) and returns a response list.
|
||||
// RunGlobalCommand can be used to execute the specified global
|
||||
// command[s] (one or more commands can be given) and returns a
|
||||
// response list.
|
||||
//
|
||||
// Possible commands are all non-specific commands, see sway(5)
|
||||
func (ipc *SwayIPC) RunGlobalCommand(command ...string) ([]Response, error) {
|
||||
return ipc.RunCommand(0, "", command...)
|
||||
}
|
||||
|
||||
// Execute the specified container command[s] (one or more commands can be
|
||||
// given) and returns a response list.
|
||||
// RunContainerCommand can be used to execute the specified container
|
||||
// command[s] (one or more commands can be given) and returns a
|
||||
// response list.
|
||||
//
|
||||
// Possible commands are all container-specific commands, see sway(5)
|
||||
func (ipc *SwayIPC) RunContainerCommand(id int, command ...string) ([]Response, error) {
|
||||
return ipc.RunCommand(id, "con", command...)
|
||||
}
|
||||
|
||||
// Execute the specified (target) command[s] (one or more commands can be
|
||||
// given) and returns a response list.
|
||||
// RunCommand executes the specified (target) command[s] (one or more
|
||||
// commands can be given) and returns a response list.
|
||||
//
|
||||
// Possible commands are all container-specific commands, see sway(5).
|
||||
//
|
||||
@@ -41,7 +43,7 @@ func (ipc *SwayIPC) RunCommand(id int, target string, command ...string) ([]Resp
|
||||
commands = fmt.Sprintf("[%s_id=%d] %s", target, id, commands)
|
||||
}
|
||||
|
||||
err := ipc.sendHeader(RUN_COMMAND, uint32(len(commands)))
|
||||
err := ipc.sendHeader(MsgRunCommand, uint32(len(commands)))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to send run_command to IPC %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user