commit a79994e11961ae24d7a418a18d43bfdd48d1f44b
parent 3cd7c7178079bf61bb7967690e7767442b369782
Author: Mukundan314 <30190448+Mukundan314@users.noreply.github.com>
Date: Thu, 4 May 2023 14:57:20 +0530
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.
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git 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;