Compare commits
No commits in common. "master" and "35633d45672d14bd798c478c45d1a17064701aa9" have entirely different histories.
master
...
35633d4567
|
@ -10,6 +10,3 @@ static const char *colorname[NUMCOLS] = {
|
|||
|
||||
/* treat a cleared input like a wrong password (color) */
|
||||
static const int failonclear = 1;
|
||||
|
||||
/* time in seconds before the monitor shuts down */
|
||||
static const int monitortime = 5;
|
||||
|
|
20
slock.c
20
slock.c
|
@ -15,7 +15,6 @@
|
|||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
#include <X11/extensions/dpms.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
@ -315,7 +314,6 @@ main(int argc, char **argv) {
|
|||
const char *hash;
|
||||
Display *dpy;
|
||||
int s, nlocks, nscreens;
|
||||
CARD16 standby, suspend, off;
|
||||
|
||||
ARGBEGIN {
|
||||
case 'v':
|
||||
|
@ -376,20 +374,6 @@ main(int argc, char **argv) {
|
|||
if (nlocks != nscreens)
|
||||
return 1;
|
||||
|
||||
/* DPMS magic to disable the monitor */
|
||||
if (!DPMSCapable(dpy))
|
||||
die("slock: DPMSCapable failed\n");
|
||||
if (!DPMSEnable(dpy))
|
||||
die("slock: DPMSEnable failed\n");
|
||||
if (!DPMSGetTimeouts(dpy, &standby, &suspend, &off))
|
||||
die("slock: DPMSGetTimeouts failed\n");
|
||||
if (!standby || !suspend || !off)
|
||||
die("slock: at least one DPMS variable is zero\n");
|
||||
if (!DPMSSetTimeouts(dpy, monitortime, monitortime, monitortime))
|
||||
die("slock: DPMSSetTimeouts failed\n");
|
||||
|
||||
XSync(dpy, 0);
|
||||
|
||||
/* run post-lock command */
|
||||
if (argc > 0) {
|
||||
switch (fork()) {
|
||||
|
@ -407,9 +391,5 @@ main(int argc, char **argv) {
|
|||
/* everything is now blank. Wait for the correct password */
|
||||
readpw(dpy, &rr, locks, nscreens, hash);
|
||||
|
||||
/* reset DPMS values to inital ones */
|
||||
DPMSSetTimeouts(dpy, standby, suspend, off);
|
||||
XSync(dpy, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue