diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2016-07-11 00:50:23 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2016-07-11 00:50:23 -0500 |
| commit | 16159878520b0fa295be9e0cc5fae0f343513a9c (patch) | |
| tree | f7c64d6e9d082bd080960c42e21e54edf01839de /swaybar/ipc.c | |
| parent | 7f04d090e3bc30048acfc280b255b225a1eb3359 (diff) | |
Send command to sway to change workspace when workspace button is clicked
Diffstat (limited to 'swaybar/ipc.c')
| -rw-r--r-- | swaybar/ipc.c | 7 |
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) { |
