[wiki] [sites] [slock][patch][multi-image] Remove some rather embarrassing debug code || Drew Marino

From: <git_AT_suckless.org>
Date: Tue, 05 Dec 2023 22:41:30 +0100

commit 5a4c7671460295a25d8610903b693bf56400b70b
Author: Drew Marino <drewmarino25_AT_gmail.com>
Date: Tue Dec 5 16:08:08 2023 -0500

    [slock][patch][multi-image] Remove some rather embarrassing debug code
    
    This is a modification and not an additional patch for all the obvious reasons.

diff --git a/tools.suckless.org/slock/patches/multi-image/slock-multi-image-1.5.diff b/tools.suckless.org/slock/patches/multi-image/slock-multi-image-1.5.diff
index c41e65dc..58b68d77 100644
--- a/tools.suckless.org/slock/patches/multi-image/slock-multi-image-1.5.diff
+++ b/tools.suckless.org/slock/patches/multi-image/slock-multi-image-1.5.diff
_AT_@ -1,4 +1,4 @@
-From 5ca6bef53a42cdfac1b95a90d8d0e6a5f8a81a99 Mon Sep 17 00:00:00 2001
+From cc85ae2c548660f7ccbcd244dbcfb52420160973 Mon Sep 17 00:00:00 2001
 From: Drew Marino <drewmarino25_AT_gmail.com>
 Date: Sat, 2 Dec 2023 02:30:59 -0500
 Subject: [PATCH] Allow for per-status images instead of colors
_AT_@ -6,8 +6,8 @@ Subject: [PATCH] Allow for per-status images instead of colors
 ---
  config.def.h | 3 +-
  config.mk | 2 +-
- slock.c | 81 +++++++++++++++++++++++++++++++++++++++++++++-------
- 3 files changed, 73 insertions(+), 13 deletions(-)
+ slock.c | 78 ++++++++++++++++++++++++++++++++++++++++++++--------
+ 3 files changed, 70 insertions(+), 13 deletions(-)
 
 diff --git a/config.def.h b/config.def.h
 index 9855e21..ee79df9 100644
_AT_@ -37,7 +37,7 @@ index 514c236..db0641c 100644
  # flags
  CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H
 diff --git a/slock.c b/slock.c
-index b2f14e3..ce225a3 100644
+index b2f14e3..a0378df 100644
 --- a/slock.c
 +++ b/slock.c
 _AT_@ -18,6 +18,7 @@
_AT_@ -84,7 +84,7 @@ index b2f14e3..ce225a3 100644
  
          if (dpy == NULL || screen < 0 || !(lock = malloc(sizeof(struct lock))))
                  return NULL;
-_AT_@ -235,15 +242,51 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen)
+_AT_@ -235,15 +242,48 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen)
          lock->screen = screen;
          lock->root = RootWindow(dpy, lock->screen);
  
_AT_@ -106,8 +106,6 @@ index b2f14e3..ce225a3 100644
 + DisplayWidth(dpy, lock->screen),
 + DisplayHeight(dpy, lock->screen),
 + DefaultDepth(dpy, lock->screen));
-+ if (images[i] == NULL)
-+ die("fuck my LIFE: %s
", colorname[i]);
 + imlib_context_set_image(images[i]);
 + img_width = imlib_image_get_width();
 + img_height = imlib_image_get_height();
_AT_@ -123,7 +121,6 @@ index b2f14e3..ce225a3 100644
 + monitors[j].y,
 + monitors[j].width,
 + monitors[j].height);
-+ imlib_context_set_image(image);
 + imlib_context_set_drawable(lock->colors[i]);
 + imlib_render_image_on_drawable(0, 0);
 + imlib_free_image();
_AT_@ -140,7 +137,7 @@ index b2f14e3..ce225a3 100644
          lock->win = XCreateWindow(dpy, lock->root, 0, 0,
                                    DisplayWidth(dpy, lock->screen),
                                    DisplayHeight(dpy, lock->screen),
-_AT_@ -313,7 +356,8 @@ main(int argc, char **argv) {
+_AT_@ -313,7 +353,8 @@ main(int argc, char **argv) {
          gid_t dgid;
          const char *hash;
          Display *dpy;
_AT_@ -150,7 +147,7 @@ index b2f14e3..ce225a3 100644
  
          ARGBEGIN {
          case 'v':
-_AT_@ -347,6 +391,14 @@ main(int argc, char **argv) {
+_AT_@ -347,6 +388,14 @@ main(int argc, char **argv) {
          if (!(dpy = XOpenDisplay(NULL)))
                  die("slock: cannot open display
");
  
_AT_@ -165,7 +162,7 @@ index b2f14e3..ce225a3 100644
          /* drop privileges */
          if (setgroups(0, NULL) < 0)
                  die("slock: setgroups: %s
", strerror(errno));
-_AT_@ -363,7 +415,7 @@ main(int argc, char **argv) {
+_AT_@ -363,7 +412,7 @@ main(int argc, char **argv) {
          if (!(locks = calloc(nscreens, sizeof(struct lock *))))
                  die("slock: out of memory
");
          for (nlocks = 0, s = 0; s < nscreens; s++) {
_AT_@ -174,7 +171,7 @@ index b2f14e3..ce225a3 100644
                          nlocks++;
                  else
                          break;
-_AT_@ -374,6 +426,13 @@ main(int argc, char **argv) {
+_AT_@ -374,6 +423,13 @@ main(int argc, char **argv) {
          if (nlocks != nscreens)
                  return 1;
  
Received on Tue Dec 05 2023 - 22:41:30 CET

This archive was generated by hypermail 2.3.0 : Tue Dec 05 2023 - 22:48:47 CET