~kris/suckless

slock

d7b259be346091fad33ce27b155586c8d96bc615 — bakkeby 5 years ago d2be9eb
message patch: add xresources compatibility ref. #3
2 files changed, 15 insertions(+), 12 deletions(-)

M config.def.h
M patch/colormessage.c
M config.def.h => config.def.h +14 -11
@@ 17,6 17,17 @@ static const char *colorname[NUMCOLS] = {
	#endif // KEYPRESS_FEEDBACK_PATCH
};

#if MESSAGE_PATCH || COLOR_MESSAGE_PATCH
/* default message */
static const char * message = "Suckless: Software that sucks less.";

/* text color */
static const char * text_color = "#ffffff";

/* text size (must be a valid size) */
static const char * font_name = "6x10";
#endif // MESSAGE_PATCH | COLOR_MESSAGE_PATCH

#if XRESOURCES_PATCH
/*
 * Xresources preferences to load at startup


@@ 31,6 42,9 @@ ResourcePref resources[] = {
		#if PAMAUTH_PATCH
		{ "color5",       STRING,  &colorname[PAM] },
		#endif // PAMAUTH_PATCH
		#if MESSAGE_PATCH || COLOR_MESSAGE_PATCH
		{ "color6",       STRING,  &text_color },
		#endif // MESSAGE_PATCH | COLOR_MESSAGE_PATCH
};
#endif // XRESOURCES_PATCH



@@ 76,17 90,6 @@ static const int blocks_y = 0;
static const int blocks_count = 10;
#endif // KEYPRESS_FEEDBACK_PATCH

#if MESSAGE_PATCH || COLOR_MESSAGE_PATCH
/* default message */
static const char * message = "Suckless: Software that sucks less.";

/* text color */
static const char * text_color = "#ffffff";

/* text size (must be a valid size) */
static const char * font_name = "6x10";
#endif // MESSAGE_PATCH | COLOR_MESSAGE_PATCH

#if PAMAUTH_PATCH
/* PAM service that's used for authentication */
static const char* pam_service = "login";

M patch/colormessage.c => patch/colormessage.c +1 -1
@@ 38,7 38,7 @@ writemessage(Display *dpy, Window win, int screen)
	tab_size = 8 * XTextWidth(fontinfo, " ", 1);

	XAllocNamedColor(dpy, DefaultColormap(dpy, screen),
		 text_color, &color, &dummy);
		text_color, &color, &dummy);

	gr_values.font = fontinfo->fid;
	gr_values.foreground = color.pixel;