diff --git a/config.def.h b/config.def.h index 3345f1a..5eb17db 100644 --- a/config.def.h +++ b/config.def.h @@ -27,6 +27,7 @@ static const char * font_name = "-b&h-lucidabright-medium-r-normal--20-200-75-75 //-bitstream-charter-medium-i-normal--0-0-75-75-p-0-iso8859-1 #define SCREENSLEEP +//#define SCREENSLEEPBACKLIGHT /*Enable blur*/ #define BLUR diff --git a/config.h b/config.h new file mode 100644 index 0000000..5eb17db --- /dev/null +++ b/config.h @@ -0,0 +1,39 @@ +/* user and group to drop privileges to */ +static const char *user = "adam"; +static const char *group = "adam"; + +static const char *colorname[NUMCOLS] = { + [INIT] = "black", /* after initialization */ + [INPUT] = "#005577", /* during input */ + [FAILED] = "#CC3333", /* wrong password */ +}; + +/* treat a cleared input like a wrong password (color) */ +static const int failonclear = 1; + +/* time in seconds to cancel lock with mouse movement */ +static const int timetocancel = 4; + +/* default message */ +static const char * message = "Input Password:"; + +/* text color */ +static const char * text_color = "#ffffff"; + +/* text size (must be a valid size) */ +static const char * font_name = "-b&h-lucidabright-medium-r-normal--20-200-75-75-p-200-iso8859-1" ; + //-Misc-Fixed-Medium-R-Normal--20-200-75-75-C-100-ISO10646-1 + //-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1 + //-bitstream-charter-medium-i-normal--0-0-75-75-p-0-iso8859-1 + +#define SCREENSLEEP +//#define SCREENSLEEPBACKLIGHT + +/*Enable blur*/ +#define BLUR +/*Set blur radius*/ +static const int blurRadius=10; +/*Enable Pixelation*/ +#define PIXELATION +/*Set pixelation radius*/ +static const int pixelSize=30; diff --git a/explicit_bzero.o b/explicit_bzero.o index 4799a70..4a1f38e 100644 Binary files a/explicit_bzero.o and b/explicit_bzero.o differ diff --git a/slock b/slock new file mode 100755 index 0000000..85a9281 Binary files /dev/null and b/slock differ diff --git a/slock.c b/slock.c index 09eb667..c4833e8 100644 --- a/slock.c +++ b/slock.c @@ -262,7 +262,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, while (running && !XNextEvent(dpy, &ev)) { if (ev.type == KeyPress) { -#ifdef SCREENSLEEP +#ifdef SCREENSLEEPBACKLIGHT char* tmpSTR; if(0 > asprintf(&tmpSTR, "xbacklight -set %f", priorBackLight)) tmpSTR = "xbacklight -set 100"; system(tmpSTR); @@ -564,11 +564,15 @@ main(int argc, char **argv) { #endif -#ifdef SCREENSLEEP +#ifdef SCREENSLEEPBACKLIGHT priorBackLight = getPriorBackLight(); system("xbacklight -set 0"); #endif +#ifdef SCREENSLEEP + system("systemctl suspend"); +#endif + /* check for Xrandr support */ rr.active = XRRQueryExtension(dpy, &rr.evbase, &rr.errbase); diff --git a/slock.o b/slock.o index b81848a..c3a32d5 100644 Binary files a/slock.o and b/slock.o differ