run compositor commands

This interface allows clients to run compositor commands and receive a success/failure response with output or a failure message respectively.

Each command is built up in a series of add_argument requests and executed with a run_command request. The first argument is the command to be run.

A complete list of commands should be made available in the man page of the compositor.

destroy()
destroy the river_control object

This request indicates that the client will not use the river_control object any more. Objects that have been created through this instance are not affected.

add_argument(argument: string)
Argument
Type
Description
argumentstring
the argument to add
add an argument to the current command

Arguments are stored by the server in the order they were sent until the run_command request is made.

run_command(seat: object<wl_seat>, callback: new_id<zriver_command_callback_v1>)
Argument
Type
Description
seatobject<wl_seat>
callbacknew_id<zriver_command_callback_v1>
callback object
run the current command

Execute the command built up using the add_argument request for the given seat.


callback object

This object is created by the run_command request. Exactly one of the success or failure events will be sent. This object will be destroyed by the compositor after one of the events is sent.

success(output: string)
Argument
Type
Description
outputstring
the output of the command
command successful

Sent when the command has been successfully received and executed by the compositor. Some commands may produce output, in which case the output argument will be a non-empty string.

failure(failure_message: string)
Argument
Type
Description
failure_messagestring
a message explaining why failure occurred
command failed

Sent when the command could not be carried out. This could be due to sending a non-existent command, no command, not enough arguments, too many arguments, invalid arguments, etc.


Compositor Support

Cage
Cage
0.2.0
COSMIC
COSMIC
1.0.0~beta.8
GameScope
GameScope
3.15.14
Hyprland
Hyprland
0.52.1
Jay
1.11.0
KWin
KWin
6.4
Labwc
Labwc
0.9.2
Louvre
Louvre
2.14.1
Mir
Mir
2.19
Muffin
Muffin
6.4.1
Mutter
Mutter
49.2
niri
niri
25.11
river
river
0.3.13
Sway
Sway
1.11
Treeland
Treeland
0.8.0
Wayfire
Wayfire
0.9.0
Weston
Weston
14.0.2
zriver_control_v1
x
x
x
x
x
x
x
x
x
x
x
x
1
x
x
x
x

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.