Closed make-42 closed 2 months ago
inserting this at line 159 of src/output/graphical_x11/main.c
works for X11:
int lineNumber = 1;
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);
FILE *file = fopen(filename, "r");
int count = 0;
if ( file != NULL )
{
char line[256]; /* or other suitable maximum line size */
while (fgets(line, sizeof line, file) != NULL) /* read a line */
{
if (count == lineNumber)
{
sscanf(line, "#%06X", colorNum);
fclose(file);
break;
}
else
{
count++;
}
}
}
I still can't figure out how colors are handled for wayland though...
I also implemented Wayland support
See #60
Merged
Hello! I have a small feature request! For X11 and Wayland users, XAVA could load its colors from pywal (plain text file located at
~/.cache/wal/colors
) for those using pywal. An example file looks like this:Thank you!