Index: Makefile =================================================================== RCS file: /home/pcvs/ports/x11/thinglaunch/Makefile,v retrieving revision 1.10 diff -u -u -r1.10 Makefile --- Makefile 2 Sep 2009 11:50:05 -0000 1.10 +++ Makefile 1 Oct 2009 20:14:35 -0000 @@ -6,9 +6,11 @@ # PORTNAME= thinglaunch -PORTVERSION= 1.8 +PORTVERSION= 2.1 CATEGORIES= x11 -MASTER_SITES= CRITICAL +MASTER_SITES= ${MASTER_SITE_LOCAL}/gahr/ \ + http://people.freebsd.org/~gahr/distfiles/ \ + http://www.gahr.ch/thinglaunch/ MAINTAINER= ehaupt@FreeBSD.org COMMENT= A very fast launcher program for X @@ -16,15 +18,12 @@ USE_XORG= x11 xproto MAKE_JOBS_SAFE= yes -CPPFLAGS= -I${LOCALBASE}/include -lX11 +CFLAGS+= -I${LOCALBASE}/include LDFLAGS= -L${LOCALBASE}/lib +MAKE_ENV+= LDFLAGS="${LDFLAGS}" PLIST_FILES= bin/thinglaunch -do-build: - ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} ${WRKSRC}/${PORTNAME}.c \ - -o ${WRKSRC}/${PORTNAME} - do-install: ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin Index: distinfo =================================================================== RCS file: /home/pcvs/ports/x11/thinglaunch/distinfo,v retrieving revision 1.3 diff -u -u -r1.3 distinfo --- distinfo 2 Sep 2009 11:50:05 -0000 1.3 +++ distinfo 1 Oct 2009 20:19:26 -0000 @@ -1,3 +1,3 @@ -MD5 (thinglaunch-1.8.tar.gz) = 4aec300bba5c2f2b8ad22eab3b3df44a -SHA256 (thinglaunch-1.8.tar.gz) = 675ebfb65aabe5dc620e1594a9f500812d3327e4761e3bd947dc4a474c758fd1 -SIZE (thinglaunch-1.8.tar.gz) = 3303 +MD5 (thinglaunch-2.1.tar.gz) = 027d9ad8189ca91dd88f21a5eb3275a2 +SHA256 (thinglaunch-2.1.tar.gz) = 3aa78793455768d8d52cf50c61d9b995fcf214430972c1bf3a6b489da81faee7 +SIZE (thinglaunch-2.1.tar.gz) = 5500 Index: pkg-descr =================================================================== RCS file: /home/pcvs/ports/x11/thinglaunch/pkg-descr,v retrieving revision 1.1 diff -u -u -r1.1 pkg-descr --- pkg-descr 25 Jul 2005 15:35:52 -0000 1.1 +++ pkg-descr 1 Oct 2009 20:15:15 -0000 @@ -3,8 +3,10 @@ You can bind it to a key in your favorite window manager, and when you want to start a program, just type its name. thinglaunch has a tiny footprint and depends only on Xlib. +Based on the original version by Matt Johnston, this fork is enhanced by +navigation keys and tab-completion. -WWW: http://unix.freshmeat.net/projects/thinglaunch/ +WWW: http://www.gahr.ch/thinglaunch - ehaupt ehaupt@critical.ch Index: files/patch-thinglaunch.c =================================================================== RCS file: files/patch-thinglaunch.c diff -N files/patch-thinglaunch.c --- files/patch-thinglaunch.c 2 Sep 2009 11:50:05 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,111 +0,0 @@ ---- thinglaunch.c.orig 2004-09-20 16:27:56.000000000 +0200 -+++ thinglaunch.c 2009-09-01 22:11:10.000000000 +0200 -@@ -19,10 +19,14 @@ - */ - #include - #include -+#include - #include - #include - #include - #include -+#ifdef __FreeBSD__ -+#include -+#endif - - static void createWindow(); - static void setupGC(); -@@ -50,10 +54,13 @@ - - /* the actual commandline */ - char command[MAXCMD+1]; -+size_t cursor_pos; - - int main(int argc, char ** argv) { - - command[0] = 0x0; -+ cursor_pos = 0; -+ - createWindow(); - - setupGC(); -@@ -209,15 +216,15 @@ - - int font_height; - int textwidth; -- -+ - font_height = font_info->ascent + font_info->descent; -- textwidth = XTextWidth(font_info, command, strlen(command)); -+ textwidth = XTextWidth(font_info, command, cursor_pos); - - XFillRectangle(display, win, rectgc, 0, 0, WINWIDTH, WINHEIGHT); - XDrawRectangle(display, win, gc, 0, 0, WINWIDTH-1, WINHEIGHT-1); - XDrawString(display, win, gc, 2, font_height+2, command, strlen(command)); -- XDrawLine(display, win, gc, 2 + textwidth, font_height + 2, -- 2 + textwidth + 10, font_height+2); -+ XDrawLine(display, win, gc, 2 + textwidth, font_height + 4, -+ 2 + textwidth + 10, font_height+4); - - XFlush(display); - -@@ -229,22 +236,36 @@ - #define KEYBUFLEN 20 - char buffer[KEYBUFLEN+1]; - KeySym key_symbol; -- int len; -+ int len, tmp_pos; - - len = XLookupString(keyevent, buffer, 1, &key_symbol, NULL); - buffer[len] = 0x0; -+ len = strlen(command); - - switch(key_symbol) { -- case 0xff1b: /* this is escape */ -+ case XK_Escape: - exit(0); - break; -- case 0xff08: /* backspace */ -- len = strlen(command); -- if (len > 0) { -- command[len-1] = 0x0; -- } -+ case XK_BackSpace: -+ if (cursor_pos) -+ for (tmp_pos = --cursor_pos; tmp_pos <= len; tmp_pos++) -+ command[tmp_pos] = command[tmp_pos+1]; -+ break; -+ case XK_Left: -+ if (cursor_pos) -+ cursor_pos--; -+ break; -+ case XK_Right: -+ if (cursor_pos < len) -+ cursor_pos++; -+ break; -+ case XK_Home: -+ cursor_pos = 0; -+ break; -+ case XK_End: -+ cursor_pos = len; - break; -- case 0xff0d: /* enter */ -+ case XK_Return: - execcmd(); - break; - default: -@@ -253,10 +274,11 @@ - - /* normal printable chars */ - if (key_symbol >= 0x20 && key_symbol <= 0x7e) { -- len = strlen(command); - if (len < MAXCMD) { -- command[len] = buffer[0]; -- command[len+1] = 0x0; -+ if (cursor_pos != len) -+ for (tmp_pos = len; tmp_pos > cursor_pos; tmp_pos--) -+ command[tmp_pos] = command[tmp_pos-1]; -+ command[cursor_pos++] = buffer[0]; - } - } - redraw();