switchtotag patch to dwm.
This commit is contained in:
parent
7805d7d381
commit
0178a6a766
4 changed files with 89 additions and 21 deletions
|
@ -48,11 +48,11 @@ static const Rule rules[] = {
|
|||
* WM_CLASS(STRING) = instance, class
|
||||
* WM_NAME(STRING) = title
|
||||
*/
|
||||
/* 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, 0, 1, 0, -1 },
|
||||
{ NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
|
||||
/* 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 */
|
||||
{ NULL, "spterm", NULL, SPTAG(0), 1, -1 },
|
||||
{ NULL, "spfm", NULL, SPTAG(1), 1, -1 },
|
||||
{ NULL, "keepassxc", NULL, SPTAG(2), 0, -1 },
|
||||
|
|
|
@ -44,17 +44,16 @@ static const Rule rules[] = {
|
|||
* WM_CLASS(STRING) = instance, class
|
||||
* WM_NAME(STRING) = title
|
||||
*/
|
||||
/* 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 },
|
||||
{ "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 },
|
||||
{ "webex", NULL, NULL, 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 },
|
||||
/* 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 },
|
||||
{ "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 },
|
||||
};
|
||||
|
||||
/* layout(s) */
|
||||
|
|
|
@ -122,6 +122,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, isterminal, noswallow;
|
||||
pid_t pid;
|
||||
Client *next;
|
||||
|
@ -171,6 +172,7 @@ typedef struct {
|
|||
const char *instance;
|
||||
const char *title;
|
||||
unsigned int tags;
|
||||
unsigned int switchtotag;
|
||||
int isfloating;
|
||||
int isterminal;
|
||||
int noswallow;
|
||||
|
@ -378,6 +380,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)
|
||||
|
@ -2315,11 +2322,15 @@ unmanage(Client *c, int destroyed)
|
|||
}
|
||||
free(c);
|
||||
|
||||
if (!s) {
|
||||
arrange(m);
|
||||
focus(NULL);
|
||||
updateclientlist();
|
||||
}
|
||||
if (!s) {
|
||||
arrange(m);
|
||||
if (c->switchtotag) {
|
||||
Arg a = { .ui = c->switchtotag };
|
||||
view(&a);
|
||||
}
|
||||
focus(NULL);
|
||||
updateclientlist();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
58
_suckless/dwm/patches/10-dwm-switchtotag-6.2.diff
Normal file
58
_suckless/dwm/patches/10-dwm-switchtotag-6.2.diff
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue