aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-06-05 05:30:38 -0400
committerJesse Luehrs <doy@tozt.net>2016-06-05 05:30:38 -0400
commit672aedc1a6495da6123ad70b4cc77dbbedc100a3 (patch)
treeb6c45366717b410c2dc2d07264369b413dda91cb
parentb8196f0244d2a0b7adebe8d35182a071493eddf5 (diff)
downloadrunes-672aedc1a6495da6123ad70b4cc77dbbedc100a3.tar.gz
runes-672aedc1a6495da6123ad70b4cc77dbbedc100a3.zip
allow more easily running a development version alongside a real one
this just changes the window class (so that i can make the development version use floating windows while not screwing up the layout for my real terminals) and the runesd socket location (so that i can test runesd at all while i'm already running a real runesd).
-rw-r--r--Makefile5
-rw-r--r--src/runes.h4
-rw-r--r--src/util.c6
-rw-r--r--src/window-xlib.c9
4 files changed, 16 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 9d67557..be8ab87 100644
--- a/Makefile
+++ b/Makefile
@@ -46,6 +46,9 @@ release: ## Build optimized binaries
$(MAKE) OPT=-O2
strip $(OUT) $(DOUT) $(COUT)
+debug: CFLAGS += -DRUNES_PROGRAM_NAME='"runes-debug"'
+debug: $(OUT) $(DOUT) $(COUT) ## Like 'all', but with a different window class and socket path
+
run: $(OUT) ## Build and run the standalone runes terminal
@./$(OUT)
@@ -79,7 +82,7 @@ clean: ## Remove build files
@rmdir -p $(BUILD) > /dev/null 2>&1 || true
help: ## Display this help
- @grep -HE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":|##"}; {printf "\033[36m%-20s\033[0m %s\n", $$2, $$4}'
+ @grep -HE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":|##"}; {printf "\033[36m%-12s\033[0m %s\n", $$2, $$4}'
-include $(OBJ:$(BUILD)%.o=$(BUILD).%.d)
-include $(DOBJ:$(BUILD)%.o=$(BUILD).%.d)
diff --git a/src/runes.h b/src/runes.h
index fdfca81..cccce81 100644
--- a/src/runes.h
+++ b/src/runes.h
@@ -1,6 +1,10 @@
#ifndef _RUNES_H
#define _RUNES_H
+#ifndef RUNES_PROGRAM_NAME
+#define RUNES_PROGRAM_NAME "runes"
+#endif
+
struct runes_term;
struct runes_window;
struct runes_window_backend;
diff --git a/src/util.c b/src/util.c
index c663710..f9ce286 100644
--- a/src/util.c
+++ b/src/util.c
@@ -36,13 +36,13 @@ char *runes_get_daemon_socket_name()
runtime_dir = getenv("XDG_RUNTIME_DIR");
if (runtime_dir) {
- runes_sprintf_dup(&socket_dir, "%s/runes", runtime_dir);
+ runes_sprintf_dup(&socket_dir, "%s/"RUNES_PROGRAM_NAME, runtime_dir);
}
else {
- runes_sprintf_dup(&socket_dir, "%s/.runes", home);
+ runes_sprintf_dup(&socket_dir, "%s/."RUNES_PROGRAM_NAME, home);
}
- runes_sprintf_dup(&socket_file, "%s/runesd", socket_dir);
+ runes_sprintf_dup(&socket_file, "%s/"RUNES_PROGRAM_NAME"d", socket_dir);
free(socket_dir);
return socket_file;
diff --git a/src/window-xlib.c b/src/window-xlib.c
index be79cbe..99d2c09 100644
--- a/src/window-xlib.c
+++ b/src/window-xlib.c
@@ -145,7 +145,7 @@ void runes_window_create_window(RunesTerm *t, int argc, char *argv[])
{
RunesWindow *w = t->w;
pid_t pid;
- XClassHint class_hints = { "runes", "runes" };
+ XClassHint class_hints = { RUNES_PROGRAM_NAME, RUNES_PROGRAM_NAME };
XWMHints wm_hints;
XSizeHints normal_hints;
double bg_r, bg_g, bg_b;
@@ -203,7 +203,8 @@ void runes_window_create_window(RunesTerm *t, int argc, char *argv[])
w->wb->dpy, w->border_w, w->wb->atoms, RUNES_NUM_PROTOCOL_ATOMS);
Xutf8SetWMProperties(
- w->wb->dpy, w->border_w, "runes", "runes", argv, argc,
+ w->wb->dpy, w->border_w, RUNES_PROGRAM_NAME, RUNES_PROGRAM_NAME,
+ argv, argc,
&normal_hints, &wm_hints, &class_hints);
pid = getpid();
@@ -211,8 +212,8 @@ void runes_window_create_window(RunesTerm *t, int argc, char *argv[])
w->wb->dpy, w->border_w, w->wb->atoms[RUNES_ATOM_NET_WM_PID],
XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&pid, 1);
- runes_window_set_icon_name(t, "runes", 5);
- runes_window_set_window_title(t, "runes", 5);
+ runes_window_set_icon_name(t, RUNES_PROGRAM_NAME, 5);
+ runes_window_set_window_title(t, RUNES_PROGRAM_NAME, 5);
cursor = XCreateFontCursor(w->wb->dpy, XC_xterm);
cairo_pattern_get_rgba(