Anonymous avatar Anonymous committed aa84127

add the fancy stuff

Comments (0)

Files changed (5)

+MIT/X Consortium License
+
+© 2010 Evan Gates <evan.gates@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+# pcw - popup chat window
+
+include config.mk
+
+SRC = pcw.c cw.c
+OBJ = ${SRC:.c=.o}
+BIN = ${OBJ:.o=}
+
+all: options ${BIN}
+
+options:
+	@echo pcw build options:
+	@echo "CFLAGS   = ${CFLAGS}"
+	@echo "LDFLAGS  = ${LDFLAGS}"
+	@echo "CC       = ${CC}"
+
+.c.o:
+	@echo CC $<
+	@${CC} -c ${CFLAGS} $<
+
+.o:
+	@echo CC -o $@
+	@${CC} -o $@ $< ${LDFLAGS}
+
+${OBJ}: config.mk
+
+clean:
+	@echo cleaning
+	@rm -f ${BIN} ${OBJ} pcw-${VERSION}.tar.gz
+
+dist: clean
+	@echo creating dist tarball
+	@mkdir -p pcw-${VERSION}
+	@cp -R LICENSE Makefile README config.mk pcw.1 ${SRC} pcw-${VERSION}
+	@tar -cf pcw-${VERSION}.tar pcw-${VERSION}
+	@gzip pcw-${VERSION}.tar
+	@rm -rf pcw-${VERSION}
+
+install: all
+	@echo installing executable files to ${DESTDIR}${PREFIX}/bin
+	@mkdir -p ${DESTDIR}${PREFIX}/bin
+	@for bin in ${BIN}; do cp -f $$bin ${DESTDIR}${PREFIX}/bin/$$bin; done
+	@for bin in ${BIN}; do chmod 755   ${DESTDIR}${PREFIX}/bin/$$bin; done
+	@echo installing manual pages to ${DESTDIR}${MANPREFIX}/man1
+	@mkdir -p ${DESTDIR}${MANPREFIX}/man1
+	@sed "s/VERSION/${VERSION}/g" < pcw.1 > ${DESTDIR}${MANPREFIX}/man1/pcw.1
+	@chmod 644 ${DESTDIR}${MANPREFIX}/man1/pcw.1
+
+uninstall:
+	@echo removing executables from ${DESTDIR}${PREFIX}/bin
+	@for bin in ${BIN}; do rm -f ${DESTDIR}${PREFIX}/bin/$$bin; done
+	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
+	@rm -f ${DESTDIR}${MANPREFIX}/man1/pcw.1
+
+.PHONY: all options clean dist install uninstall
+pcw - popup chat window
+=======================
+cw uses inotify to monitor a file and write changes to stdout as they happen,
+and sends text written on stdin to another file. It's meant for use with pcw
+and ii, but may come in handy elsewhere.
+
+pcw uses inotify to monitor a directory tree (created by ii) and open terminals
+running cw with the in and out files for each channel
+
+Installation
+------------
+Edit config.mk to match your local setup. pcw is installed into
+/usr/local by default.
+
+Afterwards enter the following command to build and install cw 
+(if necessary as root):
+
+    $ make clean install
+
+Running pcw
+-----------
+Simply invoke the 'pcw' command with the required arguments.
+# pcw version
+VERSION = 0.1
+
+# Customize below to fit your system
+
+# paths
+PREFIX = /usr/local
+MANPREFIX = ${PREFIX}/share/man
+
+# includes and libs
+INCS = -I. -I/usr/include
+LIBS = -L/usr/lib -lc
+
+# flags
+# use for BSDs
+CPPFLAGS = -DVERSION=\"${VERSION}\" -D_GNU_SOURCE
+CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
+LDFLAGS = -s ${LIBS}
+
+# compiler and linker
+CC = cc
+.TH PCW 1 pcw-VERSION
+.SH NAME
+pcw \- popup chat window
+
+.SH DESCRIPTION
+.B pcw
+uses inotify to monitor a directory tree (created by ii) and open terminals
+running cw with the in and out files for each channel
+
+.B cw
+uses inotify to monitor a file and write changes to stdout as they happen,
+and sends text written on stdin to another file. It's meant for use with pcw
+and ii, but may come in handy elsewhere.
+.SH SYNOPSIS
+.B pcw
+.RB [ \-t
+.IR terminal ]
+.RB [ \-v ]
+.IR dir
+
+.B cw
+.RB [ \-c|\-f ]
+.RB [ \-q ]
+.RB [ \-v ]
+.IR infile
+.IR outfile
+
+.SH OPTIONS
+.TP
+.IR " dir"
+the root of the directory tree you want to monitor (ii defaults to ~/irc)
+.TP
+.IR " infile"
+the file to monitor for changes and print to stdout
+.TP
+.IR " outfile"
+the file to write user input to
+.TP
+.BI \-t " terminal"
+the terminal program to use (defaults to urxvt)
+.TP
+.BI \-c
+if infile or outfile don't exist create them
+.TP
+.BI \-f
+if infile or outfile don't exist create them as fifos (pcw does this, when a user messages you ii creates the out file but doesn't create the in fifo until you explicitly '/j user msg' so we create the fifo and wait for ii to connect to it when you '/j user msg')
+.TP
+.BI \-q
+quiet, don't print the "opening file" and "new text starts here" messages on stderr
+.TP
+.BI \-v
+prints version information and exits
+
+.SH AUTHORS
+Copyright \(co 2010 by Evan Gates <evan.gates (at) gmail (dot) com>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.