I don't want switchtotag patch.

This commit is contained in:
Bartek Stalewski 2021-10-11 23:33:30 +02:00
parent 362df91d3e
commit 68c606afed
4 changed files with 16 additions and 85 deletions

View File

@ -48,11 +48,11 @@ static const Rule rules[] = {
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask switchtotag isfloating isterminal noswallow monitor */
{ "Gimp", NULL, NULL, 0, 1, 1, 0, 0, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, 0, 0, -1, -1 },
{ "St", NULL, NULL, 0, 0, 1, 0, -1 },
{ NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
/* class instance title tags mask isfloating isterminal noswallow monitor */
{ "Gimp", NULL, NULL, 0, 1, 0, 0, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 },
{ "St", NULL, NULL, 0, 1, 0, -1 },
{ NULL, NULL, "Event Tester", 0, 0, 1, -1 }, /* xev */
{ NULL, "spterm", NULL, SPTAG(0), 1, -1 },
{ NULL, "spfm", NULL, SPTAG(1), 1, -1 },
{ NULL, "keepassxc", NULL, SPTAG(2), 0, -1 },

View File

@ -44,17 +44,17 @@ static const Rule rules[] = {
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask switchtotag isfloating isterminal noswallow monitor */
{ NULL, NULL, "st", 0, 0, 0, 1, 0, -1 },
{ "Firefox", NULL, NULL, 2, 1, 0, 0, 0, -1 },
{ "qutebrowser", NULL, NULL, 2, 1, 0, 0, 0, -1 },
{ "Ferdi" , NULL, NULL, 1 << 2, 1, 0, 0, 0, -1 },
{ NULL, "mutt", NULL, 1 << 3, 1, 0, 1, 1, -1 },
{ NULL, "nnn", NULL, 1 << 4, 1, 0, 1, 1, -1 },
{ NULL, NULL, "Citrix Workspace", 1 << 8, 1, 0, 0, 0, -1 },
{ "Wfica", NULL, NULL, 1 << 9, 1, 0, 0, 0, -1 },
{ NULL, NULL, "Event Tester", 0, 0, 0, 0, 1, -1 }, /* xev */
{ NULL, "spterm", NULL, SPTAG(0), 0, 1, 1, 0, -1 },
/* class instance title tags mask isfloating isterminal noswallow monitor */
{ NULL, NULL, "st", 0, 0, 1, 0, -1 },
{ "Firefox", NULL, NULL, 2, 0, 0, 0, -1 },
{ "qutebrowser", NULL, NULL, 2, 0, 0, 0, -1 },
{ "Ferdi" , NULL, NULL, 1 << 2, 0, 0, 0, -1 },
{ NULL, "mutt", NULL, 1 << 3, 0, 1, 1, -1 },
{ NULL, "nnn", NULL, 1 << 4, 0, 1, 1, -1 },
{ NULL, NULL, "Citrix Workspace", 1 << 8, 0, 0, 0, -1 },
{ "Wfica", NULL, NULL, 1 << 9, 0, 0, 0, -1 },
{ NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
{ NULL, "spterm", NULL, SPTAG(0), 1, 1, 0, -1 },
};
/* layout(s) */

View File

@ -122,7 +122,6 @@ 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, isterminal, noswallow;
pid_t pid;
Client *next;
@ -172,7 +171,6 @@ typedef struct {
const char *instance;
const char *title;
unsigned int tags;
unsigned int switchtotag;
int isfloating;
int isterminal;
int noswallow;
@ -380,11 +378,6 @@ 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)
@ -2324,10 +2317,6 @@ unmanage(Client *c, int destroyed)
if (!s) {
arrange(m);
if (c->switchtotag) {
Arg a = { .ui = c->switchtotag };
view(&a);
}
focus(NULL);
updateclientlist();
}

View File

@ -1,58 +0,0 @@
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