Update to slock so that it uses systemctl suspend
This commit is contained in:
parent
e4864c25c0
commit
515521eb0d
|
|
@ -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
|
//-bitstream-charter-medium-i-normal--0-0-75-75-p-0-iso8859-1
|
||||||
|
|
||||||
#define SCREENSLEEP
|
#define SCREENSLEEP
|
||||||
|
//#define SCREENSLEEPBACKLIGHT
|
||||||
|
|
||||||
/*Enable blur*/
|
/*Enable blur*/
|
||||||
#define BLUR
|
#define BLUR
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
BIN
explicit_bzero.o
BIN
explicit_bzero.o
Binary file not shown.
8
slock.c
8
slock.c
|
|
@ -262,7 +262,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
|
||||||
|
|
||||||
while (running && !XNextEvent(dpy, &ev)) {
|
while (running && !XNextEvent(dpy, &ev)) {
|
||||||
if (ev.type == KeyPress) {
|
if (ev.type == KeyPress) {
|
||||||
#ifdef SCREENSLEEP
|
#ifdef SCREENSLEEPBACKLIGHT
|
||||||
char* tmpSTR;
|
char* tmpSTR;
|
||||||
if(0 > asprintf(&tmpSTR, "xbacklight -set %f", priorBackLight)) tmpSTR = "xbacklight -set 100";
|
if(0 > asprintf(&tmpSTR, "xbacklight -set %f", priorBackLight)) tmpSTR = "xbacklight -set 100";
|
||||||
system(tmpSTR);
|
system(tmpSTR);
|
||||||
|
|
@ -564,11 +564,15 @@ main(int argc, char **argv) {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SCREENSLEEP
|
#ifdef SCREENSLEEPBACKLIGHT
|
||||||
priorBackLight = getPriorBackLight();
|
priorBackLight = getPriorBackLight();
|
||||||
system("xbacklight -set 0");
|
system("xbacklight -set 0");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SCREENSLEEP
|
||||||
|
system("systemctl suspend");
|
||||||
|
#endif
|
||||||
|
|
||||||
/* check for Xrandr support */
|
/* check for Xrandr support */
|
||||||
rr.active = XRRQueryExtension(dpy, &rr.evbase, &rr.errbase);
|
rr.active = XRRQueryExtension(dpy, &rr.evbase, &rr.errbase);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue