dwm-viewonrulestag-20220407-bece862.diff (1350B)
1 From 635ae9efbff2ce9d6749e17908320d44582084cd Mon Sep 17 00:00:00 2001 2 From: opseter <opseter@outlook.com> 3 Date: Thu, 7 Apr 2022 17:45:58 +0800 4 Subject: [PATCH] view on rules defined tag 5 6 --- 7 config.def.h | 1 + 8 dwm.c | 6 ++++++ 9 2 files changed, 7 insertions(+) 10 11 diff --git a/config.def.h b/config.def.h 12 index a2ac963..d077654 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..2392d2f 100644 25 --- a/dwm.c 26 +++ b/dwm.c 27 @@ -300,6 +300,12 @@ applyrules(Client *c) 28 { 29 c->isfloating = r->isfloating; 30 c->tags |= r->tags; 31 + if(viewonrulestag) 32 + { 33 + Arg a = {.ui = r->tags}; 34 + view(&a); 35 + } 36 + 37 for (m = mons; m && m->num != r->monitor; m = m->next); 38 if (m) 39 c->mon = m; 40 -- 41 2.35.1 42