by davi · 17y ago · 0 comments
I know very little about hardware hacking but I had an idea the other day: I wanted to rig a mini-stoplight up (green, amber, red LEDs) that I could plug into my computer's USB port and hit hot keys to change which LED was lit.
Then my wife could look over and see if I was super-focused or not. When I was thinking about code or trying to do science writing, I would toggle the thing to the red LED; when I was screwing around on HN, I would toggle it to green.
I looked around naively but couldn't find something small & easy. This product could maybe fit the bill nicely.
Whether my wife would appreciate such a thing is another matter. :)
At that point, you could probably sell the thing on thinkgeek.com and watch cubicles everywhere fill up with activity indicators. Of course, there would have to be manual override, so cube workers could set it to red all day when they don't feel like doing anything.
When a Terminal window is in the foreground and has an open ssh session --> amber
When Firefox in foreground, displaying news.ycombinator.com --> green.
Never automatic red, though: I would want to conserve its signaling value, so that it would always mean, "if you talk to me right now you are going to mess up a thought structure that was difficult to build".
[edit:
Hm, a little bluetooth-enabled one of these actually would be a pretty cool thinkgeek product.
]
-- In AppleScript while I wait for tea to steep...
if application "Terminal" is frontmost then
tell application "Terminal"
get name of first item of windows of it
if result contains "ssh" then
set red to false
set yellow to true
set green to false
end if
end tell
end if
-- or a one-liner...
if application "Terminal" is frontmost then tell application "Terminal" to ¬
if (name of first item of windows of it contains "ssh") then set stoplight to "yellow"Color and write text on it.
Turn so appropriate color is facing outward
Voilà.
Extra points for if it: a. has an ethernet port b. reads rss feeds or email
My wife did the boolean version of this, though, when I told her I wanted to spend $100 on a fancy board from National Instruments. She folded a piece of paper in two, wrote "DO NOT DISTURB" on one half, and propped it up next to me.
IDE/text edit open -> red light, web browser -> yellow, game -> green.