Files
suckless/slock/patches/slock-00-all-patches.diff
T
2026-05-26 09:00:30 +02:00

65 lines
1.9 KiB
Diff

diff --git a/config.def.h b/config.def.h
index 9855e21..defbec5 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1,10 +1,10 @@
/* user and group to drop privileges to */
-static const char *user = "nobody";
-static const char *group = "nogroup";
+static const char *user = "odweta";
+static const char *group = "odweta";
static const char *colorname[NUMCOLS] = {
[INIT] = "black", /* after initialization */
- [INPUT] = "#005577", /* during input */
+ [INPUT] = "#735e97", /* during input */
[FAILED] = "#CC3333", /* wrong password */
};
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..defbec5
--- /dev/null
+++ b/config.h
@@ -0,0 +1,12 @@
+/* user and group to drop privileges to */
+static const char *user = "odweta";
+static const char *group = "odweta";
+
+static const char *colorname[NUMCOLS] = {
+ [INIT] = "black", /* after initialization */
+ [INPUT] = "#735e97", /* during input */
+ [FAILED] = "#CC3333", /* wrong password */
+};
+
+/* treat a cleared input like a wrong password (color) */
+static const int failonclear = 1;
diff --git a/slock/slock.c b/slock/slock.c
index f16781f..f556d34 100644
--- a/slock/slock.c
+++ b/slock/slock.c
@@ -19,6 +19,7 @@
#include <X11/keysym.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
+#include <X11/XF86keysym.h>
#include "arg.h"
#include "util.h"
@@ -158,6 +159,14 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
IsPrivateKeypadKey(ksym))
continue;
switch (ksym) {
+ case XF86XK_AudioMute:
+ case XF86XK_AudioRaiseVolume:
+ case XF86XK_AudioLowerVolume:
+ case XF86XK_AudioMicMute:
+ case XF86XK_MonBrightnessUp:
+ case XF86XK_MonBrightnessDown:
+ XSendEvent(dpy, DefaultRootWindow(dpy), True, KeyPressMask, &ev);
+ break;
case XK_Return:
passwd[len] = '\0';
errno = 0;