1. Evan Gates
  2. pcw


Evan Gates  committed 468111c

move command to config.h, use a #define because I don't know how else to do it with those variables...

  • Participants
  • Parent commits 9c22727
  • Branches default

Comments (0)

Files changed (3)

File Makefile

View file
  • Ignore whitespace
 	@echo CC -o $@
 	@${CC} -o $@ $< ${LDFLAGS}
-${OBJ}: config.mk
+${OBJ}: config.h config.mk
+	@echo creating $@ from config.def.h
+	@cp config.def.h $@
 	@echo cleaning

File config.def.h

View file
  • Ignore whitespace
+ * This defines the command to run when you join a new channel or a new message comes in.
+ * Use paths[wd] for the path to the channel's directory, channel for the channel name
+ * (actually it's "name> " so it can be used as a prompt for srw), out for the out file
+ * and in for the in fifo. If you want to do something more complicated, write a script to
+ * put in your path and execute. For example, I replace cw with a script that calls cw but
+ * pipes the output through sed for colors and bell on my nick so urxvt sets the urgent hint.
+ */
+#define CMD { "urxvt", "-title", paths[wd], "-e", "srw", "-p", channel, "cw", out, in, NULL }

File pcw.c

View file
  • Ignore whitespace
 #include <sys/inotify.h>
 #include <sys/wait.h>
+#include "config.h"
 // fairly arbitray values...feel free to change
 #define PATH_MAX    1024
 #define CMD_MAX     1024
 void win(int wd)
 	char out[PATH_MAX], in[PATH_MAX], path[PATH_MAX], channel[32];
-	char *cmd[] = { "urxvt", "-title", paths[wd], "-e", "srw", "-p", channel, "cw", out, in, NULL};
+	char *cmd[] = CMD;
 	if (wins[wd])