aboutsummaryrefslogtreecommitdiffstats
path: root/applied/dwm-switchtotag-6.2.diff
diff options
context:
space:
mode:
authorJoe <bousset.rudy@gmail.com>2022-08-12 12:40:18 +0200
committerJoe <bousset.rudy@gmail.com>2022-08-12 12:40:18 +0200
commitbc0b589fcc3592ab1d7b420a4a47f5a10fa9464c (patch)
treebdff1d887754aa975cc0bcc98787d129234038c8 /applied/dwm-switchtotag-6.2.diff
parentgaps update (diff)
downloaddwm-bc0b589fcc3592ab1d7b420a4a47f5a10fa9464c.tar.gz
dwm-bc0b589fcc3592ab1d7b420a4a47f5a10fa9464c.tar.bz2
dwm-bc0b589fcc3592ab1d7b420a4a47f5a10fa9464c.tar.xz
dwm-bc0b589fcc3592ab1d7b420a4a47f5a10fa9464c.tar.zst
dwm-bc0b589fcc3592ab1d7b420a4a47f5a10fa9464c.zip
update
Diffstat (limited to 'applied/dwm-switchtotag-6.2.diff')
-rw-r--r--applied/dwm-switchtotag-6.2.diff58
1 files changed, 58 insertions, 0 deletions
diff --git a/applied/dwm-switchtotag-6.2.diff b/applied/dwm-switchtotag-6.2.diff
new file mode 100644
index 0000000..453f8ef
--- /dev/null
+++ b/applied/dwm-switchtotag-6.2.diff
@@ -0,0 +1,58 @@
+diff -up dwm-6.2-original/config.def.h dwm-6.2-modified/config.def.h
+--- dwm-6.2-original/config.def.h 2019-02-02 14:55:28.000000000 +0200
++++ dwm-6.2-modified/config.def.h 2019-11-18 19:36:22.515566509 +0200
+@@ -26,9 +26,9 @@ static const Rule rules[] = {
+ * WM_CLASS(STRING) = instance, class
+ * WM_NAME(STRING) = title
+ */
+- /* class instance title tags mask isfloating monitor */
+- { "Gimp", NULL, NULL, 0, 1, -1 },
+- { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
++ /* class instance title tags mask switchtotag isfloating monitor */
++ { "Gimp", NULL, NULL, 0, 0, 1, -1 },
++ { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 },
+ };
+
+ /* layout(s) */
+diff -up dwm-6.2-original/dwm.c dwm-6.2-modified/dwm.c
+--- dwm-6.2-original/dwm.c 2019-02-02 14:55:28.000000000 +0200
++++ dwm-6.2-modified/dwm.c 2019-11-18 19:37:18.792187705 +0200
+@@ -92,6 +92,7 @@ struct Client {
+ int basew, baseh, incw, inch, maxw, maxh, minw, minh;
+ int bw, oldbw;
+ unsigned int tags;
++ unsigned int switchtotag;
+ int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
+ Client *next;
+ Client *snext;
+@@ -137,6 +138,7 @@ typedef struct {
+ const char *instance;
+ const char *title;
+ unsigned int tags;
++ unsigned int switchtotag;
+ int isfloating;
+ int monitor;
+ } Rule;
+@@ -302,6 +304,11 @@ applyrules(Client *c)
+ for (m = mons; m && m->num != r->monitor; m = m->next);
+ if (m)
+ c->mon = m;
++ if (r->switchtotag) {
++ Arg a = { .ui = r->tags };
++ c->switchtotag = selmon->tagset[selmon->seltags];
++ view(&a);
++ }
+ }
+ }
+ if (ch.res_class)
+@@ -1782,6 +1789,10 @@ unmanage(Client *c, int destroyed)
+ focus(NULL);
+ updateclientlist();
+ arrange(m);
++ if (c->switchtotag) {
++ Arg a = { .ui = c->switchtotag };
++ view(&a);
++ }
+ }
+
+ void