sites

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

dwm-viewonrulestag-20220410-bece862.diff (1295B)


      1 From 749e118a78fa884af5bd766c714f91cac995f257 Mon Sep 17 00:00:00 2001
      2 From: opseter <opseter@outlook.com>
      3 Date: Sat, 9 Apr 2022 11:28:56 +0800
      4 Subject: [PATCH] v2
      5 
      6 ---
      7  config.def.h | 1 +
      8  dwm.c        | 5 +++++
      9  2 files changed, 6 insertions(+)
     10 
     11 diff --git a/config.def.h b/config.def.h
     12 index a2ac963..a2fc692 100644
     13 --- a/config.def.h
     14 +++ b/config.def.h
     15 @@ -5,6 +5,7 @@ static const unsigned int borderpx  = 1;        /* border pixel of windows */
     16  static const unsigned int snap      = 32;       /* snap pixel */
     17  static const int showbar            = 1;        /* 0 means no bar */
     18  static const int topbar             = 1;        /* 0 means bottom bar */
     19 +static const int viewonrulestag 	= 1;		 /* 1 means when open applications view will move to tags defined in rules*/
     20  static const char *fonts[]          = { "monospace:size=10" };
     21  static const char dmenufont[]       = "monospace:size=10";
     22  static const char col_gray1[]       = "#222222";
     23 diff --git a/dwm.c b/dwm.c
     24 index 5f16260..afab263 100644
     25 --- a/dwm.c
     26 +++ b/dwm.c
     27 @@ -310,6 +310,11 @@ applyrules(Client *c)
     28  	if (ch.res_name)
     29  		XFree(ch.res_name);
     30  	c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
     31 +	if(viewonrulestag)
     32 +	{
     33 +		Arg a = {.ui = c->tags};
     34 +		view(&a);
     35 +	}
     36  }
     37  
     38  int
     39 -- 
     40 2.35.1
     41