aboutsummaryrefslogtreecommitdiff
path: root/swaymsg/main.c
diff options
context:
space:
mode:
authorIan Fan <ianfan0@gmail.com>2018-07-18 12:30:39 +0100
committerIan Fan <ianfan0@gmail.com>2018-08-01 16:57:15 +0100
commit3edaf2ce2a8a4753c162491329a7dfa492ff7e77 (patch)
tree28ae55150ef695a569aecaf114250a87a73d0d5a /swaymsg/main.c
parent33433c64347eb0bfd7c1465a3b60579fa88ef724 (diff)
ipc: add tick event
Diffstat (limited to 'swaymsg/main.c')
-rw-r--r--swaymsg/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c
index c4141ca5..3767daf3 100644
--- a/swaymsg/main.c
+++ b/swaymsg/main.c
@@ -250,12 +250,16 @@ static void pretty_print(int type, json_object *resp) {
if (type != IPC_COMMAND && type != IPC_GET_WORKSPACES &&
type != IPC_GET_INPUTS && type != IPC_GET_OUTPUTS &&
type != IPC_GET_VERSION && type != IPC_GET_SEATS &&
- type != IPC_GET_CONFIG) {
+ type != IPC_GET_CONFIG && type != IPC_SEND_TICK) {
printf("%s\n", json_object_to_json_string_ext(resp,
JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_SPACED));
return;
}
+ if (type == IPC_SEND_TICK) {
+ return;
+ }
+
if (type == IPC_GET_VERSION) {
pretty_print_version(resp);
return;
@@ -384,6 +388,8 @@ int main(int argc, char **argv) {
type = IPC_GET_BINDING_MODES;
} else if (strcasecmp(cmdtype, "get_config") == 0) {
type = IPC_GET_CONFIG;
+ } else if (strcasecmp(cmdtype, "send_tick") == 0) {
+ type = IPC_SEND_TICK;
} else {
sway_abort("Unknown message type %s", cmdtype);
}