[wiki] [sites] Multiple monitor || Zhen Xu

From: <git_AT_suckless.org>
Date: Wed, 05 Oct 2022 05:50:46 +0200

commit c1f732a888fa7b7092de4a3a8e80bb62daeee5db
Author: Zhen Xu <xuzhen165_AT_gmail.com>
Date: Tue Oct 4 23:48:52 2022 -0400

    Multiple monitor
    
    Updated the original patch to cycle through all clients on all monitors
    to respond to urgent flag on a different monitor.
    
    Zhen Xu <xuzhen165_AT_gmail.com>

diff --git a/dwm.suckless.org/patches/focusurgent/dwm-focusurgent-20221004-6.3.diff b/dwm.suckless.org/patches/focusurgent/dwm-focusurgent-20221004-6.3.diff
new file mode 100644
index 00000000..2557f3a0
--- /dev/null
+++ b/dwm.suckless.org/patches/focusurgent/dwm-focusurgent-20221004-6.3.diff
_AT_@ -0,0 +1,55 @@
+Author: Jan Christoph Ebersbach <jceb_AT_e-jc.de>
+URL: http://dwm.suckless.org/patches/focusurgent
+focusurgent selects the next window having the urgent flag regardless of the tag
+it is on. The urgent flag can be artificially set with the following xdotool
+command on any window: xdotool selectwindow -- set_window --urgency 1
+---
+Author: Zhen Xu <xuzhen165_AT_gmail.com>
+Update: adapt to multiple monitors. The original patch was not aware of multiple
+monitors. I tested with two monitors but I don't have access to more monitors.
+
+Index: clean/dwm/config.def.h
+===================================================================
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -60,6 +60,7 @@ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn()
+ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
+ static const char *termcmd[] = { "st", NULL };
+
++#include "focusurgent.c"
+ static Key keys[] = {
+ /* modifier key function argument */
+ { MODKEY, XK_p, spawn, {.v = dmenucmd } },
+_AT_@ -95,6 +96,7 @@ static Key keys[] = {
+ TAGKEYS( XK_8, 7)
+ TAGKEYS( XK_9, 8)
+ { MODKEY|ShiftMask, XK_q, quit, {0} },
++ { MODKEY, XK_u, focusurgent, {0} },
+ };
+
+ /* button definitions */
+Index: clean/dwm/focusurgent.c
+===================================================================
+--- /dev/null
++++ b/focusurgent.c
+_AT_@ -0,0 +1,20 @@
++static void
++focusurgent(const Arg *arg) {
++ Monitor *m;
++ Client *c;
++ int i;
++ for(m=mons; m; m=m->next){
++ for(c=m->clients; c && !c->isurgent; c=c->next);
++ if(c) {
++ unfocus(selmon->sel, 0);
++ selmon = m;
++ for(i=0; i < LENGTH(tags) && !((1 << i) & c->tags); i++);
++ if(i < LENGTH(tags)) {
++ const Arg a = {.ui = 1 << i};
++ view(&a);
++ focus(c);
++ warp(c);
++ }
++ }
++ }
++}
diff --git a/dwm.suckless.org/patches/focusurgent/index.md b/dwm.suckless.org/patches/focusurgent/index.md
index 80687ee6..9d5d932b 100644
--- a/dwm.suckless.org/patches/focusurgent/index.md
+++ b/dwm.suckless.org/patches/focusurgent/index.md
_AT_@ -7,10 +7,17 @@ Description
 * The urgent flag can be artificially set with the following xdotool command on
   any window: `xdotool selectwindow -- set_window --urgency 1`
 
+Changelog
+---------
+2022-10-04:
+* Add support for multiple monitors
+
 Download
 --------
+* [dwm-focusurgent-20221004-6.3.diff](dwm-focusurgent-20221004-6.3.diff)
 * [dwm-focusurgent-20160831-56a31dc.diff](dwm-focusurgent-20160831-56a31dc.diff)
 
 Author
 ------
 * Jan Christoph Ebersbach <jceb_AT_e-jc.de>
+* Zhen Xu <xuzhen165_AT_gmail.com>: multiple monitor
Received on Wed Oct 05 2022 - 05:50:46 CEST

This archive was generated by hypermail 2.3.0 : Wed Oct 05 2022 - 06:01:04 CEST