Aug 2, 2017
One day, I was running a long test suite and found myself constantly flipping back and forth between my terminal and text editor. I realized I did this all the time and wondered if there was an easy way to be notified when the test suite finished. I found it in a little USB light called blink(1) and it turns out it’s really simple to set up.
blink(1) is a USB notification light which can be programmed to notify you of all sorts of things. Twitter mentions, new GitHub issues, emails, or even package shipping status updates. And for those of you in traditional offices, it can also be used as an Available/Meeting/Busy status light.
Yesterday I posted an image and video demonstrating what happens when I run PHPUnit tests on my iMac. When they pass, the blink(1) connected to my keyboard lights up green. If my tests fail, I get a red light. While the tests are running, the light turns blue. I also use blink(1) to notify me of other random things.
It doesn’t take much to get this going. All you need is:
Setting it up is also pretty easy:
PATH. I personally install PHPUnit globally
usr/local/bin/with this command:
mv ~/david/Downloads/blink1-tool /usr/local/bin
aliases.zsh. These aliases create and run a new function called
__phpunit, which checks to see if you have a blink(1) light connected to your computer, and if so turns the light blue, runs
phpunitand conditionally change the light’s color based on the exit status. My personal version is also configured to play the sound “GODLIKE” from Unreal Tournament when my tests pass. You can get my sound here
All in all, it’s pretty easy to set up if you’re comfortable with a little bit of command line and this set up satisfies the little geeky computer nerd part of me. Let me know if you decide to get a similar set up or have any troubles getting this running.
Interested in more content like this? Follow me on Twitter to stay updated when I post new articles.
© 2018 David Hemphill