diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-06-14 18:53:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-14 18:53:40 -0400 |
commit | 298f56353ef155f6a2ccc977c96b2ff5d971e65e (patch) | |
tree | dcb3b74f1dde93bce8657b7509662ffd7db667d0 /swaybar/ipc.c | |
parent | Implement KDE's server-side decoration protocol (diff) | |
parent | Merge pull request #1234 from 4e554c4c/tray (diff) | |
download | sway-298f56353ef155f6a2ccc977c96b2ff5d971e65e.tar.gz sway-298f56353ef155f6a2ccc977c96b2ff5d971e65e.tar.zst sway-298f56353ef155f6a2ccc977c96b2ff5d971e65e.zip |
Merge branch 'master' into server-decoration
Diffstat (limited to 'swaybar/ipc.c')
-rw-r--r-- | swaybar/ipc.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/swaybar/ipc.c b/swaybar/ipc.c index b08eeea8..93d1219c 100644 --- a/swaybar/ipc.c +++ b/swaybar/ipc.c | |||
@@ -19,11 +19,19 @@ void ipc_send_workspace_command(const char *workspace_name) { | |||
19 | 19 | ||
20 | static void ipc_parse_config(struct config *config, const char *payload) { | 20 | static void ipc_parse_config(struct config *config, const char *payload) { |
21 | json_object *bar_config = json_tokener_parse(payload); | 21 | json_object *bar_config = json_tokener_parse(payload); |
22 | json_object *tray_output, *mode, *hidden_bar, *position, *status_command; | 22 | json_object *markup, *mode, *hidden_bar, *position, *status_command; |
23 | json_object *font, *bar_height, *wrap_scroll, *workspace_buttons, *strip_workspace_numbers; | 23 | json_object *font, *bar_height, *wrap_scroll, *workspace_buttons, *strip_workspace_numbers; |
24 | json_object *binding_mode_indicator, *verbose, *colors, *sep_symbol, *outputs; | 24 | json_object *binding_mode_indicator, *verbose, *colors, *sep_symbol, *outputs; |
25 | json_object *markup; | 25 | #ifdef ENABLE_TRAY |
26 | json_object *tray_output, *icon_theme, *tray_padding, *activate_button, *context_button; | ||
27 | json_object *secondary_button; | ||
26 | json_object_object_get_ex(bar_config, "tray_output", &tray_output); | 28 | json_object_object_get_ex(bar_config, "tray_output", &tray_output); |
29 | json_object_object_get_ex(bar_config, "icon_theme", &icon_theme); | ||
30 | json_object_object_get_ex(bar_config, "tray_padding", &tray_padding); | ||
31 | json_object_object_get_ex(bar_config, "activate_button", &activate_button); | ||
32 | json_object_object_get_ex(bar_config, "context_button", &context_button); | ||
33 | json_object_object_get_ex(bar_config, "secondary_button", &secondary_button); | ||
34 | #endif | ||
27 | json_object_object_get_ex(bar_config, "mode", &mode); | 35 | json_object_object_get_ex(bar_config, "mode", &mode); |
28 | json_object_object_get_ex(bar_config, "hidden_bar", &hidden_bar); | 36 | json_object_object_get_ex(bar_config, "hidden_bar", &hidden_bar); |
29 | json_object_object_get_ex(bar_config, "position", &position); | 37 | json_object_object_get_ex(bar_config, "position", &position); |
@@ -83,6 +91,34 @@ static void ipc_parse_config(struct config *config, const char *payload) { | |||
83 | config->pango_markup = json_object_get_boolean(markup); | 91 | config->pango_markup = json_object_get_boolean(markup); |
84 | } | 92 | } |
85 | 93 | ||
94 | #ifdef ENABLE_TRAY | ||
95 | if (tray_output) { | ||
96 | free(config->tray_output); | ||
97 | config->tray_output = strdup(json_object_get_string(tray_output)); | ||
98 | } | ||
99 | |||
100 | if (icon_theme) { | ||
101 | free(config->icon_theme); | ||
102 | config->icon_theme = strdup(json_object_get_string(icon_theme)); | ||
103 | } | ||
104 | |||
105 | if (tray_padding) { | ||
106 | config->tray_padding = json_object_get_int(tray_padding); | ||
107 | } | ||
108 | |||
109 | if (activate_button) { | ||
110 | config->activate_button = json_object_get_int(activate_button); | ||
111 | } | ||
112 | |||
113 | if (context_button) { | ||
114 | config->context_button = json_object_get_int(context_button); | ||
115 | } | ||
116 | |||
117 | if (secondary_button) { | ||
118 | config->secondary_button = json_object_get_int(secondary_button); | ||
119 | } | ||
120 | #endif | ||
121 | |||
86 | // free previous outputs list | 122 | // free previous outputs list |
87 | int i; | 123 | int i; |
88 | for (i = 0; i < config->outputs->length; ++i) { | 124 | for (i = 0; i < config->outputs->length; ++i) { |