Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ad511590d5 | ||
|
35633d4567 | ||
|
2d2a21a90a | ||
|
325581b935 | ||
|
0ff0d9f7a7 | ||
|
7a604ec1fa |
2
README
2
README
@@ -1,6 +1,6 @@
|
||||
slock - simple screen locker
|
||||
============================
|
||||
simple screen locker utility for X.
|
||||
simple screen locker utility for X.
|
||||
|
||||
|
||||
Requirements
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* user and group to drop privileges to */
|
||||
static const char *user = "nobody";
|
||||
static const char *group = "nogroup";
|
||||
static const char *user = "krrish";
|
||||
static const char *group = "krrish";
|
||||
|
||||
static const char *colorname[NUMCOLS] = {
|
||||
[INIT] = "black", /* after initialization */
|
||||
|
12
config.h
Normal file
12
config.h
Normal file
@@ -0,0 +1,12 @@
|
||||
/* user and group to drop privileges to */
|
||||
static const char *user = "krrish";
|
||||
static const char *group = "krrish";
|
||||
|
||||
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;
|
18
slock.c
18
slock.c
@@ -177,7 +177,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
|
||||
break;
|
||||
case XK_BackSpace:
|
||||
if (len)
|
||||
passwd[len--] = '\0';
|
||||
passwd[--len] = '\0';
|
||||
break;
|
||||
default:
|
||||
if (num && !iscntrl((int)buf[0]) &&
|
||||
@@ -201,13 +201,21 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
|
||||
rre = (XRRScreenChangeNotifyEvent*)&ev;
|
||||
for (screen = 0; screen < nscreens; screen++) {
|
||||
if (locks[screen]->win == rre->window) {
|
||||
XResizeWindow(dpy, locks[screen]->win,
|
||||
rre->width, rre->height);
|
||||
if (rre->rotation == RR_Rotate_90 ||
|
||||
rre->rotation == RR_Rotate_270)
|
||||
XResizeWindow(dpy, locks[screen]->win,
|
||||
rre->height, rre->width);
|
||||
else
|
||||
XResizeWindow(dpy, locks[screen]->win,
|
||||
rre->width, rre->height);
|
||||
XClearWindow(dpy, locks[screen]->win);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else for (screen = 0; screen < nscreens; screen++)
|
||||
XRaiseWindow(dpy, locks[screen]->win);
|
||||
} else {
|
||||
for (screen = 0; screen < nscreens; screen++)
|
||||
XRaiseWindow(dpy, locks[screen]->win);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user