Take a Photo with FaceTime Camera After a Task Finishes in Mac 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.
This article will show you a fun trick to capture a new photo with a Mac FaceTime (front facing) camera, after a specific task has completed and finished in the MacOS Command Line.
Installing ImageSnap to Take FaceTime Pictures from Command Line
First you’ll need to install a free command line utility called ImageSnap. 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.
Snapping a FaceTime Camera Photo When Command Line Task Completes
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!
For taking a photo after a commit add a ‘post-commit’ file to your.git/hooks directory and add ‘imagesnap’.
it’s = it is.
its = the possessive form of “it.”
There’s also a recipe for imagesnap in brew so if you use it to install common apps you can just do ‘brew install imagesnap’