[wiki] [sites] add runorraise || ivoarch

From: <git_AT_suckless.org>
Date: Fri, 17 Jan 2014 11:32:38 +0100

commit 9372006af3b61436af04bf8f37e2aaef43400012
Author: ivoarch <ivkuzev_AT_gmail.com>
Date: Fri Jan 17 11:30:57 2014 +0100

    add runorraise

diff --git a/dwm.suckless.org/patches/dwm-6.1-runorraise.diff b/dwm.suckless.org/patches/dwm-6.1-runorraise.diff
new file mode 100644
index 0000000..d41d93f
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-6.1-runorraise.diff
_AT_@ -0,0 +1,41 @@
+--- dwm.c.orig 2013-11-29 13:58:49.673588564 +0100
++++ dwm.c 2013-11-23 22:56:49.725007370 +0100
+_AT_@ -193,6 +193,7 @@
+ static void resizemouse(const Arg *arg);
+ static void restack(Monitor *m);
+ static void run(void);
++static void runorraise(const Arg *arg);
+ static void scan(void);
+ static Bool sendevent(Client *c, Atom proto);
+ static void sendmon(Client *c, Monitor *m);
+_AT_@ -1349,6 +1350,30 @@
+ }
+
+ void
++runorraise(const Arg *arg) {
++ char *app = ((char **)arg->v)[4];
++ Arg a = { .ui = ~0 };
++ Monitor *mon;
++ Client *c;
++ XClassHint hint = { NULL, NULL };
++ /* Tries to find the client */
++ for (mon = mons; mon; mon = mon->next) {
++ for (c = mon->clients; c; c = c->next) {
++ XGetClassHint(dpy, c->win, &hint);
++ if (hint.res_class && strcmp(app, hint.res_class) == 0) {
++ a.ui = c->tags;
++ view(&a);
++ focus(c);
++ XRaiseWindow(dpy, c->win);
++ return;
++ }
++ }
++ }
++ /* Client not found: spawn it */
++ spawn(arg);
++}
++
++void
+ scan(void) {
+ unsigned int i, num;
+}
diff --git a/dwm.suckless.org/patches/dwm-6.1-runorraise.md b/dwm.suckless.org/patches/dwm-6.1-runorraise.md
new file mode 100644
index 0000000..78c8b0f
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-6.1-runorraise.md
_AT_@ -0,0 +1,35 @@
+runorraise
+==========
+
+Description
+-----------
+This patch adds a equivalent to stumpwm's [run-or-raise] action for DWM.
+
+The idea is to have each frequently-used application one key combination away at all times, irrespective of which workspace it is on,
+or how recently it has been used, or even whether it’s running or not.
+
+Usage
+-----
+
+1. In your config.h:
+
+ static const char *emacs[] = { "emacsclient", "-c", NULL, NULL, "Emacs" };
+ static const char *browser[] = { "firefox", NULL, NULL, NULL, "Firefox" };
+
+1. In your keybindings add something like:
+
+ { Modkey, XK_e, runorraise, {.v = emacs } },
+ { Modkey, XK_f, runorraise, {.v = firefox } },
+
+Download
+--------
+
+* [dwm-6.1-runorraise.diff](dwm-6.1-runorraise.diff)
+
+Authors
+-------
+* Quentin Stievenart (acieroid) - `<quentin.stievenart at gmail dot com>`
+
+Contributors
+------------
+* Ivaylo Kuzev (ivoarch) - `<ivkuzev at gmail dot com>`
Received on Fri Jan 17 2014 - 11:32:38 CET

This archive was generated by hypermail 2.3.0 : Thu Jun 18 2015 - 17:38:08 CEST