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