dwm-focusurgent-20221004-6.3.diff - sites - public wiki contents of suckless.org | |
git clone git://git.suckless.org/sites | |
Log | |
Files | |
Refs | |
--- | |
dwm-focusurgent-20221004-6.3.diff (2066B) | |
--- | |
1 Author: Jan Christoph Ebersbach <[email protected]> | |
2 URL: http://dwm.suckless.org/patches/focusurgent | |
3 focusurgent selects the next window having the urgent flag regardless of… | |
4 it is on. The urgent flag can be artificially set with the following xd… | |
5 command on any window: xdotool selectwindow -- set_window --urgency 1 | |
6 --- | |
7 Author: Zhen Xu <[email protected]> | |
8 Update: adapt to multiple monitors. The original patch was not aware of … | |
9 monitors. I tested with two monitors but I don't have access to more mon… | |
10 | |
11 Index: clean/dwm/config.def.h | |
12 =================================================================== | |
13 --- a/config.def.h | |
14 +++ b/config.def.h | |
15 @@ -60,6 +60,7 @@ static char dmenumon[2] = "0"; /* component of dmenucm… | |
16 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", d… | |
17 static const char *termcmd[] = { "st", NULL }; | |
18 | |
19 +#include "focusurgent.c" | |
20 static Key keys[] = { | |
21 /* modifier key function argu… | |
22 { MODKEY, XK_p, spawn, {.v … | |
23 @@ -95,6 +96,7 @@ static Key keys[] = { | |
24 TAGKEYS( XK_8, 7) | |
25 TAGKEYS( XK_9, 8) | |
26 { MODKEY|ShiftMask, XK_q, quit, {0} … | |
27 + { MODKEY, XK_u, focusurgent, {0} … | |
28 }; | |
29 | |
30 /* button definitions */ | |
31 Index: clean/dwm/focusurgent.c | |
32 =================================================================== | |
33 --- /dev/null | |
34 +++ b/focusurgent.c | |
35 @@ -0,0 +1,20 @@ | |
36 +static void | |
37 +focusurgent(const Arg *arg) { | |
38 + Monitor *m; | |
39 + Client *c; | |
40 + int i; | |
41 + for(m=mons; m; m=m->next){ | |
42 + for(c=m->clients; c && !c->isurgent; c=c->next); | |
43 + if(c) { | |
44 + unfocus(selmon->sel, 0); | |
45 + selmon = m; | |
46 + for(i=0; i < LENGTH(tags) && !((1 << i) & c->ta… | |
47 + if(i < LENGTH(tags)) { | |
48 + const Arg a = {.ui = 1 << i}; | |
49 + view(&a); | |
50 + focus(c); | |
51 + warp(c); | |
52 + } | |
53 + } | |
54 + } | |
55 +} |