You are not logged in.
I just discovered flexget a program that can (if i understand i correctly) download something, for example xkcd automatically every time a new issue comes out and put the comic in a directory.
Now i got an idea about this. A watch directory for your printer. Everytime something is put in this watch directory it get printed out.
Anyone of you guys aware of such a utility capable of this or want to script one?
Think about the possibilities! everytime a new issue of xkcd or ALM get published it is automatically printed out for you.
I would buy a dedicated toilet-printer ;D
Last edited by whacath (2010-05-25 03:00:43)
Offline
Simple.
Watch the dir with inotify. Whenever a new file is created, print it.
I have no printer I can use for testing though.
@whacath: tjockis?
Offline
#!/bin/sh
watchdir=/path/to/watchdir
inotifywait -qm --event CREATE --format %f "$watchdir" | while read file; do
lpr "$watchdir/$file"
done
Of course you'd need some better logic than just throwing everything directly at lpr, but inotify is the way to go and it doesn't need to be much more complicated than this.
Offline
Cool! Thanks guys!
@dmz: du ja!
Offline