message patch: add xresources compatibility ref. #3

This commit is contained in:
bakkeby 2021-06-08 14:12:46 +02:00
parent d2be9eb632
commit d7b259be34
2 changed files with 15 additions and 12 deletions

View File

@ -17,6 +17,17 @@ static const char *colorname[NUMCOLS] = {
#endif // KEYPRESS_FEEDBACK_PATCH #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 #if XRESOURCES_PATCH
/* /*
* Xresources preferences to load at startup * Xresources preferences to load at startup
@ -31,6 +42,9 @@ ResourcePref resources[] = {
#if PAMAUTH_PATCH #if PAMAUTH_PATCH
{ "color5", STRING, &colorname[PAM] }, { "color5", STRING, &colorname[PAM] },
#endif // PAMAUTH_PATCH #endif // PAMAUTH_PATCH
#if MESSAGE_PATCH || COLOR_MESSAGE_PATCH
{ "color6", STRING, &text_color },
#endif // MESSAGE_PATCH | COLOR_MESSAGE_PATCH
}; };
#endif // XRESOURCES_PATCH #endif // XRESOURCES_PATCH
@ -76,17 +90,6 @@ static const int blocks_y = 0;
static const int blocks_count = 10; static const int blocks_count = 10;
#endif // KEYPRESS_FEEDBACK_PATCH #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 #if PAMAUTH_PATCH
/* PAM service that's used for authentication */ /* PAM service that's used for authentication */
static const char* pam_service = "login"; static const char* pam_service = "login";

View File

@ -38,7 +38,7 @@ writemessage(Display *dpy, Window win, int screen)
tab_size = 8 * XTextWidth(fontinfo, " ", 1); tab_size = 8 * XTextWidth(fontinfo, " ", 1);
XAllocNamedColor(dpy, DefaultColormap(dpy, screen), XAllocNamedColor(dpy, DefaultColormap(dpy, screen),
text_color, &color, &dummy); text_color, &color, &dummy);
gr_values.font = fontinfo->fid; gr_values.font = fontinfo->fid;
gr_values.foreground = color.pixel; gr_values.foreground = color.pixel;