Commits

Thomas Dahms  committed 220d88b

nametag with colors and accounting for the trailing newline in recent dmenu

  • Participants
  • Parent commits 4450cd9

Comments (0)

Files changed (1)

 # HG changeset patch
-# Parent 0a1dabd9f1a364c65a74ea695413ebbe187ee08d
+# Parent 40bff70c312f8638c8f7b07792234a310cffe8d8
 
-diff -r 0a1dabd9f1a3 config.def.h
---- a/config.def.h	Wed Oct 26 12:16:25 2011 +0100
-+++ b/config.def.h	Thu Oct 27 08:53:49 2011 +0200
+diff -r 40bff70c312f config.def.h
+--- a/config.def.h	Tue Nov 15 20:16:58 2011 +0100
++++ b/config.def.h	Tue Dec 13 19:05:10 2011 +0100
 @@ -14,7 +14,8 @@
  static const Bool topbar            = True;     /* False means bottom bar */
  
  	TAGKEYS(                        XK_1,                      0)
  	TAGKEYS(                        XK_2,                      1)
  	TAGKEYS(                        XK_3,                      2)
-diff -r 0a1dabd9f1a3 config.mk
---- a/config.mk	Wed Oct 26 12:16:25 2011 +0100
-+++ b/config.mk	Thu Oct 27 08:53:49 2011 +0200
+diff -r 40bff70c312f config.mk
+--- a/config.mk	Tue Nov 15 20:16:58 2011 +0100
++++ b/config.mk	Tue Dec 13 19:05:10 2011 +0100
 @@ -19,7 +19,7 @@
  LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${XINERAMALIBS}
  
  #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
  CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
  #LDFLAGS = -g ${LIBS}
-diff -r 0a1dabd9f1a3 dwm.c
---- a/dwm.c	Wed Oct 26 12:16:25 2011 +0100
-+++ b/dwm.c	Thu Oct 27 08:53:49 2011 +0200
-@@ -199,6 +199,7 @@
- static void maprequest(XEvent *e);
+diff -r 40bff70c312f dwm.c
+--- a/dwm.c	Tue Nov 15 20:16:58 2011 +0100
++++ b/dwm.c	Tue Dec 13 19:05:10 2011 +0100
+@@ -202,6 +202,7 @@
  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);
-@@ -1263,6 +1264,25 @@
+@@ -1273,6 +1274,34 @@
  	}
  }
  
 +void
 +nametag(const Arg *arg) {
 +	char *cp, name[MAX_TAGLEN];
++	char command[200];
 +	FILE *fp;
 +	int i;
 +
-+	if(!(fp = (FILE*)popen("echo -n | dmenu", "r")))
++	strcpy(command, "echo -n | dmenu -p 'name tag:' -fn '");
++	strcat(command, font);
++	strcat(command, "' -nb '"); strcat(command, normbgcolor);
++	strcat(command, "' -nf '"); strcat(command, normfgcolor);
++	strcat(command, "' -sb '"); strcat(command, selbgcolor);
++	strcat(command, "' -sf '"); strcat(command, selfgcolor);
++	strcat(command, "' | tr -d '\n'");
++
++	if(!(fp = (FILE*)popen(command, "r")))
 +		fprintf(stderr, "dwm: Could not popen 'echo -n | dmenu'\n");
 +	cp = fgets(name, MAX_TAGLEN, fp);
 +	pclose(fp);