diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-30 22:02:55 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-03-30 22:44:08 -0400 |
commit | ae14dfc7ae70f16a31a10f4ff2395d4ac432308d (patch) | |
tree | 024e8fc68d3356712cb9c114d09fe2cc56cc0483 /swaybar/ipc.c | |
parent | 8d1425bde9e7f17a5a9e6bce73dffcf296dad6a1 (diff) |
Implement scroll wheel workspace switching
Diffstat (limited to 'swaybar/ipc.c')
-rw-r--r-- | swaybar/ipc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/swaybar/ipc.c b/swaybar/ipc.c index 326f25cc..64583df0 100644 --- a/swaybar/ipc.c +++ b/swaybar/ipc.c @@ -8,6 +8,14 @@ #include "swaybar/ipc.h" #include "ipc-client.h" +void ipc_send_workspace_command(struct swaybar *bar, const char *ws) { + const char *fmt = "workspace \"%s\""; + uint32_t size = snprintf(NULL, 0, fmt, ws); + char command[size]; + snprintf(command, size, fmt, ws); + ipc_single_command(bar->ipc_socketfd, IPC_COMMAND, command, &size); +} + char *parse_font(const char *font) { char *new_font = NULL; if (strncmp("pango:", font, 6) == 0) { |