Introduction
Introduction Statistics Contact Development Disclaimer Help
Option to not show failure color on clear - slock - simple X display locker uti…
git clone git://git.suckless.org/slock
Log
Files
Refs
README
LICENSE
---
commit b1289f30b79c9c5ea43a9e9c624406d7d0661692
parent f5ef1b8eb5555da11e81d92d8d05acd4aba1ef40
Author: Nick Currier <[email protected]>
Date: Wed, 6 May 2015 10:18:50 -0600
Option to not show failure color on clear
Diffstat:
M config.def.h | 1 +
M slock.c | 9 ++++++---
2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/config.def.h b/config.def.h
@@ -3,3 +3,4 @@ static const char *colorname[NUMCOLS] = {
"#005577", /* during input */
"#CC3333", /* failed/cleared the input */
};
+static const Bool failonclear = True;
diff --git a/slock.c b/slock.c
@@ -26,7 +26,7 @@
enum {
INIT,
INPUT,
- EMPTY,
+ FAILED,
NUMCOLS
};
@@ -42,6 +42,7 @@ typedef struct {
static Lock **locks;
static int nscreens;
static Bool running = True;
+static Bool failure = False;
static Bool rr;
static int rrevbase;
static int rrerrbase;
@@ -153,8 +154,10 @@ readpw(Display *dpy, const char *pws)
#else
running = !!strcmp(crypt(passwd, pws), pws);
#endif
- if (running)
+ if (running) {
XBell(dpy, 100);
+ failure = True;
+ }
len = 0;
break;
case XK_Escape:
@@ -178,7 +181,7 @@ readpw(Display *dpy, const char *pws)
}
} else if (llen != 0 && len == 0) {
for (screen = 0; screen < nscreens; screen++) {
- XSetWindowBackground(dpy, locks[screen…
+ XSetWindowBackground(dpy, locks[screen…
XClearWindow(dpy, locks[screen]->win);
}
}
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.