From 635ae9efbff2ce9d6749e17908320d44582084cd Mon Sep 17 00:00:00 2001 From: opseter Date: Thu, 7 Apr 2022 17:45:58 +0800 Subject: [PATCH] view on rules defined tag --- config.def.h | 1 + dwm.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/config.def.h b/config.def.h index a2ac963..d077654 100644 --- a/config.def.h +++ b/config.def.h @@ -5,6 +5,7 @@ static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int snap = 32; /* snap pixel */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ +static const int viewonrulestag = 1; /* 1 means when open applications view will move to tags defined in rules*/ static const char *fonts[] = { "monospace:size=10" }; static const char dmenufont[] = "monospace:size=10"; static const char col_gray1[] = "#222222"; diff --git a/dwm.c b/dwm.c index 5f16260..2392d2f 100644 --- a/dwm.c +++ b/dwm.c @@ -300,6 +300,12 @@ applyrules(Client *c) { c->isfloating = r->isfloating; c->tags |= r->tags; + if(viewonrulestag) + { + Arg a = {.ui = r->tags}; + view(&a); + } + for (m = mons; m && m->num != r->monitor; m = m->next); if (m) c->mon = m; -- 2.35.1