I3-MSG(1)

πŸ’Œ i3-msg β€” bestie edition πŸ’Œ

okay so real talk: this is the i3-msg page from the i3 Manual, and it's literally your group chat with the i3 window manager. You send messages, i3 replies. Iconic. Let's go 🫢


✨ NAME ✨

i3-msg β€” send messages to i3 window manager. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

i3-msg [-q] [-v] [-h] [-s socket] [-t type] [-r] [message]

πŸŽ€ OPTIONS πŸŽ€

  • -q, --quiet β€” only sends the ipc message and suppresses the output of the response. no receipts, no drama, just send it πŸ™ˆ
  • -v, --version β€” shows the version number and dips. bye! πŸ‘‹
  • -h, --help β€” shows a short help-message and exits. your little cheat sheet fr fr
  • -s, --socket sock_path β€” i3-msg will use the environment variable I3SOCK, or the socket path you hand it right here. If both of those fail? she tries to get the socket info from the root window, and then tries /tmp/i3-ipc.sock, and only after all of that does she exit with an error. she's persistent, she's thorough, she's not giving up on you πŸ’ͺ
  • -t type β€” send an ipc message, see below. this option defaults to "command". so if you don't say anything, she assumes you mean command, lowkey a mind reader
  • -m, --monitor β€” instead of exiting right after receiving the first subscribed event, she waits indefinitely for all of them. can only be used with -t subscribe. see the "subscribe" IPC message type below for the details πŸ‘€
  • -r, --raw β€” displays the raw JSON reply instead of pretty-printing errors (for commands) or displaying the top-level config file contents (for GET_CONFIG). raw as in no filter, no glow-up, just the JSON as it is πŸ’€
  • message β€” send ipc message, see below. yeah that's the whole description, she's mysterious like that

πŸ”₯ IPC MESSAGE TYPES πŸ”₯

  • command β€” the payload of the message is a command for i3 (like the commands you can bind to keys in the configuration file), and it gets executed directly after receiving it. so like, immediate. no waiting around ✨
  • get_workspaces β€” gets the current workspaces. the reply will be a JSON-encoded list of workspaces. all your lil spaces, listed out πŸ¦‹
  • get_outputs β€” gets the current outputs. the reply will be a JSON-encoded list of outputs (see the reply section of docs/ipc, e.g. at https://i3wm.org/docs/ipc.html#_receiving_replies_from_i3).
  • get_tree β€” gets the layout tree. i3 uses a tree as data structure which includes every container. the reply will be the JSON-encoded tree. yes bestie, a whole tree, every container, the entire family tree 🌳
  • get_marks β€” 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. bookmarking but make it i3 πŸŽ€
  • get_bar_config β€” 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. give her an ID or she gives you everything πŸ™ˆ
  • get_binding_modes β€” gets a list of configured binding modes. all the modes you set up, right there πŸ’…
  • get_version β€” gets the version of i3. the reply will be a JSON-encoded dictionary with the major, minor, patch and human-readable version. numbers AND vibes ✨
  • get_config β€” gets the currently loaded i3 configuration. your config, as it currently stands, served fresh πŸ“
  • send_tick β€” sends a tick to all IPC connections which subscribe to tick events. tick tock, everybody listening gets the memo ⏰
  • subscribe β€” 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. set it and forget it, she'll keep you posted πŸ””

πŸ’– DESCRIPTION πŸ’–

i3-msg is a sample implementation for a client using the unix socket IPC interface to i3. she's the reference bestie, the demo girl, the one showing you how it's done 🫢

🌈 Exit status:

  • 0: if OK
  • 1: if invalid syntax or unable to connect to ipc-socket
  • 2: if i3 returned an error processing your command(s)
okay so those numbers? memorize them, they're your vibe check on whether things actually worked πŸ’€

⭐ EXAMPLES ⭐

# 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" ]'

see how the quotes are optional? she's flexible like that, she gets you πŸ’…


🧚 ENVIRONMENT 🧚

🌸 I3SOCK

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. so like, if you didn't say anything, she checks here first, iykyk πŸ¦‹


πŸ‘‘ SEE ALSO πŸ‘‘

i3(1)


πŸ’œ AUTHOR πŸ’œ

Michael Stapelberg and contributors β€” kings, legends, the whole squad 🫢


and that's the whole page bestie, no notes, she ate πŸ’…βœ¨

this was i3-msg from i3 4.25.1, dated 01/01/1980 β€” mwah, go send some messages πŸŽ€

πŸ“¦ where this page comes from