Skip to content

Commit

Permalink
swaybar: silence missing IconThemePath message
Browse files Browse the repository at this point in the history
IconThemePath is not a standard property in XDG's StatusNotifierItem
specification, so missing this property should not be logged as an error.

This patch changes the log level to SWAY_DEBUG when swaybar queries the
value of IconThemePath so that swaybar won't log the returned message as
an error if IconThemePath does not exist.

Closes: swaywm#6092
  • Loading branch information
piyueh committed Mar 17, 2021
1 parent adf7a6f commit 6059c74
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions swaybar/tray/item.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,13 @@ static int get_property_callback(sd_bus_message *msg, void *data,

int ret;
if (sd_bus_message_is_method_error(msg, NULL)) {
sway_log(SWAY_ERROR, "%s %s: %s", sni->watcher_id, prop,
sd_bus_message_get_error(msg)->message);
const sd_bus_error *err = sd_bus_message_get_error(msg);
sway_log_importance_t log_lv = SWAY_ERROR;
if ((!strcmp(prop, "IconThemePath")) &&
(!strcmp(err->name, SD_BUS_ERROR_UNKNOWN_PROPERTY))) {
log_lv = SWAY_DEBUG;
}
sway_log(log_lv, "%s %s: %s", sni->watcher_id, prop, err->message);
ret = sd_bus_message_get_errno(msg);
goto cleanup;
}
Expand Down

0 comments on commit 6059c74

Please sign in to comment.