summaryrefslogtreecommitdiff
path: root/x11-misc/slock/files
diff options
context:
space:
mode:
authormhsn <mail@mhsn.net>2025-07-19 19:22:58 +0100
committermhsn <mail@mhsn.net>2025-07-19 19:22:58 +0100
commitd85bf3344b4c7cfde883a617dc69d55197e449bd (patch)
tree54fa2e351a8b8f1b80772af5fc6a228a05da5285 /x11-misc/slock/files
parent84b04e9c609fd452402cd688be3adce096520959 (diff)
downloadadelie-d85bf3344b4c7cfde883a617dc69d55197e449bd.tar.gz
adelie-d85bf3344b4c7cfde883a617dc69d55197e449bd.zip
add dmenu and slock
Diffstat (limited to 'x11-misc/slock/files')
-rw-r--r--x11-misc/slock/files/01-slock-fix-link-paths.patch18
-rw-r--r--x11-misc/slock/files/02-slock-dpms-1.4.patch62
-rw-r--r--x11-misc/slock/files/50-colors.patch17
3 files changed, 97 insertions, 0 deletions
diff --git a/x11-misc/slock/files/01-slock-fix-link-paths.patch b/x11-misc/slock/files/01-slock-fix-link-paths.patch
new file mode 100644
index 0000000..503c2e5
--- /dev/null
+++ b/x11-misc/slock/files/01-slock-fix-link-paths.patch
@@ -0,0 +1,18 @@
+From: Sam James <sam@gentoo.org>
+Date: Wed, 30 Jun 2021 06:54:36 +0100
+Subject: [PATCH] Drop unnecessary include, library paths
+
+Closes: https://bugs.gentoo.org/732410
+--- a/config.mk
++++ b/config.mk
+@@ -11,8 +11,8 @@ X11INC = /usr/X11R6/include
+ X11LIB = /usr/X11R6/lib
+
+ # includes and libs
+-INCS = -I. -I/usr/include -I${X11INC}
+-LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr
++INCS = -I. -I${X11INC}
++LIBS = -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr
+
+ # flags
+ CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H
diff --git a/x11-misc/slock/files/02-slock-dpms-1.4.patch b/x11-misc/slock/files/02-slock-dpms-1.4.patch
new file mode 100644
index 0000000..027bbf7
--- /dev/null
+++ b/x11-misc/slock/files/02-slock-dpms-1.4.patch
@@ -0,0 +1,62 @@
+diff --git a/config.def.h b/config.def.h
+index 9855e21..d01bd38 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -10,3 +10,6 @@ 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;
+diff --git a/slock.c b/slock.c
+index d2f0886..f65a43b 100644
+--- a/slock.c
++++ b/slock.c
+@@ -15,6 +15,7 @@
+ #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>
+@@ -306,6 +307,7 @@ main(int argc, char **argv) {
+ const char *hash;
+ Display *dpy;
+ int s, nlocks, nscreens;
++ CARD16 standby, suspend, off;
+
+ ARGBEGIN {
+ case 'v':
+@@ -366,6 +368,20 @@ 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()) {
+@@ -383,5 +399,9 @@ 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;
+ }
diff --git a/x11-misc/slock/files/50-colors.patch b/x11-misc/slock/files/50-colors.patch
new file mode 100644
index 0000000..b9b3509
--- /dev/null
+++ b/x11-misc/slock/files/50-colors.patch
@@ -0,0 +1,17 @@
+diff --git i/config.def.h w/config.def.h
+index 9855e21..5aa29be 100644
+--- i/config.def.h
++++ w/config.def.h
+@@ -3,9 +3,9 @@ static const char *user = "nobody";
+ static const char *group = "nogroup";
+
+ static const char *colorname[NUMCOLS] = {
+- [INIT] = "black", /* after initialization */
+- [INPUT] = "#005577", /* during input */
+- [FAILED] = "#CC3333", /* wrong password */
++ [INIT] = "#152126", /* after initialization */
++ [INPUT] = "#152126", /* during input */
++ [FAILED] = "#682733", /* wrong password */
+ };
+
+ /* treat a cleared input like a wrong password (color) */