Instantly search all the documents you ever printed
Ever wanted to be able to quickly search through all the pdf documents/papers you have printed from the Internet? Here's how: modify your printer command/driver to save all printed documents on the disk, and then let Beagle index them.
For Linux users, here's a simple hack that does it by redefining the lpr command. Create a directory ~/printed, and save this script somewhere in your PATH before /usr/bin.
I want to emphasize that this script is a hack, and the proper way of doing this is probably by modifying /etc/printcap or whatever CUPS uses instead. Tell me if you know how to do it.
For Linux users, here's a simple hack that does it by redefining the lpr command. Create a directory ~/printed, and save this script somewhere in your PATH before /usr/bin.
#!/bin/bash
# if lpr is invoked with filenames
for file in "$@" ; do
if test -f "$file" ; then
basename=$(basename $file)
tempname=$(tempfile -d ~/printed -s "-$basename.pdf")
echo "Converting $file to $tempname"
nice ps2pdf $file $tempname
fi
done
# if lpr reads its data from the standard input
if test -z "$@" ; then
tempname=$(tempfile -d ~/printed)
tee $tempname | /usr/bin/lpr "$@"
nice ps2pdf $tempname $tempname.pdf
rm $tempname
else
exec /usr/bin/lpr "$@"
fi
I want to emphasize that this script is a hack, and the proper way of doing this is probably by modifying /etc/printcap or whatever CUPS uses instead. Tell me if you know how to do it.
