Skip to content
MoreDisplays

Type to search.

Manual contents

mdctl help

Print the usage text.

mdctl help

What it prints

The usage text on stdout.

The usage text: every command, its arguments, the environment variable and the exit codes. It needs no running app, so it is also the quickest way to check the tool is on your PATH and can run.

mdctl help
MoreDisplays command line tool.

Usage: mdctl <command> [arguments]

Commands:
list print every group name, one per line
displays print the displays the machine is showing
edid <reference> print what one display says about itself
protect <reference> <state> defend one display's resolution in the active group, or stop
activate <name> switch the machine to a group
deactivate tear the active group down
capture [name] capture the live layout into a group
status print the app version, the engine state and the group list
docs print this description of the tool, as JSON
help print the usage text

Environment:
MDCTL_SOCKET path to the app's socket, for testing

Exit codes: 0 success, 1 command failed, 2 usage error, 3 app not running.

-h and --help print the same text and are accepted anywhere in the arguments, including before a command. A usage error prints it too, after the error itself.

mdctl --help > /dev/null && echo installed
installed

The command list is generated from the same table docs prints, so the help text cannot name a command the tool does not have, or miss one it does.

Exit codes

The same four across every command, so a script can branch on the number without knowing which command produced it.

Code Name When
0 ok The command succeeded.
1 commandFailed The app understood the command and refused or failed it. The reason is on stderr.
2 usage The arguments were wrong. Nothing was sent.
3 appNotRunning No app is listening on the socket.