aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Eklov <david.eklov@gmail.com>2016-07-11 00:50:23 -0500
committerDavid Eklov <david.eklov@gmail.com>2016-07-14 17:18:01 -0500
commit8a232c8cfd60c1469ceaaa911f31a6d75e8ad851 (patch)
treef7c64d6e9d082bd080960c42e21e54edf01839de
parenta0c8799c8008da4eccde3ae4bd5865b5c4422058 (diff)
Send command to sway to change workspace when workspace button is clicked
-rw-r--r--swaybar/ipc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/swaybar/ipc.c b/swaybar/ipc.c
index 6697742e..15f40508 100644
--- a/swaybar/ipc.c
+++ b/swaybar/ipc.c
@@ -8,7 +8,12 @@
#include "bar/ipc.h"
void ipc_send_workspace_command(const char *workspace_name) {
- sway_log(L_DEBUG, "Clicked on window %s", workspace_name);
+ uint32_t size = strlen("workspace ") + strlen(workspace_name) + 1;
+
+ char command[size];
+ sprintf(command, "workspace %s", workspace_name);
+
+ ipc_single_command(swaybar.ipc_socketfd, IPC_COMMAND, command, &size);
}
static void ipc_parse_config(struct config *config, const char *payload) {