Finds paths to icon files using libsfdo. Libsfdo is currently an

optional compile time dependency. This means the former code paths are
all retained and new ones are wrapped in #if HAVE_LIBSFDO. Behavior
should be identical now between the two code paths. Later commits will
add the handling of icons specified as absolute paths which both former
swaybar code and libsfdo have thus far avoided.
This commit is contained in:
myrslint 2025-04-29 17:37:58 +00:00
parent 34d2020042
commit 478c77a69b
14 changed files with 220 additions and 23 deletions

View file

@ -18,6 +18,10 @@
#include "stringop.h"
#include "util.h"
#if HAVE_LIBSFDO
#include "sfdo.h"
#endif
void ipc_send_workspace_command(struct swaybar *bar, const char *ws) {
uint32_t size = strlen("workspace \"\"") + strlen(ws);
for (size_t i = 0; i < strlen(ws); ++i) {
@ -330,6 +334,10 @@ static bool ipc_parse_config(
if ((json_object_object_get_ex(bar_config, "icon_theme", &icon_theme))) {
config->icon_theme = strdup(json_object_get_string(icon_theme));
#if HAVE_LIBSFDO
sfdo_destroy(config->sfdo);
config->sfdo = sfdo_create(config->icon_theme);
#endif
}
#endif