slock

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit d7b259be346091fad33ce27b155586c8d96bc615
parent d2be9eb63274510155688db4039bb2b20565b1b5
Author: bakkeby <bakkeby@gmail.com>
Date:   Tue,  8 Jun 2021 14:12:46 +0200

message patch: add xresources compatibility ref. #3

Diffstat:
Mconfig.def.h | 25++++++++++++++-----------
Mpatch/colormessage.c | 2+-
2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -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"; diff --git a/patch/colormessage.c b/patch/colormessage.c @@ -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;