Section: i3 Manual (1)
i3-msg - send messages to i3 window manager
i3-msg [-q] [-v] [-h] [-s socket] [-t type] [message]
Only send ipc message and suppress the output of the response.
Display version number and exit.
Display a short help-message and exit.
-s, --socket sock_path
i3-msg will use the environment variable I3SOCK or the socket path given here. If both fail, it will try to get the socket information from the root window and then try /tmp/i3-ipc.sock before exiting with an error.
Send ipc message, see below. This option defaults to "command".
Instead of exiting right after receiving the first subscribed event, wait indefinitely for all of them. Can only be used with "-t subscribe". See the "subscribe" IPC message type below for details.
Send ipc message, see below.
IPC MESSAGE TYPES
The payload of the message is a command for i3 (like the commands you can bind to keys in the configuration file) and will be executed directly after receiving it.
Gets the current workspaces. The reply will be a JSON-encoded list of workspaces.
Gets the current outputs. The reply will be a JSON-encoded list of outputs (see the reply section of docs/ipc, e.g. at
Gets the layout tree. i3 uses a tree as data structure which includes every container. The reply will be the JSON-encoded tree.
Gets a list of marks (identifiers for containers to easily jump to them later). The reply will be a JSON-encoded list of window marks.
Gets the configuration (as JSON map) of the workspace bar with the given ID. If no ID is provided, an array with all configured bar IDs is returned instead.
Gets a list of configured binding modes.
Gets the version of i3. The reply will be a JSON-encoded dictionary with the major, minor, patch and human-readable version.
Gets the currently loaded i3 configuration.
Sends a tick to all IPC connections which subscribe to tick events.
The payload of the message describes the events to subscribe to. Upon reception, each event will be dumped as a JSON-encoded object. See the -m option for continuous monitoring.
i3-msg is a sample implementation for a client using the unix socket IPC interface to i3.
0: if OK, 1: if invalid syntax or unable to connect to ipc-socket 2: if i3 returned an error processing your command(s)
# Use 1-px border for current client
i3-msg "border 1pixel"
# You can leave out the quotes
i3-msg border normal
# Dump the layout tree
i3-msg -t get_tree
# Monitor window changes
i3-msg -t subscribe -m '[ "window" ]'
If no ipc-socket is specified on the commandline, this variable is used to determine the path, at which the unix domain socket is expected, on which to connect to i3.
Michael Stapelberg and contributors