[wiki] [sites] [dwm][patch][colorschemes] Edit patch || Listeria monocytogenes

From: <git_AT_suckless.org>
Date: Mon, 23 Dec 2024 22:02:41 +0100

commit d6331f8b0eae114fcd436f13d8291b9f8bac6fe0
Author: Listeria monocytogenes <listeria_AT_disroot.org>
Date: Mon Dec 23 17:59:39 2024 -0300

    [dwm][patch][colorschemes] Edit patch
    
    fix window border colors not updating

diff --git a/dwm.suckless.org/patches/colorschemes/dwm-colorschemes-6.5.diff b/dwm.suckless.org/patches/colorschemes/dwm-colorschemes-6.5.diff
index f3b6658f..85a0f55c 100644
--- a/dwm.suckless.org/patches/colorschemes/dwm-colorschemes-6.5.diff
+++ b/dwm.suckless.org/patches/colorschemes/dwm-colorschemes-6.5.diff
_AT_@ -1,12 +1,12 @@
-From a9dc99543fe07801587ed1b412cd97b5da01474f Mon Sep 17 00:00:00 2001
+From d067cd3815e35c8c5b804893a551d24fa7505e4b Mon Sep 17 00:00:00 2001
 From: Listeria monocytogenes <listeria_AT_disroot.org>
 Date: Wed, 26 Jun 2024 11:49:20 -0300
 Subject: [PATCH] add setscheme() to cycle between colorschemes
 
 ---
  config.def.h | 15 +++++++++++----
- dwm.c | 37 ++++++++++++++++++++++++++++---------
- 2 files changed, 39 insertions(+), 13 deletions(-)
+ dwm.c | 49 ++++++++++++++++++++++++++++++++++++++++---------
+ 2 files changed, 51 insertions(+), 13 deletions(-)
 
 diff --git a/config.def.h b/config.def.h
 index 9efa774..f87f707 100644
_AT_@ -42,7 +42,7 @@ index 9efa774..f87f707 100644
          TAGKEYS( XK_2, 1)
          TAGKEYS( XK_3, 2)
 diff --git a/dwm.c b/dwm.c
-index f1d86b2..1ac8e05 100644
+index f1d86b2..9c00a09 100644
 --- a/dwm.c
 +++ b/dwm.c
 _AT_@ -59,7 +59,7 @@
_AT_@ -84,14 +84,22 @@ index f1d86b2..1ac8e05 100644
          XDestroyWindow(dpy, wmcheckwin);
          drw_free(drw);
          XSync(dpy, False);
-_AT_@ -1536,10 +1537,25 @@ setmfact(const Arg *arg)
+_AT_@ -1536,10 +1537,37 @@ setmfact(const Arg *arg)
          arrange(selmon);
  }
  
 +void
 +setscheme(const Arg *arg)
 +{
-+ ptrdiff_t si = (scheme - schemes) + arg->i * SchemeN;
++ ptrdiff_t si;
++ Monitor *m;
++ Client *c;
++
++ /* select default color scheme */
++ if (!arg || arg->i == 0)
++ si = 0;
++ else
++ si = (scheme - schemes) + arg->i * SchemeN;
 +
 + /* wrap around, won't work if (abs(arg->i) > LENGTH(colors)) */
 + if (si < 0)
_AT_@ -100,7 +108,11 @@ index f1d86b2..1ac8e05 100644
 + si -= LENGTH(colors) * SchemeN;
 +
 + scheme = &schemes[si];
++
 + drawbars();
++ for (m = mons; m; m = m->next)
++ for (c = m->clients; c; c = c->next)
++ XSetWindowBorder(dpy, c->win, scheme[c == selmon->sel ? SchemeSel : SchemeNorm][ColBorder].pixel);
 +}
 +
  void
_AT_@ -111,7 +123,7 @@ index f1d86b2..1ac8e05 100644
          XSetWindowAttributes wa;
          Atom utf8string;
          struct sigaction sa;
-_AT_@ -1584,9 +1600,12 @@ setup(void)
+_AT_@ -1584,9 +1612,12 @@ setup(void)
          cursor[CurResize] = drw_cur_create(drw, XC_sizing);
          cursor[CurMove] = drw_cur_create(drw, XC_fleur);
          /* init appearance */
_AT_@ -128,5 +140,5 @@ index f1d86b2..1ac8e05 100644
          updatebars();
          updatestatus();
 --
-2.45.2
+2.47.1
 
diff --git a/dwm.suckless.org/patches/colorschemes/index.md b/dwm.suckless.org/patches/colorschemes/index.md
index 477ed9db..9c5f84d7 100644
--- a/dwm.suckless.org/patches/colorschemes/index.md
+++ b/dwm.suckless.org/patches/colorschemes/index.md
_AT_@ -16,8 +16,9 @@ Default keybindings
 
 Download
 --------
-* [dwm-colorschemes-6.5.diff](dwm-colorschemes-6.5.diff) (2024-06-26)
+* [dwm-colorschemes-6.5.diff](dwm-colorschemes-6.5.diff) (2024-12-23)
 
 Authors
 -------
 * Listeria monocytogenes <listeria_AT_disroot.org>
+* Dhruv Trivedi
Received on Mon Dec 23 2024 - 22:02:41 CET

This archive was generated by hypermail 2.3.0 : Mon Dec 23 2024 - 22:12:56 CET