River control
此接口允许客户端运行 compositor 命令,并分别接收带有输出或失败消息的成功/失败响应。
每个命令通过一系列 add_argument 请求构建,并通过 run_command 请求执行。第一个参数是要运行的命令。
compositor 的 man 手册中应提供完整的命令列表。
destroy()
此请求表明客户端将不再使用 river_control 对象。通过此实例创建的对象不受影响。
add_argument(argument: string)
参数 | 类型 | 描述 |
|---|---|---|
| argument | string | the argument to add |
在发起 run_command 请求之前,服务器会按照参数发送的顺序存储参数。
run_command(seat: object<wl_seat>, callback: new_id<zriver_command_callback_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| seat | object<wl_seat> | |
| callback | new_id<zriver_command_callback_v1> | callback object |
针对给定的 seat 执行使用 add_argument 请求构建的命令。
此对象由 run_command 请求创建。将发送 success 或 failure 事件中的且仅发送其中一个。发送其中一个事件后,compositor 将销毁此对象。
success(output: string)
参数 | 类型 | 描述 |
|---|---|---|
| output | string | the output of the command |
当 compositor 成功接收并执行命令时发送。某些命令可能会产生输出,在这种情况下,output 参数将是一个非空字符串。
failure(failure_message: string)
参数 | 类型 | 描述 |
|---|---|---|
| failure_message | string | a message explaining why failure occurred |
当无法执行命令时发送。这可能是由于发送了不存在的命令、没有命令、参数不足、参数过多、参数无效等原因。
合成器支持
Cage | COSMIC | GameScope | Hyprland | Jay | KWin | Labwc | Louvre | Mir | Muffin | Mutter | niri | phoc | river | Sway | Treeland | Wayfire | Weston | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| zriver_control_v1 | x | x | x | x | x | x | x | x | x | x | x | x | x | 1 | x | x | x | x |
Copyright
Copyright 2020 The River Developers
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.