[wiki] [sites] add 6.1 nametag patch, update nametag page || Evan Gates

From: <git_AT_suckless.org>
Date: Wed, 02 Oct 2013 22:34:30 +0200

commit 44a15ee6543d1b7ee6a96371e2093c19657cc4a6
Author: Evan Gates <evan.gates_AT_gmail.com>
Date: Wed Oct 2 13:34:10 2013 -0700

    add 6.1 nametag patch, update nametag page

diff --git a/dwm.suckless.org/patches/dwm-6.1-nametag.diff b/dwm.suckless.org/patches/dwm-6.1-nametag.diff
new file mode 100644
index 0000000..6c0500f
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-6.1-nametag.diff
_AT_@ -0,0 +1,67 @@
+diff --git a/config.def.h b/config.def.h
+index 875885b..aa24cc8 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -14,7 +14,8 @@ static const Bool showbar = True; /* False means no bar */
+ static const Bool topbar = True; /* False means bottom bar */
+
+ /* tagging */
+-static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
++#define MAX_TAGLEN 16
++static char tags[][MAX_TAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+
+ static const Rule rules[] = {
+ /* xprop(1):
+_AT_@ -79,6 +80,7 @@ static Key keys[] = {
+ { MODKEY, XK_period, focusmon, {.i = +1 } },
+ { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
+ { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
++ { MODKEY, XK_n, nametag, {0} },
+ TAGKEYS( XK_1, 0)
+ TAGKEYS( XK_2, 1)
+ TAGKEYS( XK_3, 2)
+diff --git a/dwm.c b/dwm.c
+index 1bbb4b3..4f1f349 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -183,6 +183,7 @@ static void maprequest(XEvent *e);
+ static void monocle(Monitor *m);
+ static void motionnotify(XEvent *e);
+ static void movemouse(const Arg *arg);
++static void nametag(const Arg *arg);
+ static Client *nexttiled(Client *c);
+ static void pop(Client *);
+ static void propertynotify(XEvent *e);
+_AT_@ -1174,6 +1175,32 @@ movemouse(const Arg *arg) {
+ }
+ }
+
++void
++nametag(const Arg *arg) {
++ char *p, name[MAX_TAGLEN];
++ FILE *f;
++ int i;
++
++ errno = 0; // popen(3p) says on failure it "may" set errno
++ if(!(f = popen("dmenu < /dev/null", "r"))) {
++ fprintf(stderr, "dwm: popen 'dmenu < /dev/null' failed%s%s
", errno ? ": " : "", errno ? strerror(errno) : "");
++ return;
++ }
++ if (!(p = fgets(name, MAX_TAGLEN, f)) && (i = errno) && ferror(f))
++ fprintf(stderr, "dwm: fgets failed: %s
", strerror(i));
++ if (pclose(f) < 0)
++ fprintf(stderr, "dwm: pclose failed: %s
", strerror(errno));
++ if(!p)
++ return;
++ if((p = strchr(name, '
')))
++ *p = '
Received on Wed Oct 02 2013 - 22:34:30 CEST

This archive was generated by hypermail 2.3.0 : Thu Jun 18 2015 - 17:37:47 CEST