Add alpha option to change lock screen opacity

Useful with compton blur effect
master
Khue Doan 2019-06-09 23:20:38 +07:00
parent 69b8f7a252
commit 5e7a95b50f
3 changed files with 10 additions and 0 deletions

View File

@ -8,6 +8,9 @@ static const char *colorname[NUMCOLS] = {
[FAILED] = "#CC3333", /* wrong password */
};
/* lock screen opacity */
static const float alpha = 1;
/* treat a cleared input like a wrong password (color) */
static const int failonclear = 1;

View File

@ -8,6 +8,9 @@ static const char *colorname[NUMCOLS] = {
[FAILED] = "#FF5555", /* wrong password */
};
/* lock screen opacity */
static const float alpha = 1;
/* treat a cleared input like a wrong password (color) */
static const int failonclear = 1;

View File

@ -18,6 +18,7 @@
#include <X11/keysym.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include "arg.h"
#include "util.h"
@ -334,6 +335,9 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen)
XRRSelectInput(dpy, lock->win, RRScreenChangeNotifyMask);
XSelectInput(dpy, lock->root, SubstructureNotifyMask);
unsigned int opacity = (unsigned int)(alpha * 0xffffffff);
XChangeProperty(dpy, lock->win, XInternAtom(dpy, "_NET_WM_WINDOW_OPACITY", False), XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&opacity, 1L);
XSync(dpy, False);
return lock;
}