From e61da07522a060da98fa3a56db3d0360469b26cf Mon Sep 17 00:00:00 2001 From: auric <104602845+ihateamongus@users.noreply.github.com> Date: Mon, 8 Sep 2025 21:19:14 -0500 Subject: organize repository layout --- .../patches/slock-foreground-image-20211210.diff | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 core/slock/patches/slock-foreground-image-20211210.diff (limited to 'core/slock/patches/slock-foreground-image-20211210.diff') diff --git a/core/slock/patches/slock-foreground-image-20211210.diff b/core/slock/patches/slock-foreground-image-20211210.diff new file mode 100644 index 0000000..83d807a --- /dev/null +++ b/core/slock/patches/slock-foreground-image-20211210.diff @@ -0,0 +1,81 @@ +From: Viliam Kováč +Date: Fri, 10 Dec 2021 17:22:00 +Subject: [PATCH] Add a image foreground +diff --git a/config.def.h b/config.def.h +index 9855e21..dfa61d6 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -10,3 +10,10 @@ static const char *colorname[NUMCOLS] = { + + /* treat a cleared input like a wrong password (color) */ + static const int failonclear = 1; ++ ++static const char *imgpath = "img.xpm"; ++static const int imgwidth = 1920; ++static const int imgheight = 1080; ++static const int imgoffsetx = 0; ++static const int imgoffsety = 0; ++static const int showimgonlyatstart = 1; +diff --git a/config.mk b/config.mk +index 74429ae..6145285 100644 +--- a/config.mk ++++ b/config.mk +@@ -12,7 +12,7 @@ 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 ++LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr -lXpm + + # flags + CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H +diff --git a/slock.c b/slock.c +index 5ae738c..b36c347 100644 +--- a/slock.c ++++ b/slock.c +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + #include "arg.h" + #include "util.h" +@@ -124,6 +125,19 @@ gethash(void) + return hash; + } + ++static void ++showimage(Display *dpy, Window win) ++{ ++ XImage *ximage; ++ ++ if (!XpmReadFileToImage (dpy, imgpath, &ximage, NULL, NULL)) { ++ XSelectInput(dpy, win, ButtonPressMask|ExposureMask); ++ XMapWindow(dpy, win); ++ ++ XPutImage(dpy, win, DefaultGC(dpy, 0), ximage, 0, 0, imgoffsetx, imgoffsety, imgwidth, imgheight); ++ } ++} ++ + static void + readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, + const char *hash) +@@ -194,6 +208,8 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, + locks[screen]->win, + locks[screen]->colors[color]); + XClearWindow(dpy, locks[screen]->win); ++ if (showimgonlyatstart != 1) ++ showimage(dpy, locks[screen]->win); + } + oldc = color; + } +@@ -256,6 +272,8 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen) + &color, &color, 0, 0); + XDefineCursor(dpy, lock->win, invisible); + ++ showimage(dpy, lock->win); ++ + /* Try to grab mouse pointer *and* keyboard for 600ms, else fail the lock */ + for (i = 0, ptgrab = kbgrab = -1; i < 6; i++) { + if (ptgrab != GrabSuccess) { -- cgit v1.2.3