mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-26 21:58:08 +01:00
swaybar: only subscribe to required events
This adds barconfig_update to the list of subscribed events, as well as checking when the other events need to be subscribed to.
This commit is contained in:
parent
18eaf45224
commit
a67fa8a05d
1 changed files with 6 additions and 2 deletions
|
@ -356,8 +356,12 @@ bool ipc_initialize(struct swaybar *bar) {
|
|||
free(res);
|
||||
ipc_get_outputs(bar);
|
||||
|
||||
const char *subscribe = "[ \"workspace\", \"mode\" ]";
|
||||
len = strlen(subscribe);
|
||||
struct swaybar_config *config = bar->config;
|
||||
char subscribe[128]; // suitably large buffer
|
||||
len = snprintf(subscribe, 128,
|
||||
"[ \"barconfig_update\" %s %s ]",
|
||||
config->binding_mode_indicator ? ", \"mode\"" : "",
|
||||
config->workspace_buttons ? ", \"workspace\"" : "");
|
||||
free(ipc_single_command(bar->ipc_event_socketfd,
|
||||
IPC_SUBSCRIBE, subscribe, &len));
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue