parent
133b34f860
commit
831cc05cce
32
config.def.h
32
config.def.h
|
|
@ -1,4 +1,10 @@
|
|||
/* user and group to drop privileges to */
|
||||
/* Treat a cleared input like a wrong password (color) */
|
||||
static const int failonclear = 1;
|
||||
|
||||
/* Time in seconds before the monitor shuts down */
|
||||
static const int monitortime = 5;
|
||||
|
||||
/* User and group to drop privileges to */
|
||||
static const char *user = "nobody";
|
||||
static const char *group = "nogroup";
|
||||
|
||||
|
|
@ -9,9 +15,7 @@ static const char *colorname[NUMCOLS] = {
|
|||
[FAILED] = "#CC3333", /* wrong password */
|
||||
};
|
||||
|
||||
/*
|
||||
* Xresources preferences to load at startup
|
||||
*/
|
||||
/* Xresources preferences to load at startup */
|
||||
ResourcePref resources[] = {
|
||||
{ "normbgcolor", STRING, &colorname[BACKGROUND] },
|
||||
{ "normfgcolor", STRING, &colorname[INIT] },
|
||||
|
|
@ -19,9 +23,13 @@ ResourcePref resources[] = {
|
|||
{ "failfgcolor", STRING, &colorname[FAILED] },
|
||||
};
|
||||
|
||||
/* treat a cleared input like a wrong password (color) */
|
||||
static const int failonclear = 1;
|
||||
/* Configure visual effects */
|
||||
#define BLUR 1
|
||||
#define PIXELATION 0
|
||||
static const int blurRadius = 5;
|
||||
static const int pixelSize = 1;
|
||||
|
||||
/* Configure the logo */
|
||||
static const int logosize = 75;
|
||||
static const int logow = 12; /* Grid width and height for right center alignment*/
|
||||
static const int logoh = 6;
|
||||
|
|
@ -37,15 +45,3 @@ static XRectangle rectangles[9] = {
|
|||
{9, 4, 1, 2},
|
||||
{11,4, 1, 2},
|
||||
};
|
||||
|
||||
/*Enable blur*/
|
||||
#define BLUR
|
||||
/*Set blur radius*/
|
||||
static const int blurRadius=5;
|
||||
/*Enable Pixelation*/
|
||||
//#define PIXELATION
|
||||
/*Set pixelation radius*/
|
||||
static const int pixelSize=0;
|
||||
|
||||
/* time in seconds before the monitor shuts down */
|
||||
static const int monitortime = 5;
|
||||
|
|
|
|||
66
slock.c
66
slock.c
|
|
@ -510,51 +510,49 @@ main(int argc, char **argv) {
|
|||
imlib_context_set_drawable(RootWindow(dpy,XScreenNumberOfScreen(scr)));
|
||||
imlib_copy_drawable_to_image(0,0,0,scr->width,scr->height,0,0,1);
|
||||
|
||||
#ifdef BLUR
|
||||
if (BLUR)
|
||||
/*Blur function*/
|
||||
imlib_image_blur(blurRadius);
|
||||
|
||||
/*Blur function*/
|
||||
imlib_image_blur(blurRadius);
|
||||
#endif // BLUR
|
||||
if (PIXELATION) {
|
||||
/*Pixelation*/
|
||||
int width = scr->width;
|
||||
int height = scr->height;
|
||||
|
||||
#ifdef PIXELATION
|
||||
/*Pixelation*/
|
||||
int width = scr->width;
|
||||
int height = scr->height;
|
||||
|
||||
for(int y = 0; y < height; y += pixelSize)
|
||||
{
|
||||
for(int x = 0; x < width; x += pixelSize)
|
||||
for(int y = 0; y < height; y += pixelSize)
|
||||
{
|
||||
int red = 0;
|
||||
int green = 0;
|
||||
int blue = 0;
|
||||
|
||||
Imlib_Color pixel;
|
||||
Imlib_Color* pp;
|
||||
pp = &pixel;
|
||||
for(int j = 0; j < pixelSize && j < height; j++)
|
||||
for(int x = 0; x < width; x += pixelSize)
|
||||
{
|
||||
for(int i = 0; i < pixelSize && i < width; i++)
|
||||
int red = 0;
|
||||
int green = 0;
|
||||
int blue = 0;
|
||||
|
||||
Imlib_Color pixel;
|
||||
Imlib_Color* pp;
|
||||
pp = &pixel;
|
||||
for(int j = 0; j < pixelSize && j < height; j++)
|
||||
{
|
||||
imlib_image_query_pixel(x+i,y+j,pp);
|
||||
red += pixel.red;
|
||||
green += pixel.green;
|
||||
blue += pixel.blue;
|
||||
for(int i = 0; i < pixelSize && i < width; i++)
|
||||
{
|
||||
imlib_image_query_pixel(x+i,y+j,pp);
|
||||
red += pixel.red;
|
||||
green += pixel.green;
|
||||
blue += pixel.blue;
|
||||
}
|
||||
}
|
||||
red /= (pixelSize*pixelSize);
|
||||
green /= (pixelSize*pixelSize);
|
||||
blue /= (pixelSize*pixelSize);
|
||||
imlib_context_set_color(red,green,blue,pixel.alpha);
|
||||
imlib_image_fill_rectangle(x,y,pixelSize,pixelSize);
|
||||
red = 0;
|
||||
green = 0;
|
||||
blue = 0;
|
||||
}
|
||||
red /= (pixelSize*pixelSize);
|
||||
green /= (pixelSize*pixelSize);
|
||||
blue /= (pixelSize*pixelSize);
|
||||
imlib_context_set_color(red,green,blue,pixel.alpha);
|
||||
imlib_image_fill_rectangle(x,y,pixelSize,pixelSize);
|
||||
red = 0;
|
||||
green = 0;
|
||||
blue = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
config_init(dpy);
|
||||
|
||||
/* check for Xrandr support */
|
||||
|
|
|
|||
Loading…
Reference in New Issue