Index: bian/changelog
===================================================================
--- debian/changelog	(revision 7cf3a465c72c2c72d74a3df48b5f6e8e378cfb54)
+++ 	(revision )
@@ -1,28 +1,0 @@
-gutenbach-client (1.01-1) unstable; urgency=low
-
-  * Make package no longer Debian native.
-
- -- Jessica Hamrick <jhamrick@mit.edu>  Sat, 26 Jun 2010 19:20:08 -0400
-
-gutenbach-client (1.01) unstable; urgency=low
-
-  * Fix debhelper compatibility to 5 (for backwards compatibility)
-
- -- Jessica Hamrick <jhamrick@mit.edu>  Sat, 26 Jun 2010 18:01:02 -0400
-
-gutenbach-client (1.0) unstable; urgency=low
-
-  * Initial package build
-  * gbq - show queue
-  * gbr - queue file
-  * gbrm - remove file
-  * gutenbach-client-config - add, list, or delete queues
-
- -- Jessica Hamrick <jhamrick@mit.edu>  Sat, 26 Jun 2010 16:56:28 -0400
-
-gutenbach-client (0.01) unstable; urgency=low
-
-  * Created skeleton package.
-
- -- Jessica Hamrick <jhamrick@mit.edu>  Sat, 19 Jun 2010 00:23:53 -0400
-
Index: bian/compat
===================================================================
--- debian/compat	(revision 7cf3a465c72c2c72d74a3df48b5f6e8e378cfb54)
+++ 	(revision )
@@ -1,1 +1,0 @@
-5
Index: bian/control
===================================================================
--- debian/control	(revision 7cf3a465c72c2c72d74a3df48b5f6e8e378cfb54)
+++ 	(revision )
@@ -1,13 +1,0 @@
-Source: gutenbach-client
-Section: sound
-Priority: extra
-Maintainer: Jessica Hamrick <jhamrick@mit.edu>
-Build-Depends: cdbs, debhelper (>= 5)
-Standards-Version: 3.8.4
-
-Package: gutenbach-client
-Architecture: all
-Pre-Depends: debconf
-Depends: ${shlibs:Depends}, ${misc:Depends}, cups, libnet-cups-perl
-Description: Client-side helper scripts for interacting with
- the Gutenbach music player.
Index: bian/copyright
===================================================================
--- debian/copyright	(revision 7cf3a465c72c2c72d74a3df48b5f6e8e378cfb54)
+++ 	(revision )
@@ -1,1 +1,0 @@
-Copyright 2009 Jessica Hamrick
Index: bian/rules
===================================================================
--- debian/rules	(revision 7cf3a465c72c2c72d74a3df48b5f6e8e378cfb54)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#!/usr/bin/make -f
-
-DEB_MAKE_INSTALL_TARGET=install DESTDIR=$(DEB_DESTDIR)
-
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/makefile.mk
Index: bian/source/format
===================================================================
--- debian/source/format	(revision 7cf3a465c72c2c72d74a3df48b5f6e8e378cfb54)
+++ 	(revision )
@@ -1,1 +1,0 @@
-1.0
Index: tenbach-client/Makefile
===================================================================
--- gutenbach-client/Makefile	(revision 0deef9e258fce28cac566b226c4b623057566190)
+++ 	(revision )
@@ -1,5 +1,0 @@
-all:
-
-install:
-	mkdir -p $(DESTDIR)/usr/bin/
-	install -m 755 bin/* $(DESTDIR)/usr/bin/
Index: tenbach-client/bin/gbq
===================================================================
--- gutenbach-client/bin/gbq	(revision 0deef9e258fce28cac566b226c4b623057566190)
+++ 	(revision )
@@ -1,54 +1,0 @@
-#!/usr/bin/perl
-
-# Written by Jessica Hamrick (C) 2010
-
-use strict;
-use warnings;
-
-use Net::CUPS;
-use Net::CUPS::Destination;
-
-my $usage = "Usage: gbq QUEUE\n";
-
-my $q = $ARGV[0];
-
-if (!$q) {
-    print $usage;
-    exit 1
-}
-
-my $configpath = "$ENV{'HOME'}/.gutenbach/$q";
-if (! -e $configpath) {
-    print "Queue '$q' does not exist!\n";
-    exit 1;
-}
-
-my ($host, $queue);
-
-if (-r $configpath) {
-    local $/;
-    my $fh;
-    open $fh, $configpath;
-    eval <$fh>;
-}
-
-my $cups = Net::CUPS->new();
-$cups->setServer("$host");
-my $printer = $cups->getDestination("$queue");
-
-print "Queue listing for queue '$queue' on '$host'\n\n";
-print "Job ID\t\tOwner\t\tFile\n";
-print "-----------------------------------------------------------------\n";
-
-my @jobs = $printer->getJobs(0, 0);
-my ($job_ref, $jobid);
-
-foreach $jobid(@jobs) 
-{       
-	$job_ref = $printer->getJob($jobid);
-	my $id = $job_ref->{'id'};
-	my $user = $job_ref->{'user'};
-	my $title = $job_ref->{'title'};
-
-	print "$id\t\t$user\t\t$title\n";
-}
Index: tenbach-client/bin/gbr
===================================================================
--- gutenbach-client/bin/gbr	(revision 0deef9e258fce28cac566b226c4b623057566190)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#!/usr/bin/perl
-
-# Written by Jessica Hamrick (C) 2010
-
-use strict;
-use warnings;
-
-my $usage = "Usage: gbr QUEUE FILE\n";
-
-my $q = $ARGV[0];
-my $file = $ARGV[1];
-
-if (!$q or !$file) {
-    print $usage;
-    exit 1
-}
-
-my $configpath = "$ENV{'HOME'}/.gutenbach/$q";
-if (! -e $configpath) {
-    print "Queue '$q' does not exist!\n";
-    exit 1;
-}
-
-my ($host, $queue);
-
-if (-r $configpath) {
-    local $/;
-    my $fh;
-    open $fh, $configpath;
-    eval <$fh>;
-}
-
-my @args = ("lp", "-h$host", "-d$queue", "$file");
-exec (@args) or die "Couldn't execute lp command";
Index: tenbach-client/bin/gbrm
===================================================================
--- gutenbach-client/bin/gbrm	(revision 0deef9e258fce28cac566b226c4b623057566190)
+++ 	(revision )
@@ -1,41 +1,0 @@
-#!/usr/bin/perl
-
-# Written by Jessica Hamrick (C) 2010
-
-use strict;
-use warnings;
-
-my $usage = "Usage: gbq QUEUE ID\n";
-
-my $q = $ARGV[0];
-my $id = $ARGV[1];
-
-if (!$q or !$id) {
-    print $usage;
-    exit 1
-}
-
-my $configpath = "$ENV{'HOME'}/.gutenbach/$q";
-if (! -e $configpath) {
-    print "Queue '$q' does not exist!\n";
-    exit 1;
-}
-
-my ($host, $queue);
-
-if (-r $configpath) {
-    local $/;
-    my $fh;
-    open $fh, $configpath;
-    eval <$fh>;
-}
-
-my @args;
-
-if ($id eq "all") {
-    @args = ("cancel", "-a", "-h$host", "$queue");
-}
-else {
-    @args = ("cancel", "-h$host", "$id", "$queue");
-}
-exec (@args) or die "Couldn't execute cancel command";
Index: tenbach-client/bin/gutenbach-client-config
===================================================================
--- gutenbach-client/bin/gutenbach-client-config	(revision 0deef9e258fce28cac566b226c4b623057566190)
+++ 	(revision )
@@ -1,84 +1,0 @@
-#!/usr/bin/perl
-
-# Written by Jessica Hamrick, (C) 2010
-
-use strict;
-use warnings;
-use Getopt::Long;
-
-my $usage = 
-    "Usage: gutenbach-client-config [-l|--list|-a|--add|-d|--delete] [QUEUE] [--host=HOST]\n" .
-    "\n" .
-    "\t-l, --list\t\tList available queues\n" .
-    "\t-a, --add QUEUE\t\tAdd a queue (must be used with -h)\n" .
-    "\t-d, --delete QUEUE\tDelete a queue)\n" .
-    "\t-h, --host HOST\t\tHostname for the queue\n";
-
-my $list = 0;
-my $add = "";
-my $delete = "";
-my $host = "";
-
-GetOptions ('l|list' => \$list,
-            'a|add=s' => \$add,
-            'd|delete=s' => \$delete,
-	    'h|host=s' => \$host);
-
-my $configpath = "$ENV{'HOME'}/.gutenbach";
-
-if (! -e $configpath) {
-    mkdir "$configpath";
-}
-
-# list the existing queues
-if ($list and !$add and !$delete) {
-    my @queues = glob("$configpath/*") or die "Couldn't find configuration files at '$configpath'";
-
-    print "Queue\t\tHost\n";
-    foreach my $q (@queues) {
-	my ($host, $queue);
-
-	if (-r $q) {
-	    local $/;
-	    my $fh;
-	    open $fh, $q;
-	    eval <$fh>;
-	}
-
-	print "$queue\t\t$host\n";
-    }
-}
-
-# add a new queue
-elsif (!$list and $add and !$delete) {
-    if (!$host) {
-	print $usage;
-	exit 1;
-    }
-
-    if (-e "$configpath/$add") {
-	print "Warning: queue '$add' already exists\n";
-    }
-
-    open CONFIG, "> $configpath/$add" or die "Couldn't open config file '$configpath/$add'";
-    print CONFIG "\$host = \"$host\";\n";
-    print CONFIG "\$queue = \"$add\";\n";
-    close CONFIG;
-
-    print "Added queue '$add' on host '$host'\n"
-}
-
-# delete an existing queue
-elsif (!$list and !$add and $delete) {
-    if (! -e "$configpath/$delete") {
-	print "Error: queue '$delete' already exists\n";
-	exit 1;
-    }
-
-    unlink("$configpath/$delete") or die "Couldn't remove config file '$configpath/$delete'";
-}
-
-else {
-    print $usage;
-    exit 1;
-}
Index: gutenbach-queue/INSTALL
===================================================================
--- gutenbach-queue/INSTALL	(revision 0b5842cb91e5f716eb284a3cd00ce573a6c693fc)
+++ gutenbach-queue/INSTALL	(revision 0b5842cb91e5f716eb284a3cd00ce573a6c693fc)
@@ -0,0 +1,5 @@
+Written by Jessica Hamrick (jhamrick).  Copyright 2009.
+
+1) build-gutenbach-queue, view-gutenbach-queue, kill-gutenbach-queue, and queue go in /usr/lib/sipbmp3/
+2) gutenbach-queue goes in /etc/init.d
+3) do `ln -s /usr/lib/sipbmp3/view-gutenbach-queue /usr/bin/view-gutenbach-queue`
Index: gutenbach-queue/build-gutenbach-queue
===================================================================
--- gutenbach-queue/build-gutenbach-queue	(revision 0b5842cb91e5f716eb284a3cd00ce573a6c693fc)
+++ gutenbach-queue/build-gutenbach-queue	(revision 0b5842cb91e5f716eb284a3cd00ce573a6c693fc)
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+if [ -e /var/run/sipbmp3/current_queue_temp ]; then
+    rm /var/run/sipbmp3/current_queue_temp
+fi
+
+while true; do
+    time=$(date)
+    echo "This is a work in progress!  Please send bugs to jhamrick." >> /var/run/sipbmp3/current_queue_temp
+    echo ""
+    echo "As of $time:" >> /var/run/sipbmp3/current_queue_temp
+    /usr/lib/sipbmp3/queue >> /var/run/sipbmp3/current_queue_temp
+    mv /var/run/sipbmp3/current_queue_temp /var/run/sipbmp3/current_queue
+    chmod ugoa+r /var/run/sipbmp3/current_queue
+done
Index: gutenbach-queue/gutenbach-queue
===================================================================
--- gutenbach-queue/gutenbach-queue	(revision 0b5842cb91e5f716eb284a3cd00ce573a6c693fc)
+++ gutenbach-queue/gutenbach-queue	(revision 0b5842cb91e5f716eb284a3cd00ce573a6c693fc)
@@ -0,0 +1,79 @@
+#!/bin/bash
+
+case "$1" in
+    start)
+	daemon -F /var/run/sipbmp3/gutenbach-queue.pid --name gutenbach-queue --running
+	if [ "$?" == 0 ]; then
+	    echo "The gutenbach queue daemon is already running."
+	else
+	    if [ ! -e /var/run/sipbmp3/current_queue ]; then
+		touch /var/run/sipbmp3/current_queue
+		chmod ugoa+r /var/run/sipbmp3/current_queue
+            fi
+            if [ ! -e /var/run/sipbmp3/queue_times ]; then
+		touch /var/run/sipbmp3/queue_times
+            fi
+            if [ ! -e /var/run/sipbmp3/exiftool_data ]; then
+		touch /var/run/sipbmp3/exiftool_data
+	    fi
+            if [ ! -e /var/run/sipbmp3/current_queue_temp ]; then
+		touch /var/run/sipbmp3/current_queue_temp
+            fi
+
+	    echo "Starting gutenbach daemon..."
+	    daemon -F /var/run/sipbmp3/gutenbach-queue.pid --name gutenbach-queue -u daemon /usr/lib/sipbmp3/build-gutenbach-queue
+	    echo "Done."
+	fi
+	;;
+
+    stop)
+	daemon -F /var/run/sipbmp3/gutenbach-queue.pid --stop --name gutenbach-queue
+	/usr/lib/sipbmp3/kill-gutenbach-queue
+
+	if [ -e /var/run/sipbmp3/current_queue ]; then
+            rm /var/run/sipbmp3/current_queue
+	fi
+        if [ -e /var/run/sipbmp3/queue_times ]; then
+            rm /var/run/sipbmp3/queue_times
+	fi
+        if [ -e /var/run/sipbmp3/exiftool_data ]; then
+            rm /var/run/sipbmp3/exiftool_data
+	fi
+        if [ -e /var/run/sipbmp3/current_queue_temp ]; then
+            rm /var/run/sipbmp3/current_queue_temp
+        fi
+	;;
+
+    restart)
+	daemon -F /var/run/sipbmp3/gutenbach-queue.pid --stop --name gutenbach-queue
+        /usr/lib/sipbmp3/kill-gutenbach-queue
+
+	if [ -e /var/run/sipbmp3/current_queue ]; then
+	    rm /var/run/sipbmp3/current_queue
+	fi
+	if [ -e /var/run/sipbmp3/queue_times ]; then
+	    rm /var/run/sipbmp3/queue_times
+	fi
+	if [ -e /var/run/sipbmp3/exiftool_data ]; then
+	    rm /var/run/sipbmp3/exiftool_data
+	fi
+	if [ -e /var/run/sipbmp3/current_queue_temp ]; then
+	    rm /var/run/sipbmp3/current_queue_temp
+	fi
+
+	touch /var/run/sipbmp3/current_queue
+	chmod ugoa+r /var/run/sipbmp3/current_queue
+	touch /var/run/sipbmp3/queue_times
+	touch /var/run/sipbmp3/exiftool_data
+	touch /var/run/sipbmp3/current_queue_temp
+
+	echo "Starting gutenbach daemon..."
+	daemon -F /var/run/sipbmp3/gutenbach-queue.pid --name gutenbach-queue -u daemon /usr/lib/sipbmp3/build-gutenbach-queue
+	echo "Done."
+	;;
+
+    *)
+	echo "Usage: $0 {start|stop|restart}"
+	exit 1
+	;;
+esac
Index: gutenbach-queue/kill-gutenbach-queue
===================================================================
--- gutenbach-queue/kill-gutenbach-queue	(revision 0b5842cb91e5f716eb284a3cd00ce573a6c693fc)
+++ gutenbach-queue/kill-gutenbach-queue	(revision 0b5842cb91e5f716eb284a3cd00ce573a6c693fc)
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+echo "Stopping view-gutenbach-queue..."
+killall -q "/usr/lib/sipbmp3/view-gutenbach-queue"
+echo "Stopping build-gutenbach-queue..."
+killall -q "/usr/lib/sipbmp3/build-gutenbach-queue"
+echo "Stopping queue..."
+killall -q "/usr/lib/sipbmp3/queue"
+echo "Stopping exiftool..."
+killall -q "/usr/bin/exiftool"
+echo "Stopping watch..."
+killall -q "/usr/bin/watch"
+echo "Done."
Index: gutenbach-queue/queue
===================================================================
--- gutenbach-queue/queue	(revision 0b5842cb91e5f716eb284a3cd00ce573a6c693fc)
+++ gutenbach-queue/queue	(revision 0b5842cb91e5f716eb284a3cd00ce573a6c693fc)
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+found_current=
+
+if [ -e "/var/run/sipbmp3/queue_times" ]; then
+    rm "/var/run/sipbmp3/queue_times"
+fi
+
+cd /var/spool/lpd/sipbmp3/
+for i in $(ls . | grep ^hf); do
+    done=$(cat "$i" | grep done)
+    if [ ! -n "$done" ]; then
+	timestamp=$(cat "$i" | grep ^job_time= | sed 's/.*=//')
+	echo "$timestamp:$i" >> /var/run/sipbmp3/queue_times
+    fi
+done
+
+if [ -e /var/run/sipbmp3/queue_times ]; then
+    for i in $(sort /var/run/sipbmp3/queue_times); do
+	i=$(echo "$i" | sed 's/.*://')
+	prefix="df"${i:2}
+	for j in "$prefix"*; do song="$j"; done
+
+	user=$(cat "$i" | grep ^P=)
+	user=${user:2}
+    
+	if [ -e /var/run/sipbmp3/exiftool_data ]; then
+	    rm /var/run/sipbmp3/exiftool_data
+	fi
+
+	exiftool "$song" >> /var/run/sipbmp3/exiftool_data
+	title=$(cat /var/run/sipbmp3/exiftool_data | grep "^Title " | sed 's/.*: //')
+	artist=$(cat /var/run/sipbmp3/exiftool_data | grep "^Artist " | sed 's/.*: //')
+
+	if [ -z "$found_current" ]; then
+	    host=$(cat "$i" | grep ^H=)
+	    host=${host:2}
+	    album=$(cat /var/run/sipbmp3/exiftool_data | grep "^Album " | sed 's/.*: //')
+	    echo "$user@$host is currently playing:"
+	    echo "'$title'"
+	    echo "by '$artist'"
+	    echo "on '$album'"
+	    echo ""
+	    echo "Coming up in the queue:"
+	    found_current="true" 
+	else
+	    echo "$user: '$title' by '$artist'"
+	fi
+    done
+fi
Index: gutenbach-queue/view-gutenbach-queue
===================================================================
--- gutenbach-queue/view-gutenbach-queue	(revision 0b5842cb91e5f716eb284a3cd00ce573a6c693fc)
+++ gutenbach-queue/view-gutenbach-queue	(revision 0b5842cb91e5f716eb284a3cd00ce573a6c693fc)
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+daemon --running --name gutenbach-queue -F /var/run/sipbmp3/gutenbach-queue.pid
+if [ "$?" == 0 ]; then
+    watch -t -n 1 cat /var/run/sipbmp3/current_queue
+else
+    echo "The gutenbach queue daemon is not running.  Please start it at /etc/init.d/gutenbach-queue."
+fi
