about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAcid Bong <acid-bong@cock.lt>2022-10-19 13:25:35 +0300
committerAcid Bong <acid-bong@cock.lt>2022-10-19 13:25:35 +0300
commit5d40708208664e2dca1c9759ddc7dfd1930bf8f1 (patch)
tree28246ddd217aa1a5d87b0331bdedcefcaa7ab1c0
parente9c46c8624e3de1fba021c30bbc42707ef51353c (diff)
downloaddwm-5d40708208664e2dca1c9759ddc7dfd1930bf8f1.tar.gz
personal focusurgent patch
-rw-r--r--patches/7-focusurgent-20160831-56a31dc.diff55
1 files changed, 55 insertions, 0 deletions
diff --git a/patches/7-focusurgent-20160831-56a31dc.diff b/patches/7-focusurgent-20160831-56a31dc.diff
new file mode 100644
index 0000000..23a0858
--- /dev/null
+++ b/patches/7-focusurgent-20160831-56a31dc.diff
@@ -0,0 +1,55 @@
+From e9c46c8624e3de1fba021c30bbc42707ef51353c Mon Sep 17 00:00:00 2001
+From: Acid Bong <acid-bong@cock.lt>
+Date: Wed, 19 Oct 2022 13:23:34 +0300
+Subject: [PATCH] patch: focusurgent
+
+---
+ config.def.h  |  3 +++
+ focusurgent.c | 14 ++++++++++++++
+ 2 files changed, 17 insertions(+)
+ create mode 100644 focusurgent.c
+
+diff --git a/config.def.h b/config.def.h
+index b8f0908..1de3c06 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -59,6 +59,7 @@ static const char *termcmd[]  = { "st", NULL };
+ 
+ #include <X11/XF86keysym.h>
+ #include "movestack.c"
++#include "focusurgent.c"
+ static const Key keys[] = {
+ 	/* modifier                     key        function        argument */
+ 	{ MODKEY,                       XK_space,      spawn,          {.v = dmenucmd } },
+@@ -124,6 +125,8 @@ static const Key keys[] = {
+ 	{ MODKEY|ShiftMask,		XK_k,		movestack,	{.i = -1 } },
+ 	{ MODKEY|ShiftMask,		XK_Down,	movestack,	{.i = +1 } }, /* arrow keys */
+ 	{ MODKEY|ShiftMask,		XK_Up,		movestack,	{.i = -1 } },
++		/* focusurgent patch */
++	{ MODKEY,			XK_a,		focusurgent,	{0} },
+ };
+ 
+ /* button definitions */
+diff --git a/focusurgent.c b/focusurgent.c
+new file mode 100644
+index 0000000..bc6eee6
+--- /dev/null
++++ b/focusurgent.c
+@@ -0,0 +1,14 @@
++static void
++focusurgent(const Arg *arg) {
++	Client *c;
++	int i;
++	for(c=selmon->clients; c && !c->isurgent; c=c->next);
++	if(c) {
++		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);
++		}
++	}
++}
+-- 
+2.38.0
+
ref='#n210'>210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289