Created
June 9, 2011 13:10
-
-
Save chrismetcalf/1016699 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -up dwm-5.8.2/config.def.h dwm-5.8.2-patched/config.def.h | |
--- dwm-5.8.2/config.def.h 2010-06-04 06:39:15.000000000 -0400 | |
+++ dwm-5.8.2-patched/config.def.h 2011-06-07 14:12:55.000000000 -0400 | |
@@ -14,7 +14,8 @@ static const Bool showbar = Tr | |
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[] = { | |
/* class instance title tags mask isfloating monitor */ | |
@@ -71,6 +72,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) | |
Only in dwm-5.8.2-patched: config.h | |
diff -up dwm-5.8.2/dwm.1 dwm-5.8.2-patched/dwm.1 | |
--- dwm-5.8.2/dwm.1 2010-06-04 06:39:15.000000000 -0400 | |
+++ dwm-5.8.2-patched/dwm.1 2011-06-07 14:12:55.000000000 -0400 | |
@@ -128,6 +128,9 @@ View all windows with any tag. | |
.B Mod1\-Control\-[1..n] | |
Add/remove all windows with nth tag to/from the view. | |
.TP | |
+.B Mod1\-n | |
+Rename the current tag | |
+.TP | |
.B Mod1\-Shift\-q | |
Quit dwm. | |
.SS Mouse commands | |
diff -up dwm-5.8.2/dwm.c dwm-5.8.2-patched/dwm.c | |
--- dwm-5.8.2/dwm.c 2010-06-04 06:39:15.000000000 -0400 | |
+++ dwm-5.8.2-patched/dwm.c 2011-06-07 14:31:04.000000000 -0400 | |
@@ -198,6 +198,7 @@ static void mappingnotify(XEvent *e); | |
static void maprequest(XEvent *e); | |
static void monocle(Monitor *m); | |
static void movemouse(const Arg *arg); | |
+static void nametag(const Arg *arg); | |
static Client *nexttiled(Client *c); | |
static Monitor *ptrtomon(int x, int y); | |
static void propertynotify(XEvent *e); | |
@@ -1247,6 +1248,27 @@ movemouse(const Arg *arg) { | |
} | |
} | |
+void | |
+nametag(const Arg *arg) { | |
+ char *cp, name[MAX_TAGLEN]; | |
+ FILE *fp; | |
+ int i; | |
+ | |
+ if(!(fp = (FILE*)popen("echo -n | dmenu", "r"))) | |
+ fprintf(stderr, "dwm: Could not popen 'echo -n | dmenu'\n"); | |
+ cp = fgets(name, MAX_TAGLEN, fp); | |
+ pclose(fp); | |
+ if(cp == NULL) | |
+ return; | |
+ | |
+ for(i = 0; i < LENGTH(tags); i++) | |
+ if(selmon->tagset[selmon->seltags] & (1 << i)){ | |
+ sprintf(name, "%s[%d]", name, i + 1); | |
+ memcpy(tags[i], name, MAX_TAGLEN); | |
+ } | |
+ drawbars(); | |
+} | |
+ | |
Client * | |
nexttiled(Client *c) { | |
for(; c && (c->isfloating || !ISVISIBLE(c)); c = c->next); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment