[wiki] [sites] Add dwm tagfun patch. || dthcm

From: <git_AT_suckless.org>
Date: Wed, 19 Oct 2022 11:42:44 +0200

commit c92c411f147911ec853cf8016ddfb6a64d74df7f
Author: dthcm <dthcm1_AT_gmail.com>
Date: Wed Oct 19 17:39:07 2022 +0800

    Add dwm tagfun patch.

diff --git a/dwm.suckless.org/patches/tagfun/dwm-tagfun-6.4.diff b/dwm.suckless.org/patches/tagfun/dwm-tagfun-6.4.diff
new file mode 100644
index 00000000..e1c063f7
--- /dev/null
+++ b/dwm.suckless.org/patches/tagfun/dwm-tagfun-6.4.diff
_AT_@ -0,0 +1,57 @@
+diff --git a/config.def.h b/config.def.h
+index 061ad66..8edac81 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -59,6 +59,14 @@ static const Layout layouts[] = {
+ static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
+ static const char *termcmd[] = { "st", NULL };
+
++static struct {
++ void (*func)(const Arg *arg);
++ const Arg arg;
++} tagfun_cmds[LENGTH(tags)] = {
++ [0] = { killclient, {0} },
++ [1] = { spawn, { .v = termcmd } },
++};
++
+ static const Key keys[] = {
+ /* modifier key function argument */
+ { MODKEY, XK_p, spawn, {.v = dmenucmd } },
+_AT_@ -108,6 +116,7 @@ static const Button buttons[] = {
+ { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
+ { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
+ { ClkTagBar, 0, Button1, view, {0} },
++ { ClkTagBar, 0, Button2, tagfun, {0} },
+ { ClkTagBar, 0, Button3, toggleview, {0} },
+ { ClkTagBar, MODKEY, Button1, tag, {0} },
+ { ClkTagBar, MODKEY, Button3, toggletag, {0} },
+diff --git a/dwm.c b/dwm.c
+index e5efb6a..79b76cb 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -208,6 +208,7 @@ static void showhide(Client *c);
+ static void sigchld(int unused);
+ static void spawn(const Arg *arg);
+ static void tag(const Arg *arg);
++static void tagfun(const Arg *arg);
+ static void tagmon(const Arg *arg);
+ static void tile(Monitor *m);
+ static void togglebar(const Arg *arg);
+_AT_@ -1658,6 +1659,17 @@ tag(const Arg *arg)
+ }
+ }
+
++void
++tagfun(const Arg *arg)
++{
++ unsigned int i = arg->ui & TAGMASK, j = 0;
++ if (i) {
++ while ( i >>= 1) j++;
++ if (tagfun_cmds[j].func)
++ tagfun_cmds[j].func(&tagfun_cmds[j].arg);
++ }
++}
++
+ void
+ tagmon(const Arg *arg)
+ {
diff --git a/dwm.suckless.org/patches/tagfun/index.md b/dwm.suckless.org/patches/tagfun/index.md
new file mode 100644
index 00000000..bbeeab78
--- /dev/null
+++ b/dwm.suckless.org/patches/tagfun/index.md
_AT_@ -0,0 +1,24 @@
+tagfun
+======
+
+Description
+-----------
+This patch allows you to bind functions to your tags, invoked with mouse middle button.
+
+Recommendations
+---------------
+This patch tries to improve mouse usability. By default, first tag binds to kill current client,
+second tag spawn terminal. Leave the kill client function alone (or bind to else where),
+and add some defaults apps to your tags.
+
+It is recommended to use rofi, combined with launchpad theme, this will provied you
+almost fully functional mouse experience.
+
+Download
+--------
+* [dwm-tagfun-6.4.diff](dwm-tagfun-6.4.diff)
+
+Authors
+-------
+* dthcm - dthcm1_AT_gmail.com
+
Received on Wed Oct 19 2022 - 11:42:44 CEST

This archive was generated by hypermail 2.3.0 : Wed Oct 19 2022 - 11:48:53 CEST