sxalert

Simple notification system for X
Log | Files | Refs | README | LICENSE

commit d192282a639b901e345583426a8ecac932bab6a2
parent 99a5e18d55e57932cefe65686e28eb328ef7ff14
Author: Michael Constantine Dimopoulos <mk@mcdim.xyz>
Date:   Sat, 18 Nov 2023 03:41:49 +0000

Added wal.diff

Diffstat:
Apatches/wal_colors/wal.diff | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+), 0 deletions(-)

diff --git a/patches/wal_colors/wal.diff b/patches/wal_colors/wal.diff @@ -0,0 +1,63 @@ +--- sxalert.c 2023-11-18 03:34:16.884065897 +0000 ++++ sxalertxr.c 2023-11-18 03:34:23.634028857 +0000 +@@ -70,6 +70,35 @@ + return max; + } + ++void ++get_xresources_colors(void) ++{ ++ FILE *f = fopen(xresources, "r"); ++ char buffer[XR_BUFFER]; ++ ++ char colors[2][8]; ++ int clr_i=0; ++ ++ char *arr[2]; ++ ++ for (int i=0; i<4; i++) { ++ fgets(buffer, sizeof(buffer), f); ++ ++ if (i <= 1) continue; ++ ++ arr[0] = strtok(buffer, "#"); ++ arr[1] = strtok(NULL, "#\n"); ++ ++ strncpy(colors[clr_i++], arr[1], 7); ++ } ++ ++ strcpy(text_color, colors[0]); ++ strcpy(border_color, colors[0]); ++ strcpy(bg_color, colors[1]); ++ ++ fclose(f); ++} ++ + static int + get_width(Display *dpy, XftFont *font, char **lines, int length) + { +@@ -200,6 +229,8 @@ + } + } + ++ get_xresources_colors(); ++ + int lines_len=argc-optind; + char** lines = argv + optind; /* get lines to print */ + draw(border_width, duration, lines, lines_len); +--- config.h 2023-11-18 03:35:59.083505083 +0000 ++++ configxr.h 2023-11-18 03:36:33.963313682 +0000 +@@ -6,6 +6,7 @@ + */ + + #define BUFFER 2054 ++#define XR_BUFFER 128 + + static int duration = 5000; /* in milliseconds */ + +@@ -26,3 +27,5 @@ + + const char *fontname = "DejaVu Sans Mono:size=13:antialias=true"; + static int text_height = 11; ++ ++const char *xresources = "/home/USER/.cache/wal/colors.Xresources"; /* wal */