aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar
diff options
context:
space:
mode:
authorLibravatar M Stoeckl <code@mstoeckl.com>2019-01-20 13:51:12 -0500
committerLibravatar emersion <contact@emersion.fr>2019-01-21 12:59:42 +0100
commit1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 (patch)
tree5c3f60e0219cb8b4a1b7cafb760a871661866e32 /swaybar
parentLog libinput_config_status errors (diff)
downloadsway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.gz
sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.zst
sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.zip
Replace wlr_log with sway_log
This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
Diffstat (limited to 'swaybar')
-rw-r--r--swaybar/bar.c7
-rw-r--r--swaybar/config.c4
-rw-r--r--swaybar/i3bar.c14
-rw-r--r--swaybar/input.c3
-rw-r--r--swaybar/ipc.c14
-rw-r--r--swaybar/main.c10
-rw-r--r--swaybar/render.c1
-rw-r--r--swaybar/status_line.c18
-rw-r--r--swaybar/tray/host.c30
-rw-r--r--swaybar/tray/icon.c2
-rw-r--r--swaybar/tray/item.c40
-rw-r--r--swaybar/tray/tray.c10
-rw-r--r--swaybar/tray/watcher.c26
13 files changed, 88 insertions, 91 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c
index d36367fc..a1f7bfdb 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -10,7 +10,6 @@
10#include <unistd.h> 10#include <unistd.h>
11#include <wayland-client.h> 11#include <wayland-client.h>
12#include <wayland-cursor.h> 12#include <wayland-cursor.h>
13#include <wlr/util/log.h>
14#include "config.h" 13#include "config.h"
15#include "swaybar/bar.h" 14#include "swaybar/bar.h"
16#include "swaybar/config.h" 15#include "swaybar/config.h"
@@ -44,7 +43,7 @@ static void swaybar_output_free(struct swaybar_output *output) {
44 if (!output) { 43 if (!output) {
45 return; 44 return;
46 } 45 }
47 wlr_log(WLR_DEBUG, "Removing output %s", output->name); 46 sway_log(SWAY_DEBUG, "Removing output %s", output->name);
48 if (output->layer_surface != NULL) { 47 if (output->layer_surface != NULL) {
49 zwlr_layer_surface_v1_destroy(output->layer_surface); 48 zwlr_layer_surface_v1_destroy(output->layer_surface);
50 } 49 }
@@ -157,7 +156,7 @@ bool determine_bar_visibility(struct swaybar *bar, bool moving_layer) {
157 bar->visible = visible; 156 bar->visible = visible;
158 157
159 if (bar->status) { 158 if (bar->status) {
160 wlr_log(WLR_DEBUG, "Sending %s signal to status command", 159 sway_log(SWAY_DEBUG, "Sending %s signal to status command",
161 visible ? "cont" : "stop"); 160 visible ? "cont" : "stop");
162 kill(bar->status->pid, visible ? 161 kill(bar->status->pid, visible ?
163 bar->status->cont_signal : bar->status->stop_signal); 162 bar->status->cont_signal : bar->status->stop_signal);
@@ -271,7 +270,7 @@ static void xdg_output_handle_description(void *data,
271 size_t length = paren - description; 270 size_t length = paren - description;
272 output->identifier = malloc(length); 271 output->identifier = malloc(length);
273 if (!output->identifier) { 272 if (!output->identifier) {
274 wlr_log(WLR_ERROR, "Failed to allocate output identifier"); 273 sway_log(SWAY_ERROR, "Failed to allocate output identifier");
275 return; 274 return;
276 } 275 }
277 strncpy(output->identifier, description, length); 276 strncpy(output->identifier, description, length);
diff --git a/swaybar/config.c b/swaybar/config.c
index 0071c7f9..b94fcfee 100644
--- a/swaybar/config.c
+++ b/swaybar/config.c
@@ -1,12 +1,12 @@
1#define _POSIX_C_SOURCE 200809L 1#define _POSIX_C_SOURCE 200809L
2#include <stdlib.h> 2#include <stdlib.h>
3#include <string.h> 3#include <string.h>
4#include <wlr/util/log.h>
5#include "swaybar/config.h" 4#include "swaybar/config.h"
6#include "wlr-layer-shell-unstable-v1-client-protocol.h" 5#include "wlr-layer-shell-unstable-v1-client-protocol.h"
7#include "config.h" 6#include "config.h"
8#include "stringop.h" 7#include "stringop.h"
9#include "list.h" 8#include "list.h"
9#include "log.h"
10 10
11uint32_t parse_position(const char *position) { 11uint32_t parse_position(const char *position) {
12 uint32_t horiz = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | 12 uint32_t horiz = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
@@ -16,7 +16,7 @@ uint32_t parse_position(const char *position) {
16 } else if (strcmp("bottom", position) == 0) { 16 } else if (strcmp("bottom", position) == 0) {
17 return ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM | horiz; 17 return ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM | horiz;
18 } else { 18 } else {
19 wlr_log(WLR_ERROR, "Invalid position: %s, defaulting to bottom", position); 19 sway_log(SWAY_ERROR, "Invalid position: %s, defaulting to bottom", position);
20 return ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM | horiz; 20 return ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM | horiz;
21 } 21 }
22} 22}
diff --git a/swaybar/i3bar.c b/swaybar/i3bar.c
index 8bca1bf9..e938694c 100644
--- a/swaybar/i3bar.c
+++ b/swaybar/i3bar.c
@@ -5,7 +5,7 @@
5#include <stdlib.h> 5#include <stdlib.h>
6#include <string.h> 6#include <string.h>
7#include <unistd.h> 7#include <unistd.h>
8#include <wlr/util/log.h> 8#include "log.h"
9#include "swaybar/bar.h" 9#include "swaybar/bar.h"
10#include "swaybar/config.h" 10#include "swaybar/config.h"
11#include "swaybar/i3bar.h" 11#include "swaybar/i3bar.h"
@@ -120,7 +120,7 @@ bool i3bar_handle_readable(struct status_line *status) {
120 memmove(status->buffer, &status->buffer[c], status->buffer_index); 120 memmove(status->buffer, &status->buffer[c], status->buffer_index);
121 break; 121 break;
122 } else if (!isspace(status->buffer[c])) { 122 } else if (!isspace(status->buffer[c])) {
123 wlr_log(WLR_DEBUG, "Invalid i3bar json: expected '[' but encountered '%c'", 123 sway_log(SWAY_DEBUG, "Invalid i3bar json: expected '[' but encountered '%c'",
124 status->buffer[c]); 124 status->buffer[c]);
125 status_error(status, "[invalid i3bar json]"); 125 status_error(status, "[invalid i3bar json]");
126 return true; 126 return true;
@@ -160,7 +160,7 @@ bool i3bar_handle_readable(struct status_line *status) {
160 ++buffer_pos; 160 ++buffer_pos;
161 break; 161 break;
162 } else if (!isspace(status->buffer[buffer_pos])) { 162 } else if (!isspace(status->buffer[buffer_pos])) {
163 wlr_log(WLR_DEBUG, "Invalid i3bar json: expected ',' but encountered '%c'", 163 sway_log(SWAY_DEBUG, "Invalid i3bar json: expected ',' but encountered '%c'",
164 status->buffer[buffer_pos]); 164 status->buffer[buffer_pos]);
165 status_error(status, "[invalid i3bar json]"); 165 status_error(status, "[invalid i3bar json]");
166 return true; 166 return true;
@@ -195,7 +195,7 @@ bool i3bar_handle_readable(struct status_line *status) {
195 } 195 }
196 *last_char_pos = '\0'; 196 *last_char_pos = '\0';
197 size_t offset = strspn(&status->buffer[buffer_pos], " \f\n\r\t\v"); 197 size_t offset = strspn(&status->buffer[buffer_pos], " \f\n\r\t\v");
198 wlr_log(WLR_DEBUG, "Received i3bar json: '%s%c'", 198 sway_log(SWAY_DEBUG, "Received i3bar json: '%s%c'",
199 &status->buffer[buffer_pos + offset], last_char); 199 &status->buffer[buffer_pos + offset], last_char);
200 *last_char_pos = last_char; 200 *last_char_pos = last_char;
201 201
@@ -229,7 +229,7 @@ bool i3bar_handle_readable(struct status_line *status) {
229 } else { 229 } else {
230 char last_char = status->buffer[status->buffer_index - 1]; 230 char last_char = status->buffer[status->buffer_index - 1];
231 status->buffer[status->buffer_index - 1] = '\0'; 231 status->buffer[status->buffer_index - 1] = '\0';
232 wlr_log(WLR_DEBUG, "Failed to parse i3bar json - %s: '%s%c'", 232 sway_log(SWAY_DEBUG, "Failed to parse i3bar json - %s: '%s%c'",
233 json_tokener_error_desc(err), &status->buffer[buffer_pos], last_char); 233 json_tokener_error_desc(err), &status->buffer[buffer_pos], last_char);
234 status_error(status, "[failed to parse i3bar json]"); 234 status_error(status, "[failed to parse i3bar json]");
235 return true; 235 return true;
@@ -250,7 +250,7 @@ bool i3bar_handle_readable(struct status_line *status) {
250 } 250 }
251 251
252 if (last_object) { 252 if (last_object) {
253 wlr_log(WLR_DEBUG, "Rendering last received json"); 253 sway_log(SWAY_DEBUG, "Rendering last received json");
254 i3bar_parse_json(status, last_object); 254 i3bar_parse_json(status, last_object);
255 json_object_put(last_object); 255 json_object_put(last_object);
256 return true; 256 return true;
@@ -262,7 +262,7 @@ bool i3bar_handle_readable(struct status_line *status) {
262enum hotspot_event_handling i3bar_block_send_click(struct status_line *status, 262enum hotspot_event_handling i3bar_block_send_click(struct status_line *status,
263 struct i3bar_block *block, int x, int y, int rx, int ry, int w, int h, 263 struct i3bar_block *block, int x, int y, int rx, int ry, int w, int h,
264 uint32_t button) { 264 uint32_t button) {
265 wlr_log(WLR_DEBUG, "block %s clicked", block->name); 265 sway_log(SWAY_DEBUG, "block %s clicked", block->name);
266 if (!block->name || !status->click_events) { 266 if (!block->name || !status->click_events) {
267 return HOTSPOT_PROCESS; 267 return HOTSPOT_PROCESS;
268 } 268 }
diff --git a/swaybar/input.c b/swaybar/input.c
index 998b186f..e416f6e7 100644
--- a/swaybar/input.c
+++ b/swaybar/input.c
@@ -3,7 +3,6 @@
3#include <stdlib.h> 3#include <stdlib.h>
4#include <wayland-client.h> 4#include <wayland-client.h>
5#include <wayland-cursor.h> 5#include <wayland-cursor.h>
6#include <wlr/util/log.h>
7#include "list.h" 6#include "list.h"
8#include "log.h" 7#include "log.h"
9#include "swaybar/bar.h" 8#include "swaybar/bar.h"
@@ -55,7 +54,7 @@ static uint32_t wl_axis_to_button(uint32_t axis, wl_fixed_t value) {
55 case WL_POINTER_AXIS_HORIZONTAL_SCROLL: 54 case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
56 return negative ? SWAY_SCROLL_LEFT : SWAY_SCROLL_RIGHT; 55 return negative ? SWAY_SCROLL_LEFT : SWAY_SCROLL_RIGHT;
57 default: 56 default:
58 wlr_log(WLR_DEBUG, "Unexpected axis value on mouse scroll"); 57 sway_log(SWAY_DEBUG, "Unexpected axis value on mouse scroll");
59 return 0; 58 return 0;
60 } 59 }
61} 60}
diff --git a/swaybar/ipc.c b/swaybar/ipc.c
index 5565dc76..29b782bb 100644
--- a/swaybar/ipc.c
+++ b/swaybar/ipc.c
@@ -3,12 +3,12 @@
3#include <string.h> 3#include <string.h>
4#include <strings.h> 4#include <strings.h>
5#include <json-c/json.h> 5#include <json-c/json.h>
6#include <wlr/util/log.h>
7#include "swaybar/config.h" 6#include "swaybar/config.h"
8#include "swaybar/ipc.h" 7#include "swaybar/ipc.h"
9#include "config.h" 8#include "config.h"
10#include "ipc-client.h" 9#include "ipc-client.h"
11#include "list.h" 10#include "list.h"
11#include "log.h"
12 12
13void ipc_send_workspace_command(struct swaybar *bar, const char *ws) { 13void ipc_send_workspace_command(struct swaybar *bar, const char *ws) {
14 const char *fmt = "workspace \"%s\""; 14 const char *fmt = "workspace \"%s\"";
@@ -150,7 +150,7 @@ static bool ipc_parse_config(
150 json_object *success; 150 json_object *success;
151 if (json_object_object_get_ex(bar_config, "success", &success) 151 if (json_object_object_get_ex(bar_config, "success", &success)
152 && !json_object_get_boolean(success)) { 152 && !json_object_get_boolean(success)) {
153 wlr_log(WLR_ERROR, "No bar with that ID. Use 'swaymsg -t get_bar_config to get the available bar configs."); 153 sway_log(SWAY_ERROR, "No bar with that ID. Use 'swaymsg -t get_bar_config to get the available bar configs.");
154 json_object_put(bar_config); 154 json_object_put(bar_config);
155 return false; 155 return false;
156 } 156 }
@@ -441,7 +441,7 @@ static void ipc_get_outputs(struct swaybar *bar) {
441} 441}
442 442
443void ipc_execute_binding(struct swaybar *bar, struct swaybar_binding *bind) { 443void ipc_execute_binding(struct swaybar *bar, struct swaybar_binding *bind) {
444 wlr_log(WLR_DEBUG, "Executing binding for button %u (release=%d): `%s`", 444 sway_log(SWAY_DEBUG, "Executing binding for button %u (release=%d): `%s`",
445 bind->button, bind->release, bind->command); 445 bind->button, bind->release, bind->command);
446 uint32_t len = strlen(bind->command); 446 uint32_t len = strlen(bind->command);
447 free(ipc_single_command(bar->ipc_socketfd, 447 free(ipc_single_command(bar->ipc_socketfd,
@@ -500,7 +500,7 @@ static bool handle_barconfig_update(struct swaybar *bar,
500 const char *new_state = json_object_get_string(json_state); 500 const char *new_state = json_object_get_string(json_state);
501 char *old_state = config->hidden_state; 501 char *old_state = config->hidden_state;
502 if (strcmp(new_state, old_state) != 0) { 502 if (strcmp(new_state, old_state) != 0) {
503 wlr_log(WLR_DEBUG, "Changing bar hidden state to %s", new_state); 503 sway_log(SWAY_DEBUG, "Changing bar hidden state to %s", new_state);
504 free(old_state); 504 free(old_state);
505 config->hidden_state = strdup(new_state); 505 config->hidden_state = strdup(new_state);
506 return determine_bar_visibility(bar, false); 506 return determine_bar_visibility(bar, false);
@@ -510,7 +510,7 @@ static bool handle_barconfig_update(struct swaybar *bar,
510 json_object *json_mode; 510 json_object *json_mode;
511 json_object_object_get_ex(json_config, "mode", &json_mode); 511 json_object_object_get_ex(json_config, "mode", &json_mode);
512 config->mode = strdup(json_object_get_string(json_mode)); 512 config->mode = strdup(json_object_get_string(json_mode));
513 wlr_log(WLR_DEBUG, "Changing bar mode to %s", config->mode); 513 sway_log(SWAY_DEBUG, "Changing bar mode to %s", config->mode);
514 514
515 json_object *gaps; 515 json_object *gaps;
516 json_object_object_get_ex(json_config, "gaps", &gaps); 516 json_object_object_get_ex(json_config, "gaps", &gaps);
@@ -544,7 +544,7 @@ bool handle_ipc_readable(struct swaybar *bar) {
544 544
545 json_object *result = json_tokener_parse(resp->payload); 545 json_object *result = json_tokener_parse(resp->payload);
546 if (!result) { 546 if (!result) {
547 wlr_log(WLR_ERROR, "failed to parse payload as json"); 547 sway_log(SWAY_ERROR, "failed to parse payload as json");
548 free_ipc_response(resp); 548 free_ipc_response(resp);
549 return false; 549 return false;
550 } 550 }
@@ -561,7 +561,7 @@ bool handle_ipc_readable(struct swaybar *bar) {
561 free(bar->mode); 561 free(bar->mode);
562 bar->mode = strcmp(change, "default") != 0 ? strdup(change) : NULL; 562 bar->mode = strcmp(change, "default") != 0 ? strdup(change) : NULL;
563 } else { 563 } else {
564 wlr_log(WLR_ERROR, "failed to parse response"); 564 sway_log(SWAY_ERROR, "failed to parse response");
565 bar_is_dirty = false; 565 bar_is_dirty = false;
566 break; 566 break;
567 } 567 }
diff --git a/swaybar/main.c b/swaybar/main.c
index fa99b1ba..4ef74629 100644
--- a/swaybar/main.c
+++ b/swaybar/main.c
@@ -4,9 +4,9 @@
4#include <string.h> 4#include <string.h>
5#include <stdbool.h> 5#include <stdbool.h>
6#include <getopt.h> 6#include <getopt.h>
7#include <wlr/util/log.h>
8#include "swaybar/bar.h" 7#include "swaybar/bar.h"
9#include "ipc-client.h" 8#include "ipc-client.h"
9#include "log.h"
10 10
11static struct swaybar swaybar; 11static struct swaybar swaybar;
12 12
@@ -74,13 +74,13 @@ int main(int argc, char **argv) {
74 } 74 }
75 75
76 if (debug) { 76 if (debug) {
77 wlr_log_init(WLR_DEBUG, NULL); 77 sway_log_init(SWAY_DEBUG, NULL);
78 } else { 78 } else {
79 wlr_log_init(WLR_INFO, NULL); 79 sway_log_init(SWAY_INFO, NULL);
80 } 80 }
81 81
82 if (!swaybar.id) { 82 if (!swaybar.id) {
83 wlr_log(WLR_ERROR, "No bar_id passed. " 83 sway_log(SWAY_ERROR, "No bar_id passed. "
84 "Provide --bar_id or let sway start swaybar"); 84 "Provide --bar_id or let sway start swaybar");
85 return 1; 85 return 1;
86 } 86 }
@@ -88,7 +88,7 @@ int main(int argc, char **argv) {
88 if (!socket_path) { 88 if (!socket_path) {
89 socket_path = get_socketpath(); 89 socket_path = get_socketpath();
90 if (!socket_path) { 90 if (!socket_path) {
91 wlr_log(WLR_ERROR, "Unable to retrieve socket path"); 91 sway_log(SWAY_ERROR, "Unable to retrieve socket path");
92 return 1; 92 return 1;
93 } 93 }
94 } 94 }
diff --git a/swaybar/render.c b/swaybar/render.c
index 55f680ed..e27f7d4c 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -5,7 +5,6 @@
5#include <stdlib.h> 5#include <stdlib.h>
6#include <stdint.h> 6#include <stdint.h>
7#include <string.h> 7#include <string.h>
8#include <wlr/util/log.h>
9#include "cairo.h" 8#include "cairo.h"
10#include "pango.h" 9#include "pango.h"
11#include "pool-buffer.h" 10#include "pool-buffer.h"
diff --git a/swaybar/status_line.c b/swaybar/status_line.c
index f0e2c300..39ae8670 100644
--- a/swaybar/status_line.c
+++ b/swaybar/status_line.c
@@ -6,7 +6,7 @@
6#include <string.h> 6#include <string.h>
7#include <stdio.h> 7#include <stdio.h>
8#include <unistd.h> 8#include <unistd.h>
9#include <wlr/util/log.h> 9#include "log.h"
10#include "loop.h" 10#include "loop.h"
11#include "swaybar/bar.h" 11#include "swaybar/bar.h"
12#include "swaybar/config.h" 12#include "swaybar/config.h"
@@ -38,7 +38,7 @@ bool status_handle_readable(struct status_line *status) {
38 errno = 0; 38 errno = 0;
39 int available_bytes; 39 int available_bytes;
40 if (ioctl(status->read_fd, FIONREAD, &available_bytes) == -1) { 40 if (ioctl(status->read_fd, FIONREAD, &available_bytes) == -1) {
41 wlr_log(WLR_ERROR, "Unable to read status command output size"); 41 sway_log(SWAY_ERROR, "Unable to read status command output size");
42 status_error(status, "[error reading from status command]"); 42 status_error(status, "[error reading from status command]");
43 return true; 43 return true;
44 } 44 }
@@ -49,7 +49,7 @@ bool status_handle_readable(struct status_line *status) {
49 status->buffer = realloc(status->buffer, status->buffer_size); 49 status->buffer = realloc(status->buffer, status->buffer_size);
50 } 50 }
51 if (status->buffer == NULL) { 51 if (status->buffer == NULL) {
52 wlr_log_errno(WLR_ERROR, "Unable to read status line"); 52 sway_log_errno(SWAY_ERROR, "Unable to read status line");
53 status_error(status, "[error reading from status command]"); 53 status_error(status, "[error reading from status command]");
54 return true; 54 return true;
55 } 55 }
@@ -68,13 +68,13 @@ bool status_handle_readable(struct status_line *status) {
68 && (header = json_tokener_parse(status->buffer)) 68 && (header = json_tokener_parse(status->buffer))
69 && json_object_object_get_ex(header, "version", &version) 69 && json_object_object_get_ex(header, "version", &version)
70 && json_object_get_int(version) == 1) { 70 && json_object_get_int(version) == 1) {
71 wlr_log(WLR_DEBUG, "Using i3bar protocol."); 71 sway_log(SWAY_DEBUG, "Using i3bar protocol.");
72 status->protocol = PROTOCOL_I3BAR; 72 status->protocol = PROTOCOL_I3BAR;
73 73
74 json_object *click_events; 74 json_object *click_events;
75 if (json_object_object_get_ex(header, "click_events", &click_events) 75 if (json_object_object_get_ex(header, "click_events", &click_events)
76 && json_object_get_boolean(click_events)) { 76 && json_object_get_boolean(click_events)) {
77 wlr_log(WLR_DEBUG, "Enabling click events."); 77 sway_log(SWAY_DEBUG, "Enabling click events.");
78 status->click_events = true; 78 status->click_events = true;
79 if (write(status->write_fd, "[\n", 2) != 2) { 79 if (write(status->write_fd, "[\n", 2) != 2) {
80 status_error(status, "[failed to write to status command]"); 80 status_error(status, "[failed to write to status command]");
@@ -86,11 +86,11 @@ bool status_handle_readable(struct status_line *status) {
86 json_object *signal; 86 json_object *signal;
87 if (json_object_object_get_ex(header, "stop_signal", &signal)) { 87 if (json_object_object_get_ex(header, "stop_signal", &signal)) {
88 status->stop_signal = json_object_get_int(signal); 88 status->stop_signal = json_object_get_int(signal);
89 wlr_log(WLR_DEBUG, "Setting stop signal to %d", status->stop_signal); 89 sway_log(SWAY_DEBUG, "Setting stop signal to %d", status->stop_signal);
90 } 90 }
91 if (json_object_object_get_ex(header, "cont_signal", &signal)) { 91 if (json_object_object_get_ex(header, "cont_signal", &signal)) {
92 status->cont_signal = json_object_get_int(signal); 92 status->cont_signal = json_object_get_int(signal);
93 wlr_log(WLR_DEBUG, "Setting cont signal to %d", status->cont_signal); 93 sway_log(SWAY_DEBUG, "Setting cont signal to %d", status->cont_signal);
94 } 94 }
95 95
96 json_object_put(header); 96 json_object_put(header);
@@ -102,7 +102,7 @@ bool status_handle_readable(struct status_line *status) {
102 return i3bar_handle_readable(status); 102 return i3bar_handle_readable(status);
103 } 103 }
104 104
105 wlr_log(WLR_DEBUG, "Using text protocol."); 105 sway_log(SWAY_DEBUG, "Using text protocol.");
106 status->protocol = PROTOCOL_TEXT; 106 status->protocol = PROTOCOL_TEXT;
107 status->text = status->buffer; 107 status->text = status->buffer;
108 // intentional fall-through 108 // intentional fall-through
@@ -140,7 +140,7 @@ struct status_line *status_line_init(char *cmd) {
140 int pipe_read_fd[2]; 140 int pipe_read_fd[2];
141 int pipe_write_fd[2]; 141 int pipe_write_fd[2];
142 if (pipe(pipe_read_fd) != 0 || pipe(pipe_write_fd) != 0) { 142 if (pipe(pipe_read_fd) != 0 || pipe(pipe_write_fd) != 0) {
143 wlr_log(WLR_ERROR, "Unable to create pipes for status_command fork"); 143 sway_log(SWAY_ERROR, "Unable to create pipes for status_command fork");
144 exit(1); 144 exit(1);
145 } 145 }
146 146
diff --git a/swaybar/tray/host.c b/swaybar/tray/host.c
index cc8dd188..215e1e72 100644
--- a/swaybar/tray/host.c
+++ b/swaybar/tray/host.c
@@ -21,7 +21,7 @@ static int cmp_sni_id(const void *item, const void *cmp_to) {
21static void add_sni(struct swaybar_tray *tray, char *id) { 21static void add_sni(struct swaybar_tray *tray, char *id) {
22 int idx = list_seq_find(tray->items, cmp_sni_id, id); 22 int idx = list_seq_find(tray->items, cmp_sni_id, id);
23 if (idx == -1) { 23 if (idx == -1) {
24 wlr_log(WLR_INFO, "Registering Status Notifier Item '%s'", id); 24 sway_log(SWAY_INFO, "Registering Status Notifier Item '%s'", id);
25 struct swaybar_sni *sni = create_sni(id, tray); 25 struct swaybar_sni *sni = create_sni(id, tray);
26 if (sni) { 26 if (sni) {
27 list_add(tray->items, sni); 27 list_add(tray->items, sni);
@@ -34,7 +34,7 @@ static int handle_sni_registered(sd_bus_message *msg, void *data,
34 char *id; 34 char *id;
35 int ret = sd_bus_message_read(msg, "s", &id); 35 int ret = sd_bus_message_read(msg, "s", &id);
36 if (ret < 0) { 36 if (ret < 0) {
37 wlr_log(WLR_ERROR, "Failed to parse register SNI message: %s", strerror(-ret)); 37 sway_log(SWAY_ERROR, "Failed to parse register SNI message: %s", strerror(-ret));
38 } 38 }
39 39
40 struct swaybar_tray *tray = data; 40 struct swaybar_tray *tray = data;
@@ -48,13 +48,13 @@ static int handle_sni_unregistered(sd_bus_message *msg, void *data,
48 char *id; 48 char *id;
49 int ret = sd_bus_message_read(msg, "s", &id); 49 int ret = sd_bus_message_read(msg, "s", &id);
50 if (ret < 0) { 50 if (ret < 0) {
51 wlr_log(WLR_ERROR, "Failed to parse unregister SNI message: %s", strerror(-ret)); 51 sway_log(SWAY_ERROR, "Failed to parse unregister SNI message: %s", strerror(-ret));
52 } 52 }
53 53
54 struct swaybar_tray *tray = data; 54 struct swaybar_tray *tray = data;
55 int idx = list_seq_find(tray->items, cmp_sni_id, id); 55 int idx = list_seq_find(tray->items, cmp_sni_id, id);
56 if (idx != -1) { 56 if (idx != -1) {
57 wlr_log(WLR_INFO, "Unregistering Status Notifier Item '%s'", id); 57 sway_log(SWAY_INFO, "Unregistering Status Notifier Item '%s'", id);
58 destroy_sni(tray->items->items[idx]); 58 destroy_sni(tray->items->items[idx]);
59 list_del(tray->items, idx); 59 list_del(tray->items, idx);
60 set_bar_dirty(tray->bar); 60 set_bar_dirty(tray->bar);
@@ -66,20 +66,20 @@ static int get_registered_snis_callback(sd_bus_message *msg, void *data,
66 sd_bus_error *error) { 66 sd_bus_error *error) {
67 if (sd_bus_message_is_method_error(msg, NULL)) { 67 if (sd_bus_message_is_method_error(msg, NULL)) {
68 sd_bus_error err = *sd_bus_message_get_error(msg); 68 sd_bus_error err = *sd_bus_message_get_error(msg);
69 wlr_log(WLR_ERROR, "Failed to get registered SNIs: %s", err.message); 69 sway_log(SWAY_ERROR, "Failed to get registered SNIs: %s", err.message);
70 return -sd_bus_error_get_errno(&err); 70 return -sd_bus_error_get_errno(&err);
71 } 71 }
72 72
73 int ret = sd_bus_message_enter_container(msg, 'v', NULL); 73 int ret = sd_bus_message_enter_container(msg, 'v', NULL);
74 if (ret < 0) { 74 if (ret < 0) {
75 wlr_log(WLR_ERROR, "Failed to read registered SNIs: %s", strerror(-ret)); 75 sway_log(SWAY_ERROR, "Failed to read registered SNIs: %s", strerror(-ret));
76 return ret; 76 return ret;
77 } 77 }
78 78
79 char **ids; 79 char **ids;
80 ret = sd_bus_message_read_strv(msg, &ids); 80 ret = sd_bus_message_read_strv(msg, &ids);
81 if (ret < 0) { 81 if (ret < 0) {
82 wlr_log(WLR_ERROR, "Failed to read registered SNIs: %s", strerror(-ret)); 82 sway_log(SWAY_ERROR, "Failed to read registered SNIs: %s", strerror(-ret));
83 return ret; 83 return ret;
84 } 84 }
85 85
@@ -99,7 +99,7 @@ static bool register_to_watcher(struct swaybar_host *host) {
99 host->watcher_interface, watcher_path, host->watcher_interface, 99 host->watcher_interface, watcher_path, host->watcher_interface,
100 "RegisterStatusNotifierHost", NULL, NULL, "s", host->service); 100 "RegisterStatusNotifierHost", NULL, NULL, "s", host->service);
101 if (ret < 0) { 101 if (ret < 0) {
102 wlr_log(WLR_ERROR, "Failed to send register call: %s", strerror(-ret)); 102 sway_log(SWAY_ERROR, "Failed to send register call: %s", strerror(-ret));
103 return false; 103 return false;
104 } 104 }
105 105
@@ -109,7 +109,7 @@ static bool register_to_watcher(struct swaybar_host *host) {
109 get_registered_snis_callback, host->tray, "ss", 109 get_registered_snis_callback, host->tray, "ss",
110 host->watcher_interface, "RegisteredStatusNotifierItems"); 110 host->watcher_interface, "RegisteredStatusNotifierItems");
111 if (ret < 0) { 111 if (ret < 0) {
112 wlr_log(WLR_ERROR, "Failed to get registered SNIs: %s", strerror(-ret)); 112 sway_log(SWAY_ERROR, "Failed to get registered SNIs: %s", strerror(-ret));
113 } 113 }
114 114
115 return ret >= 0; 115 return ret >= 0;
@@ -120,7 +120,7 @@ static int handle_new_watcher(sd_bus_message *msg,
120 char *service, *old_owner, *new_owner; 120 char *service, *old_owner, *new_owner;
121 int ret = sd_bus_message_read(msg, "sss", &service, &old_owner, &new_owner); 121 int ret = sd_bus_message_read(msg, "sss", &service, &old_owner, &new_owner);
122 if (ret < 0) { 122 if (ret < 0) {
123 wlr_log(WLR_ERROR, "Failed to parse owner change message: %s", strerror(-ret)); 123 sway_log(SWAY_ERROR, "Failed to parse owner change message: %s", strerror(-ret));
124 return ret; 124 return ret;
125 } 125 }
126 126
@@ -148,7 +148,7 @@ bool init_host(struct swaybar_host *host, char *protocol,
148 watcher_path, host->watcher_interface, 148 watcher_path, host->watcher_interface,
149 "StatusNotifierItemRegistered", handle_sni_registered, tray); 149 "StatusNotifierItemRegistered", handle_sni_registered, tray);
150 if (ret < 0) { 150 if (ret < 0) {
151 wlr_log(WLR_ERROR, "Failed to subscribe to registering events: %s", 151 sway_log(SWAY_ERROR, "Failed to subscribe to registering events: %s",
152 strerror(-ret)); 152 strerror(-ret));
153 goto error; 153 goto error;
154 } 154 }
@@ -156,7 +156,7 @@ bool init_host(struct swaybar_host *host, char *protocol,
156 watcher_path, host->watcher_interface, 156 watcher_path, host->watcher_interface,
157 "StatusNotifierItemUnregistered", handle_sni_unregistered, tray); 157 "StatusNotifierItemUnregistered", handle_sni_unregistered, tray);
158 if (ret < 0) { 158 if (ret < 0) {
159 wlr_log(WLR_ERROR, "Failed to subscribe to unregistering events: %s", 159 sway_log(SWAY_ERROR, "Failed to subscribe to unregistering events: %s",
160 strerror(-ret)); 160 strerror(-ret));
161 goto error; 161 goto error;
162 } 162 }
@@ -165,7 +165,7 @@ bool init_host(struct swaybar_host *host, char *protocol,
165 "/org/freedesktop/DBus", "org.freedesktop.DBus", "NameOwnerChanged", 165 "/org/freedesktop/DBus", "org.freedesktop.DBus", "NameOwnerChanged",
166 handle_new_watcher, host); 166 handle_new_watcher, host);
167 if (ret < 0) { 167 if (ret < 0) {
168 wlr_log(WLR_ERROR, "Failed to subscribe to unregistering events: %s", 168 sway_log(SWAY_ERROR, "Failed to subscribe to unregistering events: %s",
169 strerror(-ret)); 169 strerror(-ret));
170 goto error; 170 goto error;
171 } 171 }
@@ -180,7 +180,7 @@ bool init_host(struct swaybar_host *host, char *protocol,
180 snprintf(host->service, service_len, "org.%s.StatusNotifierHost-%d", protocol, pid); 180 snprintf(host->service, service_len, "org.%s.StatusNotifierHost-%d", protocol, pid);
181 ret = sd_bus_request_name(tray->bus, host->service, 0); 181 ret = sd_bus_request_name(tray->bus, host->service, 0);
182 if (ret < 0) { 182 if (ret < 0) {
183 wlr_log(WLR_DEBUG, "Failed to acquire service name: %s", strerror(-ret)); 183 sway_log(SWAY_DEBUG, "Failed to acquire service name: %s", strerror(-ret));
184 goto error; 184 goto error;
185 } 185 }
186 186
@@ -193,7 +193,7 @@ bool init_host(struct swaybar_host *host, char *protocol,
193 sd_bus_slot_set_floating(unreg_slot, 1); 193 sd_bus_slot_set_floating(unreg_slot, 1);
194 sd_bus_slot_set_floating(watcher_slot, 1); 194 sd_bus_slot_set_floating(watcher_slot, 1);
195 195
196 wlr_log(WLR_DEBUG, "Registered %s", host->service); 196 sway_log(SWAY_DEBUG, "Registered %s", host->service);
197 return true; 197 return true;
198error: 198error:
199 sd_bus_slot_unref(reg_slot); 199 sd_bus_slot_unref(reg_slot);
diff --git a/swaybar/tray/icon.c b/swaybar/tray/icon.c
index 15fda631..ed152be5 100644
--- a/swaybar/tray/icon.c
+++ b/swaybar/tray/icon.c
@@ -317,7 +317,7 @@ void init_themes(list_t **themes, list_t **basedirs) {
317 list_add(theme_names, theme->name); 317 list_add(theme_names, theme->name);
318 } 318 }
319 char *theme_list = join_list(theme_names, ", "); 319 char *theme_list = join_list(theme_names, ", ");
320 wlr_log(WLR_DEBUG, "Loaded themes: %s", theme_list); 320 sway_log(SWAY_DEBUG, "Loaded themes: %s", theme_list);
321 free(theme_list); 321 free(theme_list);
322 list_free(theme_names); 322 list_free(theme_names);
323} 323}
diff --git a/swaybar/tray/item.c b/swaybar/tray/item.c
index 9056331e..39d83b23 100644
--- a/swaybar/tray/item.c
+++ b/swaybar/tray/item.c
@@ -35,12 +35,12 @@ static int read_pixmap(sd_bus_message *msg, struct swaybar_sni *sni,
35 const char *prop, list_t **dest) { 35 const char *prop, list_t **dest) {
36 int ret = sd_bus_message_enter_container(msg, 'a', "(iiay)"); 36 int ret = sd_bus_message_enter_container(msg, 'a', "(iiay)");
37 if (ret < 0) { 37 if (ret < 0) {
38 wlr_log(WLR_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret)); 38 sway_log(SWAY_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret));
39 return ret; 39 return ret;
40 } 40 }
41 41
42 if (sd_bus_message_at_end(msg, 0)) { 42 if (sd_bus_message_at_end(msg, 0)) {
43 wlr_log(WLR_DEBUG, "%s %s no. of icons = 0", sni->watcher_id, prop); 43 sway_log(SWAY_DEBUG, "%s %s no. of icons = 0", sni->watcher_id, prop);
44 return ret; 44 return ret;
45 } 45 }
46 46
@@ -52,14 +52,14 @@ static int read_pixmap(sd_bus_message *msg, struct swaybar_sni *sni,
52 while (!sd_bus_message_at_end(msg, 0)) { 52 while (!sd_bus_message_at_end(msg, 0)) {
53 ret = sd_bus_message_enter_container(msg, 'r', "iiay"); 53 ret = sd_bus_message_enter_container(msg, 'r', "iiay");
54 if (ret < 0) { 54 if (ret < 0) {
55 wlr_log(WLR_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret)); 55 sway_log(SWAY_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret));
56 goto error; 56 goto error;
57 } 57 }
58 58
59 int size; 59 int size;
60 ret = sd_bus_message_read(msg, "ii", NULL, &size); 60 ret = sd_bus_message_read(msg, "ii", NULL, &size);
61 if (ret < 0) { 61 if (ret < 0) {
62 wlr_log(WLR_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret)); 62 sway_log(SWAY_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret));
63 goto error; 63 goto error;
64 } 64 }
65 65
@@ -67,7 +67,7 @@ static int read_pixmap(sd_bus_message *msg, struct swaybar_sni *sni,
67 size_t npixels; 67 size_t npixels;
68 ret = sd_bus_message_read_array(msg, 'y', &pixels, &npixels); 68 ret = sd_bus_message_read_array(msg, 'y', &pixels, &npixels);
69 if (ret < 0) { 69 if (ret < 0) {
70 wlr_log(WLR_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret)); 70 sway_log(SWAY_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret));
71 goto error; 71 goto error;
72 } 72 }
73 73
@@ -81,7 +81,7 @@ static int read_pixmap(sd_bus_message *msg, struct swaybar_sni *sni,
81 } 81 }
82 list_free_items_and_destroy(*dest); 82 list_free_items_and_destroy(*dest);
83 *dest = pixmaps; 83 *dest = pixmaps;
84 wlr_log(WLR_DEBUG, "%s %s no. of icons = %d", sni->watcher_id, prop, 84 sway_log(SWAY_DEBUG, "%s %s no. of icons = %d", sni->watcher_id, prop,
85 pixmaps->length); 85 pixmaps->length);
86 86
87 return ret; 87 return ret;
@@ -107,7 +107,7 @@ static int get_property_callback(sd_bus_message *msg, void *data,
107 107
108 int ret; 108 int ret;
109 if (sd_bus_message_is_method_error(msg, NULL)) { 109 if (sd_bus_message_is_method_error(msg, NULL)) {
110 wlr_log(WLR_ERROR, "%s %s: %s", sni->watcher_id, prop, 110 sway_log(SWAY_ERROR, "%s %s: %s", sni->watcher_id, prop,
111 sd_bus_message_get_error(msg)->message); 111 sd_bus_message_get_error(msg)->message);
112 ret = sd_bus_message_get_errno(msg); 112 ret = sd_bus_message_get_errno(msg);
113 goto cleanup; 113 goto cleanup;
@@ -115,7 +115,7 @@ static int get_property_callback(sd_bus_message *msg, void *data,
115 115
116 ret = sd_bus_message_enter_container(msg, 'v', type); 116 ret = sd_bus_message_enter_container(msg, 'v', type);
117 if (ret < 0) { 117 if (ret < 0) {
118 wlr_log(WLR_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret)); 118 sway_log(SWAY_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret));
119 goto cleanup; 119 goto cleanup;
120 } 120 }
121 121
@@ -131,16 +131,16 @@ static int get_property_callback(sd_bus_message *msg, void *data,
131 131
132 ret = sd_bus_message_read(msg, type, dest); 132 ret = sd_bus_message_read(msg, type, dest);
133 if (ret < 0) { 133 if (ret < 0) {
134 wlr_log(WLR_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret)); 134 sway_log(SWAY_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret));
135 goto cleanup; 135 goto cleanup;
136 } 136 }
137 137
138 if (*type == 's' || *type == 'o') { 138 if (*type == 's' || *type == 'o') {
139 char **str = dest; 139 char **str = dest;
140 *str = strdup(*str); 140 *str = strdup(*str);
141 wlr_log(WLR_DEBUG, "%s %s = '%s'", sni->watcher_id, prop, *str); 141 sway_log(SWAY_DEBUG, "%s %s = '%s'", sni->watcher_id, prop, *str);
142 } else if (*type == 'b') { 142 } else if (*type == 'b') {
143 wlr_log(WLR_DEBUG, "%s %s = %s", sni->watcher_id, prop, 143 sway_log(SWAY_DEBUG, "%s %s = %s", sni->watcher_id, prop,
144 *(bool *)dest ? "true" : "false"); 144 *(bool *)dest ? "true" : "false");
145 } 145 }
146 } 146 }
@@ -165,7 +165,7 @@ static void sni_get_property_async(struct swaybar_sni *sni, const char *prop,
165 sni->path, "org.freedesktop.DBus.Properties", "Get", 165 sni->path, "org.freedesktop.DBus.Properties", "Get",
166 get_property_callback, data, "ss", sni->interface, prop); 166 get_property_callback, data, "ss", sni->interface, prop);
167 if (ret < 0) { 167 if (ret < 0) {
168 wlr_log(WLR_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret)); 168 sway_log(SWAY_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret));
169 } 169 }
170} 170}
171 171
@@ -188,10 +188,10 @@ static int sni_check_msg_sender(struct swaybar_sni *sni, sd_bus_message *msg,
188 bool has_well_known_names = 188 bool has_well_known_names =
189 sd_bus_creds_get_mask(sd_bus_message_get_creds(msg)) & SD_BUS_CREDS_WELL_KNOWN_NAMES; 189 sd_bus_creds_get_mask(sd_bus_message_get_creds(msg)) & SD_BUS_CREDS_WELL_KNOWN_NAMES;
190 if (sni->service[0] == ':' || has_well_known_names) { 190 if (sni->service[0] == ':' || has_well_known_names) {
191 wlr_log(WLR_DEBUG, "%s has new %s", sni->watcher_id, signal); 191 sway_log(SWAY_DEBUG, "%s has new %s", sni->watcher_id, signal);
192 return 1; 192 return 1;
193 } else { 193 } else {
194 wlr_log(WLR_DEBUG, "%s may have new %s", sni->watcher_id, signal); 194 sway_log(SWAY_DEBUG, "%s may have new %s", sni->watcher_id, signal);
195 return 0; 195 return 0;
196 } 196 }
197} 197}
@@ -218,12 +218,12 @@ static int handle_new_status(sd_bus_message *msg, void *data, sd_bus_error *erro
218 char *status; 218 char *status;
219 int r = sd_bus_message_read(msg, "s", &status); 219 int r = sd_bus_message_read(msg, "s", &status);
220 if (r < 0) { 220 if (r < 0) {
221 wlr_log(WLR_ERROR, "%s new status error: %s", sni->watcher_id, strerror(-ret)); 221 sway_log(SWAY_ERROR, "%s new status error: %s", sni->watcher_id, strerror(-ret));
222 ret = r; 222 ret = r;
223 } else { 223 } else {
224 free(sni->status); 224 free(sni->status);
225 sni->status = strdup(status); 225 sni->status = strdup(status);
226 wlr_log(WLR_DEBUG, "%s has new status = '%s'", sni->watcher_id, status); 226 sway_log(SWAY_DEBUG, "%s has new status = '%s'", sni->watcher_id, status);
227 set_sni_dirty(sni); 227 set_sni_dirty(sni);
228 } 228 }
229 } else { 229 } else {
@@ -238,7 +238,7 @@ static void sni_match_signal(struct swaybar_sni *sni, sd_bus_slot **slot,
238 int ret = sd_bus_match_signal(sni->tray->bus, slot, sni->service, sni->path, 238 int ret = sd_bus_match_signal(sni->tray->bus, slot, sni->service, sni->path,
239 sni->interface, signal, callback, sni); 239 sni->interface, signal, callback, sni);
240 if (ret < 0) { 240 if (ret < 0) {
241 wlr_log(WLR_ERROR, "Failed to subscribe to signal %s: %s", signal, 241 sway_log(SWAY_ERROR, "Failed to subscribe to signal %s: %s", signal,
242 strerror(-ret)); 242 strerror(-ret));
243 } 243 }
244} 244}
@@ -353,7 +353,7 @@ static int cmp_sni_id(const void *item, const void *cmp_to) {
353static enum hotspot_event_handling icon_hotspot_callback( 353static enum hotspot_event_handling icon_hotspot_callback(
354 struct swaybar_output *output, struct swaybar_hotspot *hotspot, 354 struct swaybar_output *output, struct swaybar_hotspot *hotspot,
355 int x, int y, uint32_t button, void *data) { 355 int x, int y, uint32_t button, void *data) {
356 wlr_log(WLR_DEBUG, "Clicked on %s", (char *)data); 356 sway_log(SWAY_DEBUG, "Clicked on %s", (char *)data);
357 357
358 struct swaybar_tray *tray = output->bar->tray; 358 struct swaybar_tray *tray = output->bar->tray;
359 int idx = list_seq_find(tray->items, cmp_sni_id, data); 359 int idx = list_seq_find(tray->items, cmp_sni_id, data);
@@ -367,11 +367,11 @@ static enum hotspot_event_handling icon_hotspot_callback(
367 int global_y = output->output_y + (top_bar ? config->gaps.top + y: 367 int global_y = output->output_y + (top_bar ? config->gaps.top + y:
368 (int) output->output_height - config->gaps.bottom - y); 368 (int) output->output_height - config->gaps.bottom - y);
369 369
370 wlr_log(WLR_DEBUG, "Guessing click position at (%d, %d)", global_x, global_y); 370 sway_log(SWAY_DEBUG, "Guessing click position at (%d, %d)", global_x, global_y);
371 handle_click(sni, global_x, global_y, button, 1); // TODO get delta from event 371 handle_click(sni, global_x, global_y, button, 1); // TODO get delta from event
372 return HOTSPOT_IGNORE; 372 return HOTSPOT_IGNORE;
373 } else { 373 } else {
374 wlr_log(WLR_DEBUG, "but it doesn't exist"); 374 sway_log(SWAY_DEBUG, "but it doesn't exist");
375 } 375 }
376 376
377 return HOTSPOT_PROCESS; 377 return HOTSPOT_PROCESS;
diff --git a/swaybar/tray/tray.c b/swaybar/tray/tray.c
index d5d0c84e..fcf8114f 100644
--- a/swaybar/tray/tray.c
+++ b/swaybar/tray/tray.c
@@ -17,7 +17,7 @@ static int handle_lost_watcher(sd_bus_message *msg,
17 char *service, *old_owner, *new_owner; 17 char *service, *old_owner, *new_owner;
18 int ret = sd_bus_message_read(msg, "sss", &service, &old_owner, &new_owner); 18 int ret = sd_bus_message_read(msg, "sss", &service, &old_owner, &new_owner);
19 if (ret < 0) { 19 if (ret < 0) {
20 wlr_log(WLR_ERROR, "Failed to parse owner change message: %s", strerror(-ret)); 20 sway_log(SWAY_ERROR, "Failed to parse owner change message: %s", strerror(-ret));
21 return ret; 21 return ret;
22 } 22 }
23 23
@@ -34,12 +34,12 @@ static int handle_lost_watcher(sd_bus_message *msg,
34} 34}
35 35
36struct swaybar_tray *create_tray(struct swaybar *bar) { 36struct swaybar_tray *create_tray(struct swaybar *bar) {
37 wlr_log(WLR_DEBUG, "Initializing tray"); 37 sway_log(SWAY_DEBUG, "Initializing tray");
38 38
39 sd_bus *bus; 39 sd_bus *bus;
40 int ret = sd_bus_open_user(&bus); 40 int ret = sd_bus_open_user(&bus);
41 if (ret < 0) { 41 if (ret < 0) {
42 wlr_log(WLR_ERROR, "Failed to connect to user bus: %s", strerror(-ret)); 42 sway_log(SWAY_ERROR, "Failed to connect to user bus: %s", strerror(-ret));
43 return NULL; 43 return NULL;
44 } 44 }
45 45
@@ -58,7 +58,7 @@ struct swaybar_tray *create_tray(struct swaybar *bar) {
58 "/org/freedesktop/DBus", "org.freedesktop.DBus", 58 "/org/freedesktop/DBus", "org.freedesktop.DBus",
59 "NameOwnerChanged", handle_lost_watcher, tray); 59 "NameOwnerChanged", handle_lost_watcher, tray);
60 if (ret < 0) { 60 if (ret < 0) {
61 wlr_log(WLR_ERROR, "Failed to subscribe to unregistering events: %s", 61 sway_log(SWAY_ERROR, "Failed to subscribe to unregistering events: %s",
62 strerror(-ret)); 62 strerror(-ret));
63 } 63 }
64 64
@@ -96,7 +96,7 @@ void tray_in(int fd, short mask, void *data) {
96 // This space intentionally left blank 96 // This space intentionally left blank
97 } 97 }
98 if (ret < 0) { 98 if (ret < 0) {
99 wlr_log(WLR_ERROR, "Failed to process bus: %s", strerror(-ret)); 99 sway_log(SWAY_ERROR, "Failed to process bus: %s", strerror(-ret));
100 } 100 }
101} 101}
102 102
diff --git a/swaybar/tray/watcher.c b/swaybar/tray/watcher.c
index 198c6c85..68052ed9 100644
--- a/swaybar/tray/watcher.c
+++ b/swaybar/tray/watcher.c
@@ -27,7 +27,7 @@ static int handle_lost_service(sd_bus_message *msg,
27 char *service, *old_owner, *new_owner; 27 char *service, *old_owner, *new_owner;
28 int ret = sd_bus_message_read(msg, "sss", &service, &old_owner, &new_owner); 28 int ret = sd_bus_message_read(msg, "sss", &service, &old_owner, &new_owner);
29 if (ret < 0) { 29 if (ret < 0) {
30 wlr_log(WLR_ERROR, "Failed to parse owner change message: %s", strerror(-ret)); 30 sway_log(SWAY_ERROR, "Failed to parse owner change message: %s", strerror(-ret));
31 return ret; 31 return ret;
32 } 32 }
33 33
@@ -37,7 +37,7 @@ static int handle_lost_service(sd_bus_message *msg,
37 using_standard_protocol(watcher) ? cmp_id : cmp_service, service); 37 using_standard_protocol(watcher) ? cmp_id : cmp_service, service);
38 if (idx != -1) { 38 if (idx != -1) {
39 char *id = watcher->items->items[idx]; 39 char *id = watcher->items->items[idx];
40 wlr_log(WLR_DEBUG, "Unregistering Status Notifier Item '%s'", id); 40 sway_log(SWAY_DEBUG, "Unregistering Status Notifier Item '%s'", id);
41 list_del(watcher->items, idx); 41 list_del(watcher->items, idx);
42 sd_bus_emit_signal(watcher->bus, obj_path, watcher->interface, 42 sd_bus_emit_signal(watcher->bus, obj_path, watcher->interface,
43 "StatusNotifierItemUnregistered", "s", id); 43 "StatusNotifierItemUnregistered", "s", id);
@@ -46,7 +46,7 @@ static int handle_lost_service(sd_bus_message *msg,
46 46
47 idx = list_seq_find(watcher->hosts, cmp_id, service); 47 idx = list_seq_find(watcher->hosts, cmp_id, service);
48 if (idx != -1) { 48 if (idx != -1) {
49 wlr_log(WLR_DEBUG, "Unregistering Status Notifier Host '%s'", service); 49 sway_log(SWAY_DEBUG, "Unregistering Status Notifier Host '%s'", service);
50 free(watcher->hosts->items[idx]); 50 free(watcher->hosts->items[idx]);
51 list_del(watcher->hosts, idx); 51 list_del(watcher->hosts, idx);
52 } 52 }
@@ -59,7 +59,7 @@ static int register_sni(sd_bus_message *msg, void *data, sd_bus_error *error) {
59 char *service_or_path, *id; 59 char *service_or_path, *id;
60 int ret = sd_bus_message_read(msg, "s", &service_or_path); 60 int ret = sd_bus_message_read(msg, "s", &service_or_path);
61 if (ret < 0) { 61 if (ret < 0) {
62 wlr_log(WLR_ERROR, "Failed to parse register SNI message: %s", strerror(-ret)); 62 sway_log(SWAY_ERROR, "Failed to parse register SNI message: %s", strerror(-ret));
63 return ret; 63 return ret;
64 } 64 }
65 65
@@ -81,12 +81,12 @@ static int register_sni(sd_bus_message *msg, void *data, sd_bus_error *error) {
81 } 81 }
82 82
83 if (list_seq_find(watcher->items, cmp_id, id) == -1) { 83 if (list_seq_find(watcher->items, cmp_id, id) == -1) {
84 wlr_log(WLR_DEBUG, "Registering Status Notifier Item '%s'", id); 84 sway_log(SWAY_DEBUG, "Registering Status Notifier Item '%s'", id);
85 list_add(watcher->items, id); 85 list_add(watcher->items, id);
86 sd_bus_emit_signal(watcher->bus, obj_path, watcher->interface, 86 sd_bus_emit_signal(watcher->bus, obj_path, watcher->interface,
87 "StatusNotifierItemRegistered", "s", id); 87 "StatusNotifierItemRegistered", "s", id);
88 } else { 88 } else {
89 wlr_log(WLR_DEBUG, "Status Notifier Item '%s' already registered", id); 89 sway_log(SWAY_DEBUG, "Status Notifier Item '%s' already registered", id);
90 free(id); 90 free(id);
91 } 91 }
92 92
@@ -97,18 +97,18 @@ static int register_host(sd_bus_message *msg, void *data, sd_bus_error *error) {
97 char *service; 97 char *service;
98 int ret = sd_bus_message_read(msg, "s", &service); 98 int ret = sd_bus_message_read(msg, "s", &service);
99 if (ret < 0) { 99 if (ret < 0) {
100 wlr_log(WLR_ERROR, "Failed to parse register host message: %s", strerror(-ret)); 100 sway_log(SWAY_ERROR, "Failed to parse register host message: %s", strerror(-ret));
101 return ret; 101 return ret;
102 } 102 }
103 103
104 struct swaybar_watcher *watcher = data; 104 struct swaybar_watcher *watcher = data;
105 if (list_seq_find(watcher->hosts, cmp_id, service) == -1) { 105 if (list_seq_find(watcher->hosts, cmp_id, service) == -1) {
106 wlr_log(WLR_DEBUG, "Registering Status Notifier Host '%s'", service); 106 sway_log(SWAY_DEBUG, "Registering Status Notifier Host '%s'", service);
107 list_add(watcher->hosts, strdup(service)); 107 list_add(watcher->hosts, strdup(service));
108 sd_bus_emit_signal(watcher->bus, obj_path, watcher->interface, 108 sd_bus_emit_signal(watcher->bus, obj_path, watcher->interface,
109 "StatusNotifierHostRegistered", "s", service); 109 "StatusNotifierHostRegistered", "s", service);
110 } else { 110 } else {
111 wlr_log(WLR_DEBUG, "Status Notifier Host '%s' already registered", service); 111 sway_log(SWAY_DEBUG, "Status Notifier Host '%s' already registered", service);
112 } 112 }
113 113
114 return sd_bus_reply_method_return(msg, ""); 114 return sd_bus_reply_method_return(msg, "");
@@ -166,7 +166,7 @@ struct swaybar_watcher *create_watcher(char *protocol, sd_bus *bus) {
166 int ret = sd_bus_add_object_vtable(bus, &vtable_slot, obj_path, 166 int ret = sd_bus_add_object_vtable(bus, &vtable_slot, obj_path,
167 watcher->interface, watcher_vtable, watcher); 167 watcher->interface, watcher_vtable, watcher);
168 if (ret < 0) { 168 if (ret < 0) {
169 wlr_log(WLR_ERROR, "Failed to add object vtable: %s", strerror(-ret)); 169 sway_log(SWAY_ERROR, "Failed to add object vtable: %s", strerror(-ret));
170 goto error; 170 goto error;
171 } 171 }
172 172
@@ -174,14 +174,14 @@ struct swaybar_watcher *create_watcher(char *protocol, sd_bus *bus) {
174 "/org/freedesktop/DBus", "org.freedesktop.DBus", 174 "/org/freedesktop/DBus", "org.freedesktop.DBus",
175 "NameOwnerChanged", handle_lost_service, watcher); 175 "NameOwnerChanged", handle_lost_service, watcher);
176 if (ret < 0) { 176 if (ret < 0) {
177 wlr_log(WLR_ERROR, "Failed to subscribe to unregistering events: %s", 177 sway_log(SWAY_ERROR, "Failed to subscribe to unregistering events: %s",
178 strerror(-ret)); 178 strerror(-ret));
179 goto error; 179 goto error;
180 } 180 }
181 181
182 ret = sd_bus_request_name(bus, watcher->interface, 0); 182 ret = sd_bus_request_name(bus, watcher->interface, 0);
183 if (ret < 0) { 183 if (ret < 0) {
184 wlr_log(WLR_ERROR, "Failed to acquire service name: %s", strerror(-ret)); 184 sway_log(SWAY_ERROR, "Failed to acquire service name: %s", strerror(-ret));
185 goto error; 185 goto error;
186 } 186 }
187 187
@@ -192,7 +192,7 @@ struct swaybar_watcher *create_watcher(char *protocol, sd_bus *bus) {
192 watcher->hosts = create_list(); 192 watcher->hosts = create_list();
193 watcher->items = create_list(); 193 watcher->items = create_list();
194 watcher->version = 0; 194 watcher->version = 0;
195 wlr_log(WLR_DEBUG, "Registered %s", watcher->interface); 195 sway_log(SWAY_DEBUG, "Registered %s", watcher->interface);
196 return watcher; 196 return watcher;
197error: 197error:
198 sd_bus_slot_unref(signal_slot); 198 sd_bus_slot_unref(signal_slot);