sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit d318304c366c0397e2ef4ef6df4e6329f95b1164
parent 3101660beffda3f90436a54fc988fa206592948c
Author: Quentin Rameau <quinq.ml@gmail.com>
Date:   Fri,  7 Feb 2014 16:21:58 +0100

tabbed patches: added "clientnumber" patch

Diffstat:
Atools.suckless.org/tabbed/patches/clientnumber.md | 12++++++++++++
Atools.suckless.org/tabbed/patches/tabbed-0.6-clientnumber.diff | 36++++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/tools.suckless.org/tabbed/patches/clientnumber.md b/tools.suckless.org/tabbed/patches/clientnumber.md @@ -0,0 +1,12 @@ +Client number +======== +With this patch, tabbed prints the position number of the client before the +window title. + +Download +-------- +* [tabbed-0.6-clientnumber.diff](tabbed-0.6-clientnumber.diff) + +Author +------ +* Quentin Rameau <quinq@quinq.eu.org> diff --git a/tools.suckless.org/tabbed/patches/tabbed-0.6-clientnumber.diff b/tools.suckless.org/tabbed/patches/tabbed-0.6-clientnumber.diff @@ -0,0 +1,36 @@ +diff --git a/config.mk b/config.mk +index 5279711..b0c212c 100644 +--- a/config.mk ++++ b/config.mk +@@ -12,7 +12,7 @@ INCS = -I. -I/usr/include + LIBS = -L/usr/lib -lc -lX11 + + # flags +-CPPFLAGS = -DVERSION=\"${VERSION}\" -D_BSD_SOURCE ++CPPFLAGS = -DVERSION=\"${VERSION}\" -D_BSD_SOURCE -D_GNU_SOURCE + CFLAGS = -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} + LDFLAGS = -s ${LIBS} + +diff --git a/tabbed.c b/tabbed.c +index b2adf29..19b5bbb 100644 +--- a/tabbed.c ++++ b/tabbed.c +@@ -308,6 +308,7 @@ drawbar(void) { + unsigned long *col; + int c, fc, width, n = 0; + char *name = NULL; ++ char *tabtitle = NULL; + + if(nclients == 0) { + dc.x = 0; +@@ -353,7 +354,9 @@ drawbar(void) { + } else { + col = dc.norm; + } +- drawtext(clients[c]->name, col); ++ asprintf(&tabtitle, "%d: %s", c + 1, clients[c]->name); ++ drawtext(tabtitle, col); ++ free(tabtitle); + dc.x += dc.w; + clients[c]->tabx = dc.x; + }