Take a Photo with FaceTime Camera After a Task Finishes in OS X Command Line
If you’ve ever wanted to document your reaction to an event, task, or specific command execution, now is your chance to get started. With the help of a fun little app called ImageSnap, you can snap pictures with the FaceTime or iSight cameras from the command line. That can be good enough on it’s own for some uses, but it’s much more entertaining when you tie it to the completion of another command, thereby snapping the reaction to whatever is going on.
Installing ImageSnap is easy:
- Download Imagesnap and open the tarball
- Next, cd to the new directory, then copy the imagesnap executable to /usr/local/bin/ (or elsewhere if you prefer)
- Refresh or load a new shell for imagesnap to be usable
tar -xvf imagesnap.tgz
sudo cp imagesnap /usr/local/bin/
You can do a quick test by running “imagesnap”, it’s fairly fast acting and you’ll notice the iSight/FaceTime camera light blinks for a moment as the picture is taken. The resulting picture defaults to be named snapshot.jpg.
Now for the fun part, which is attaching imagesnap to the completion of another task, here are a few examples:
Grab your reaction to uptime and load averages:
uptime && imagesnap
Capture the unique look of optimistic worry after an uncertain commit:
git commit -a -m 'No idea what I'm doing' && imagesnap
If you want to actually see your reaction, attach the open command to the end as well:
rm donotdelete.txt && imagesnap && open snapshot.jpg
The default file name is always snapshot.jpg unless it is changed, and the output path is always the present working directory unless it has been specified otherwise.
This can be used in similar ways to Terminal Notifier, except that it’s not actually notifying you of anything and instead it’s documenting your response to events, which can be absolutely hilarious. Have fun!