1I3-IPC(1) i3-ipc Manual I3-IPC(1)
2
3
4
6 i3-ipc -- inter-process communication with i3
7
9 i3-ipc [-s] [-t type] [-p] [-j] [-q] [message]
10
12 i3-ipc can be used to communicate with i3, the improved tiling window
13 manager, through the provided ipc socket. Useful for scripting the win‐
14 dow manager.
15
16 Currently implemented message types of i3 are the following:
17
18 0 (COMMAND)
19 The payload of the message is a command for i3
20 (like the commands you can bind to keys in the configuration
21 file)
22 The command will be executed directly after receiving it.
23 The reply will be always {"succes":true} for now.
24
25 1 (GET_WORKSPACES)
26 Gets the current workspaces.
27 The reply will be a JSON-encoded list of workspaces.
28
29 2 (SUBSCRIBE)
30 Subscribes your connection to the workspace event.
31
32 3 (GET_OUTPUTS)
33 Gets the current outputs.
34 The reply will be a JSON-encoded list of outputs.
35
37 i3-ipc's default mode of operation is to send the command (type 0)
38 specified on the command line.
39
40 These options can be used to change this behavior:
41
42 -s, --socket
43 Set the socket file, defaults to ~/.i3/ipc.sock
44
45 -t, --type
46 Set the type. Passing a type of 0 is the default and will send
47 the specified command, type 1 gets the current workspace list,
48 type 2 subscribes to the workspace stream, type 3 gets the cur‐
49 rent output list.
50
51 -p, --pretty-print
52 This will pretty print the received reply. Useful for the
53 workspace list.
54
55 -j, --json
56 This will print the received reply as raw json-encoded data.
57 Useful to pass to another script.
58
59 -q, --quiet
60 Turn off the output. Useful for command mode.
61
62 message
63 This is the actual command to send as defined by i3
64
65 You may additionally ask for help:
66
67 -h, --help
68 Print help.
69
70 -m, --man
71 Display this man page.
72
74 $ i3-ipc -t 1
75 $ i3-ipc -t 2 -p
76 $ i3-ipc -t 3 -j
77 $ i3-ipc "exec xterm"
78
80 http://github.com/badboy/i3-ipc/issues
81
83 Jan-Erik Rediger:: badboy@archlinux.us
84
86 i3(1), i3-msg(1), http://i3.zekjur.net/, http://github.com/bad‐
87 boy/i3-ipc
88
89
90
91badboy April 2010 I3-IPC(1)