1swaymsg(1)                  General Commands Manual                 swaymsg(1)
2
3
4

NAME

6       swaymsg - Send messages to a running instance of sway over the IPC
7       socket.
8

SYNOPSIS

10       swaymsg [options...] [message]
11

OPTIONS

13       -h, --help
14           Show help message and quit.
15
16       -m, --monitor
17           Monitor for responses until killed instead of exiting after the
18           first response. This can only be used with the IPC message type
19           subscribe. If there is a malformed response or an invalid event
20           type was requested, swaymsg will stop monitoring and exit.
21
22       -p, --pretty
23           Use pretty output even when not using a tty.
24
25       -q, --quiet
26           Sends the IPC message but does not print the response from sway.
27
28       -r, --raw
29           Use raw output even if using a tty.
30
31       -s, --socket <path>
32           Use the specified socket path. Otherwise, swaymsg will ask sway
33           where the socket is (which is the value of $SWAYSOCK, then of
34           $I3SOCK).
35
36       -t, --type <type>
37           Specify the type of IPC message. See below.
38
39       -v, --version
40           Print the version (of swaymsg) and quit.
41

IPC MESSAGE TYPES

43       <command>
44           The message is a sway command (the same commands you can bind to
45           keybindings in your sway config file). It will be executed immedi‐
46           ately.
47
48           See sway(5) for a list of commands.
49
50           Tip: If you are proving a command that contains a leading hyphen
51           (-), insert two hyphens (--) before the command to signal to
52           swaymsg not to parse anything beyond that point as an option. For
53           example, use swaymsg -- mark --add test instead of swaymsg mark
54           --add test
55
56       get_workspaces
57           Gets a JSON-encoded list of workspaces and their status.
58
59       get_inputs
60           Gets a JSON-encoded list of current inputs.
61
62       get_outputs
63           Gets a JSON-encoded list of current outputs.
64
65       get_tree
66           Gets a JSON-encoded layout tree of all open windows, containers,
67           outputs, workspaces, and so on.
68
69       get_seats
70           Gets a JSON-encoded list of all seats, its properties and all
71           assigned devices.
72
73       get_marks
74           Get a JSON-encoded list of marks.
75
76       get_bar_config
77           Get a JSON-encoded configuration for swaybar.
78
79       get_version
80           Get JSON-encoded version information for the running instance of
81           sway.
82
83       get_binding_modes
84           Gets a JSON-encoded list of currently configured binding modes.
85
86       get_config
87           Gets a JSON-encoded copy of the current configuration.
88
89       send_tick
90           Sends a tick event to all subscribed clients.
91
92       subscribe
93           Subscribe to a list of event types. The argument for this type
94           should be provided in the form of a valid JSON array. If any of the
95           types are invalid or if a valid JSON array is not provided, this
96           will result in a failure.
97

RETURN CODES

99       0
100           Success
101
102       1
103           swaymsg errors such as invalid syntax, unable to connect to the ipc
104           socket or unable to parse sway's reply
105
106       2
107           Sway returned an error when processing the command (ex. invalid
108           command, command failed, and invalid subscription request)
109

SEE ALSO

111       sway(5) sway-bar(5) sway-input(5) sway-output(5) sway-ipc(7)
112
113
114
115                                  2020-02-26                        swaymsg(1)
Impressum