[wiki] [sites] ftheader.h is in /usr/include, not /usr/local/include for debian || Thuban

From: <git_AT_suckless.org>
Date: Fri, 14 Jun 2013 08:27:34 +0200

commit edcddc1df7cc31fd3c2db0c96e976fb10aa16bab
Author: Thuban <thuban_AT_singularity.fr>
Date: Fri Jun 14 08:27:30 2013 +0200

    ftheader.h is in /usr/include, not /usr/local/include for debian

diff --git a/tools.suckless.org/dmenu/patches/dmenu-4.5-xft-debian.diff b/tools.suckless.org/dmenu/patches/dmenu-4.5-xft-debian.diff
new file mode 100644
index 0000000..ff93337
--- /dev/null
+++ b/tools.suckless.org/dmenu/patches/dmenu-4.5-xft-debian.diff
_AT_@ -0,0 +1,418 @@
+diff -upr a/config.mk b/config.mk
+--- a/config.mk 2012-01-10 19:03:22.000000000 +0200
++++ b/config.mk 2012-01-10 19:03:38.000000000 +0200
+_AT_@ -12,9 +12,13 @@ X11LIB = /usr/X11R6/lib
+ XINERAMALIBS = -lXinerama
+ XINERAMAFLAGS = -DXINERAMA
+
++# Xft, comment if you don't want it
++XFTINC = -I/usr/include/freetype2
++XFTLIBS = -lXft -lXrender -lfreetype -lz -lfontconfig
++
+ # includes and libs
+-INCS = -I${X11INC}
+-LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS}
++INCS = -I${X11INC} ${XFTINC}
++LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${XFTLIBS}
+
+ # flags
+ CPPFLAGS = -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
+diff -upr a/dmenu.1 b/dmenu.1
+--- a/dmenu.1 2012-01-10 19:14:19.000000000 +0200
++++ b/dmenu.1 2012-01-10 19:14:23.000000000 +0200
+_AT_@ -53,7 +53,7 @@ dmenu lists items vertically, with the g
+ defines the prompt to be displayed to the left of the input field.
+ .TP
+ .BI \-fn " font"
+-defines the font or font set used.
++defines the font or font set used. eg. "fixed" or "Monospace-12:normal" (an xft font)
+ .TP
+ .BI \-nb " color"
+ defines the normal background color.
+diff -upr a/dmenu.c b/dmenu.c
+--- a/dmenu.c 2012-01-10 19:14:19.000000000 +0200
++++ b/dmenu.c 2012-01-10 19:24:39.000000000 +0200
+_AT_@ -17,6 +17,7 @@
+ * MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org)))
+ #define MIN(a,b) ((a) < (b) ? (a) : (b))
+ #define MAX(a,b) ((a) > (b) ? (a) : (b))
++#define DEFFONT "fixed" /* xft example: "Monospace-11" */
+
+ typedef struct Item Item;
+ struct Item {
+_AT_@ -26,6 +27,7 @@ struct Item {
+
+ static void appenditem(Item *item, Item **list, Item **last);
+ static void calcoffsets(void);
++static void cleanup(void);
+ static char *cistrstr(const char *s, const char *sub);
+ static void drawmenu(void);
+ static void grabkeyboard(void);
+_AT_@ -50,10 +52,12 @@ static const char *normfgcolor = "#bbbbb
+ static const char *selbgcolor = "#005577";
+ static const char *selfgcolor = "#eeeeee";
+ static unsigned int lines = 0;
+-static unsigned long normcol[ColLast];
+-static unsigned long selcol[ColLast];
++static ColorSet *normcol;
++static ColorSet *selcol;
+ static Atom clip, utf8;
+ static Bool topbar = True;
++static Bool running = True;
++static int ret = 0;
+ static DC *dc;
+ static Item *items = NULL;
+ static Item *matches, *matchend;
+_AT_@ -104,7 +108,9 @@ main(int argc, char *argv[]) {
+ usage();
+
+ dc = initdc();
+- initfont(dc, font);
++ initfont(dc, font ? font : DEFFONT);
++ normcol = initcolor(dc, normfgcolor, normbgcolor);
++ selcol = initcolor(dc, selfgcolor, selbgcolor);
+
+ if(fast) {
+ grabkeyboard();
+_AT_@ -117,7 +123,8 @@ main(int argc, char *argv[]) {
+ setup();
+ run();
+
+- return 1; /* unreachable */
++ cleanup();
++ return ret;
+ }
+
+ void
+_AT_@ -160,6 +167,15 @@ cistrstr(const char *s, const char *sub)
+ }
+
+ void
++cleanup(void) {
++ freecol(dc, normcol);
++ freecol(dc, selcol);
++ XDestroyWindow(dc->dpy, win);
++ XUngrabKeyboard(dc->dpy, CurrentTime);
++ freedc(dc);
++}
++
++void
+ drawmenu(void) {
+ int curpos;
+ Item *item;
+_AT_@ -167,7 +183,7 @@ drawmenu(void) {
+ dc->x = 0;
+ dc->y = 0;
+ dc->h = bh;
+- drawrect(dc, 0, 0, mw, mh, True, BG(dc, normcol));
++ drawrect(dc, 0, 0, mw, mh, True, normcol->BG);
+
+ if(prompt) {
+ dc->w = promptw;
+_AT_@ -178,7 +194,7 @@ drawmenu(void) {
+ dc->w = (lines > 0 || !matches) ? mw - dc->x : inputw;
+ drawtext(dc, text, normcol);
+ if((curpos = textnw(dc, text, cursor) + dc->h/2 - 2) < dc->w)
+- drawrect(dc, curpos, 2, 1, dc->h - 4, True, FG(dc, normcol));
++ drawrect(dc, curpos, 2, 1, dc->h - 4, True, normcol->FG);
+
+ if(lines > 0) {
+ /* draw vertical list */
+_AT_@ -321,7 +337,8 @@ keypress(XKeyEvent *ev) {
+ sel = matchend;
+ break;
+ case XK_Escape:
+- exit(EXIT_FAILURE);
++ ret = EXIT_FAILURE;
++ running = False;
+ case XK_Home:
+ if(sel == matches) {
+ cursor = 0;
+_AT_@ -359,7 +376,8 @@ keypress(XKeyEvent *ev) {
+ case XK_Return:
+ case XK_KP_Enter:
+ puts((sel && !(ev->state & ShiftMask)) ? sel->text : text);
+- exit(EXIT_SUCCESS);
++ ret = EXIT_SUCCESS;
++ running = False;
+ case XK_Right:
+ if(text[cursor] != '
Received on Fri Jun 14 2013 - 08:27:34 CEST

This archive was generated by hypermail 2.3.0 : Fri Jun 14 2013 - 08:36:15 CEST