aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--config.def.h (renamed from config.h)11
-rw-r--r--st.c6
3 files changed, 13 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 2fb13ae..5267411 100644
--- a/Makefile
+++ b/Makefile
@@ -8,12 +8,15 @@ OBJ = ${SRC:.c=.o}
8 8
9all: options st 9all: options st
10 10
11options: 11options: options
12 @echo st build options: 12 @echo st build options:
13 @echo "CFLAGS = ${CFLAGS}" 13 @echo "CFLAGS = ${CFLAGS}"
14 @echo "LDFLAGS = ${LDFLAGS}" 14 @echo "LDFLAGS = ${LDFLAGS}"
15 @echo "CC = ${CC}" 15 @echo "CC = ${CC}"
16 16
17config.h:
18 cp config.def.h config.h
19
17.c.o: 20.c.o:
18 @echo CC $< 21 @echo CC $<
19 @${CC} -c ${CFLAGS} $< 22 @${CC} -c ${CFLAGS} $<
diff --git a/config.h b/config.def.h
index 8c37b16..9506bc6 100644
--- a/config.h
+++ b/config.def.h
@@ -3,6 +3,7 @@
3#define FONT "6x13" 3#define FONT "6x13"
4#define BOLDFONT "6x13bold" 4#define BOLDFONT "6x13bold"
5#define BORDER 2 5#define BORDER 2
6#define SHELL "/bin/sh"
6 7
7/* Terminal colors */ 8/* Terminal colors */
8static const char *colorname[] = { 9static const char *colorname[] = {
@@ -33,11 +34,11 @@ static const char *colorname[] = {
33/* special keys */ 34/* special keys */
34static Key key[] = { 35static Key key[] = {
35 { XK_BackSpace, "\177" }, 36 { XK_BackSpace, "\177" },
36 { XK_Delete, "\033[3~" }, 37 { XK_Delete, "\033[3~" },
37 { XK_Home, "\033[1~" }, 38 { XK_Home, "\033[1~" },
38 { XK_End, "\033[4~" }, 39 { XK_End, "\033[4~" },
39 { XK_Prior, "\033[5~" }, 40 { XK_Prior, "\033[5~" },
40 { XK_Next, "\033[6~" }, 41 { XK_Next, "\033[6~" },
41 { XK_F1, "\033OP" }, 42 { XK_F1, "\033OP" },
42 { XK_F2, "\033OQ" }, 43 { XK_F2, "\033OQ" },
43 { XK_F3, "\033OR" }, 44 { XK_F3, "\033OR" },
diff --git a/st.c b/st.c
index 864dfc7..0b21404 100644
--- a/st.c
+++ b/st.c
@@ -213,10 +213,10 @@ static inline int selected(int x, int y) {
213 if ((seley==y && selby==y)) { 213 if ((seley==y && selby==y)) {
214 int bx = MIN(selbx, selex); 214 int bx = MIN(selbx, selex);
215 int ex = MAX(selbx, selex); 215 int ex = MAX(selbx, selex);
216 return if(x>=bx && x<=ex) 216 return (x>=bx && x<=ex);
217 } 217 }
218 return (((y>sb[1] && y<se[1]) || (y==se[1] && x<=se[0])) || \ 218 return (((y>sb[1] && y<se[1]) || (y==se[1] && x<=se[0])) || \
219 (y==sb[1] && x>=sb[0] && (x<=se[0] || sb[1]!=se[1]))) 219 (y==sb[1] && x>=sb[0] && (x<=se[0] || sb[1]!=se[1])));
220} 220}
221 221
222static void getbuttoninfo(XEvent *e, int *b, int *x, int *y) { 222static void getbuttoninfo(XEvent *e, int *b, int *x, int *y) {
@@ -331,7 +331,7 @@ die(const char *errstr, ...) {
331void 331void
332execsh(void) { 332execsh(void) {
333 char *args[3] = {getenv("SHELL"), "-i", NULL}; 333 char *args[3] = {getenv("SHELL"), "-i", NULL};
334 DEFAULT(args[0], "/bin/sh"); /* if getenv() failed */ 334 DEFAULT(args[0], SHELL); /* if getenv() failed */
335 putenv("TERM=" TNAME); 335 putenv("TERM=" TNAME);
336 execvp(args[0], args); 336 execvp(args[0], args);
337} 337}