aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2023-05-04 14:57:20 +0530
committerFurkan Sahin <furkan-dev@proton.me>2023-05-04 14:57:20 +0530
commitcc24063905db6716b663e07adf45374ee5579957 (patch)
tree771159ed3a014ed3ca49ae9587fcf3e7aa8d5446
parent846e1294b84c5b26ab0c9e543133130d9d81b7ee (diff)
swaybar: always subscribe to mode and workspace
always subscribe to mode and workspace events, since we might need them after bar config updates even if we don't need them initially.
-rw-r--r--swaybar/ipc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/swaybar/ipc.c b/swaybar/ipc.c
index 9d81a9fb..33ae6544 100644
--- a/swaybar/ipc.c
+++ b/swaybar/ipc.c
@@ -426,12 +426,9 @@ bool ipc_initialize(struct swaybar *bar) {
}
free(res);
- struct swaybar_config *config = bar->config;
- char subscribe[128]; // suitably large buffer
- len = snprintf(subscribe, 128,
- "[ \"barconfig_update\" , \"bar_state_update\" %s %s ]",
- config->binding_mode_indicator ? ", \"mode\"" : "",
- config->workspace_buttons ? ", \"workspace\"" : "");
+ char *subscribe =
+ "[ \"barconfig_update\", \"bar_state_update\", \"mode\", \"workspace\" ]";
+ len = strlen(subscribe);
free(ipc_single_command(bar->ipc_event_socketfd,
IPC_SUBSCRIBE, subscribe, &len));
return true;