aboutsummaryrefslogtreecommitdiffstats
path: root/swaymsg/swaymsg.1.scd
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-11-28 11:19:18 -0500
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-11-28 11:19:18 -0500
commitbf9a52bab0f8ae9b4ace43c7d9c75ece0c76b562 (patch)
tree812af4f8fee1f289bc244136ac21acca44de15b0 /swaymsg/swaymsg.1.scd
parentMerge pull request #3211 from emersion/child-view-unmapped-segfault (diff)
downloadsway-bf9a52bab0f8ae9b4ace43c7d9c75ece0c76b562.tar.gz
sway-bf9a52bab0f8ae9b4ace43c7d9c75ece0c76b562.tar.zst
sway-bf9a52bab0f8ae9b4ace43c7d9c75ece0c76b562.zip
Implement support for swaymsg -t SUBSCRIBE [-m]
In `i3 4.16`, `i3-msg` can be used with the message type `subscribe` and has the ability to monitor for responses until killed. This adds support for both to swaymsg. If the JSON array of event types is malformed or contains an invalid event, sway will send a response with `success` set to `false`. If swaymsg sees this, it will not display the failure and exit. If the `subscribe` event is successful, swaymsg will wait for the first response and display that instead of the success message. If `-m/--monitor` is given, swaymsg will continue monitor for responses until killed or a malformed response is received. For the `subscribe` event, the responses will always be printed as JSON. If `-r/--raw` is given, the JSON will not be pretty printed, which may be preferred when monitoring due to there being multiple responses. Example: `swaymsg -t SUBSCRIBE -m "['window']"`
Diffstat (limited to 'swaymsg/swaymsg.1.scd')
-rw-r--r--swaymsg/swaymsg.1.scd11
1 files changed, 11 insertions, 0 deletions
diff --git a/swaymsg/swaymsg.1.scd b/swaymsg/swaymsg.1.scd
index eaac8105..f55f86a9 100644
--- a/swaymsg/swaymsg.1.scd
+++ b/swaymsg/swaymsg.1.scd
@@ -13,6 +13,12 @@ _swaymsg_ [options...] [message]
13*-h, --help* 13*-h, --help*
14 Show help message and quit. 14 Show help message and quit.
15 15
16*-m, --monitor*
17 Monitor for responses until killed instead of exiting after the first
18 response. This can only be used with the IPC message type _subscribe_. If
19 there is a malformed response or an invalid event type was requested,
20 swaymsg will stop monitoring and exit.
21
16*-q, --quiet* 22*-q, --quiet*
17 Sends the IPC message but does not print the response from sway. 23 Sends the IPC message but does not print the response from sway.
18 24
@@ -71,3 +77,8 @@ _swaymsg_ [options...] [message]
71 77
72*send\_tick* 78*send\_tick*
73 Sends a tick event to all subscribed clients. 79 Sends a tick event to all subscribed clients.
80
81*subscribe*
82 Subscribe to a list of event types. The argument for this type should be
83 provided in the form of a valid JSON array. If any of the types are invalid
84 or if an valid JSON array is not provided, this will result in an failure.