sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-stickyrule-6.8.diff (1566B)


      1 From e4342df390ae7873e224fb29e8d9838db1cdb448 Mon Sep 17 00:00:00 2001
      2 From: Vedant Sule <sulevedant@gmail.com>
      3 Date: Fri, 2 Oct 2026 18:25:19 +0100
      4 Subject: [PATCH] Add issticky to rules[] and apply it in applyrules
      5 
      6 ---
      7  config.def.h | 7 ++++---
      8  dwm.c        | 2 ++
      9  2 files changed, 6 insertions(+), 3 deletions(-)
     10 
     11 diff --git a/config.def.h b/config.def.h
     12 index c243414..c856376 100644
     13 --- a/config.def.h
     14 +++ b/config.def.h
     15 @@ -26,9 +26,10 @@ static const Rule rules[] = {
     16  	 *	WM_CLASS(STRING) = instance, class
     17  	 *	WM_NAME(STRING) = title
     18  	 */
     19 -	/* class      instance    title       tags mask     isfloating   monitor */
     20 -	{ "Gimp",     NULL,       NULL,       0,            1,           -1 },
     21 -	{ "Firefox",  NULL,       NULL,       1 << 8,       0,           -1 },
     22 +	/* class      instance    title       tags mask     isfloating	 issticky   monitor */
     23 +	{ "Gimp",     NULL,       NULL,       0,            1,           0,	    -1 },
     24 +	{ "Firefox",  NULL,       NULL,       1 << 8,       0,           0,	    -1 },
     25 +	{ "Dragon",   NULL,	  NULL,	      0,	    0,		 1,	    -1 },
     26  };
     27  
     28  /* layout(s) */
     29 diff --git a/dwm.c b/dwm.c
     30 index a9cf1bf..34207a5 100644
     31 --- a/dwm.c
     32 +++ b/dwm.c
     33 @@ -137,6 +137,7 @@ typedef struct {
     34  	const char *title;
     35  	unsigned int tags;
     36  	int isfloating;
     37 +	int issticky;
     38  	int monitor;
     39  } Rule;
     40  
     41 @@ -300,6 +301,7 @@ applyrules(Client *c)
     42  		{
     43  			c->isfloating = r->isfloating;
     44  			c->tags |= r->tags;
     45 +			setsticky(c, r->issticky);
     46  			for (m = mons; m && m->num != r->monitor; m = m->next);
     47  			if (m)
     48  				c->mon = m;
     49 -- 
     50 2.55.0
     51