Use xterm from a specific directory instead
This commit is contained in:
parent
bbc67b0ad6
commit
fb5a21f54f
|
@ -24,8 +24,8 @@ terminal_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
|
||||||
terminal: $(terminal_OBJS)
|
terminal: $(terminal_OBJS)
|
||||||
$(CC) -o terminal $(terminal_OBJS) $(terminal_LDFLAGS)
|
$(CC) -o terminal $(terminal_OBJS) $(terminal_LDFLAGS)
|
||||||
|
|
||||||
terminal.o: terminal.c terminal.h
|
terminal.o: terminal.c terminal.h ../config.h
|
||||||
$(CC) $(terminal_CFLAGS) -c terminal.c
|
$(CC) -D PREFIX=\"$(PREFIX)\" $(terminal_CFLAGS) -c terminal.c
|
||||||
|
|
||||||
main.o: main.c terminal.h ../config.h
|
main.o: main.c terminal.h ../config.h
|
||||||
$(CC) $(terminal_CFLAGS) -c main.c
|
$(CC) $(terminal_CFLAGS) -c main.c
|
||||||
|
|
|
@ -10,7 +10,8 @@ sources=terminal.c,main.c
|
||||||
install=$(BINDIR)
|
install=$(BINDIR)
|
||||||
|
|
||||||
[terminal.c]
|
[terminal.c]
|
||||||
depends=terminal.h
|
depends=terminal.h,../config.h
|
||||||
|
cppflags=-D PREFIX=\"$(PREFIX)\"
|
||||||
|
|
||||||
[main.c]
|
[main.c]
|
||||||
depends=terminal.h,../config.h
|
depends=terminal.h,../config.h
|
||||||
|
|
|
@ -23,6 +23,14 @@
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <System.h>
|
#include <System.h>
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
|
#include "../config.h"
|
||||||
|
|
||||||
|
#ifndef PREFIX
|
||||||
|
# define PREFIX "/usr/local"
|
||||||
|
#endif
|
||||||
|
#ifndef BINDIR
|
||||||
|
# define BINDIR PREFIX "/bin"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Terminal */
|
/* Terminal */
|
||||||
|
@ -63,8 +71,9 @@ Terminal * terminal_new(void)
|
||||||
Terminal * terminal;
|
Terminal * terminal;
|
||||||
GtkWidget * vbox;
|
GtkWidget * vbox;
|
||||||
GtkWidget * widget;
|
GtkWidget * widget;
|
||||||
char * argv[] = { "xterm", "-into", NULL, NULL };
|
char * argv[] = { BINDIR "/xterm", "xterm", "-into", NULL, NULL };
|
||||||
char buf[16];
|
char buf[16];
|
||||||
|
int flags = G_SPAWN_FILE_AND_ARGV_ZERO | G_SPAWN_DO_NOT_REAP_CHILD;
|
||||||
GError * error = NULL;
|
GError * error = NULL;
|
||||||
|
|
||||||
if((terminal = object_new(sizeof(*terminal))) == NULL)
|
if((terminal = object_new(sizeof(*terminal))) == NULL)
|
||||||
|
@ -102,13 +111,11 @@ Terminal * terminal_new(void)
|
||||||
/* launch xterm */
|
/* launch xterm */
|
||||||
snprintf(buf, sizeof(buf), "%u", gtk_socket_get_id(
|
snprintf(buf, sizeof(buf), "%u", gtk_socket_get_id(
|
||||||
GTK_SOCKET(terminal->tabs->socket)));
|
GTK_SOCKET(terminal->tabs->socket)));
|
||||||
argv[2] = buf;
|
argv[3] = buf;
|
||||||
if(g_spawn_async(NULL, argv, NULL,
|
if(g_spawn_async(NULL, argv, NULL, flags, NULL, NULL,
|
||||||
G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
|
|
||||||
NULL, NULL,
|
|
||||||
&terminal->tabs->pid, &error) == FALSE)
|
&terminal->tabs->pid, &error) == FALSE)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: %s: %s\n", "Terminal", argv[0],
|
fprintf(stderr, "%s: %s: %s\n", "Terminal", argv[1],
|
||||||
error->message);
|
error->message);
|
||||||
g_error_free(error);
|
g_error_free(error);
|
||||||
terminal_delete(terminal);
|
terminal_delete(terminal);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user