diff --git a/config.def.h b/config.def.h index 3d37dca..d7c11a1 100644 --- a/config.def.h +++ b/config.def.h @@ -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; diff --git a/config.h b/config.h index 234315f..a25075d 100644 --- a/config.h +++ b/config.h @@ -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; diff --git a/slock.c b/slock.c index 968fbf1..4b8e12e 100644 --- a/slock.c +++ b/slock.c @@ -18,6 +18,7 @@ #include #include #include +#include #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; }