aboutsummaryrefslogtreecommitdiff
path: root/swaybar/tray
diff options
context:
space:
mode:
authorIan Fan <ianfan0@gmail.com>2018-12-17 23:52:15 +0000
committerIan Fan <ianfan0@gmail.com>2018-12-31 20:40:18 +0000
commit9e31f5d79ce9de8f1c73013b792aa94f355a1983 (patch)
tree93b8ddb51873cae14db8d5f07db74ca96236f184 /swaybar/tray
parent371089f62c2894ff55478c2a4298505e3ed12f3f (diff)
swaybar: use KDE's SNI IconThemePath property
Diffstat (limited to 'swaybar/tray')
-rw-r--r--swaybar/tray/item.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/swaybar/tray/item.c b/swaybar/tray/item.c
index d00339e2..41cacd16 100644
--- a/swaybar/tray/item.c
+++ b/swaybar/tray/item.c
@@ -228,6 +228,7 @@ struct swaybar_sni *create_sni(char *id, struct swaybar_tray *tray) {
sni->service = strndup(id, path_ptr - id);
sni->path = strdup(path_ptr);
sni->interface = "org.kde.StatusNotifierItem";
+ sni_get_property_async(sni, "IconThemePath", "s", &sni->icon_theme_path);
}
// Ignored: Category, Id, Title, WindowId, OverlayIconName,
@@ -353,6 +354,10 @@ uint32_t render_sni(cairo_t *cairo, struct swaybar_output *output, double *x,
char *icon_path = find_icon(sni->tray->themes, sni->tray->basedirs,
icon_name, ideal_size, output->bar->config->icon_theme,
&sni->min_size, &sni->max_size);
+ if (!icon_path && sni->icon_theme_path) {
+ icon_path = find_icon_in_dir(icon_name, sni->icon_theme_path,
+ &sni->min_size, &sni->max_size);
+ }
if (icon_path) {
cairo_surface_destroy(sni->icon);
sni->icon = load_background_image(icon_path);