Skip to content

Commit

Permalink
feat: restart xava on color change
Browse files Browse the repository at this point in the history
  • Loading branch information
make-42 committed Jul 12, 2024
1 parent 9f11c8c commit 8e5566a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/xava.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,22 @@ as of 0.4.0 all options are specified in config file, see in '/home/username/.co
thing.xava = &xava;
xavaIONotifyAddWatch(&thing);

// attach pywal colors file to the IONotify thing
static const char b[] = "/.cache/wal/colors";
int lena = strlen(getenv("HOME"));
int lenb = strlen(b);
char *filename = malloc(lena+lenb+1);
// copy & concat (including string termination)
memcpy(filename,getenv("HOME"),lena);
memcpy(filename+lena,b,lenb+1);
struct xava_ionotify_watch_setup pywal;
pywal.xava_ionotify_func = &handle_ionotify_call;
pywal.filename = filename;
pywal.ionotify = xava.ionotify;
pywal.id = 1;
pywal.xava = &xava;
xavaIONotifyAddWatch(&pywal);

// load symbols
audio->func.loop = xava_module_symbol_address_get(audio->module, "xavaInput");
audio->func.load_config = xava_module_symbol_address_get(audio->module, "xavaInputLoadConfig");
Expand Down

0 comments on commit 8e5566a

Please sign in to comment.