How would you write text on a laptop without touching the keyboard at all? Have you tried opening it and slamming it shut repeatedly?

Open and Shut is a bash script that allows you to do exactly that. It turns the laptop into a telegraph key, where you push the computer closed to mark dots—or for longer durations to mark dashes—and pause in the open state to start a new letter.

Jesse Li, a computer science student at Swarthmore College, created this while holed up in his childhood home, a creative piece coming directly from the downtime of the caronavirus quarantine. He describes how the project came together:

The idea has probably been simmering in my unconscious for quite a while. Some of my friends at college are weirdly into Morse code (they don't even do amateur radio! Or anything that requires Morse code!) so about a month ago I enabled the Morse code mode on my phone's keyboard and tried out Google's Morse code trainer.

A few days ago the idea just popped into my head while I was doing a reading assignment for class. I texted my brother right away and got to work testing if it'd be technically possible.

Open and Shut reduces the laptop to a blunt object, a tool with 104 keys suddenly reduced to a single key itself. In this, it resembles bodyfuck, the brainfuck-derived language which requires programmers to physically enact the computer operations their code will perform: both avoiding the keyboard as input device, and using broad gestures to write.

It also brings to mind previous Morse Code tech projects like Tworse key, which allows the user to tweet using an Arduino-controlled telegraph key. But where Tworse key requires an external device, Open and Shut makes use of what you already have.

Jesse writes the word ESOTERIC for us with Open and Shut on Vimeo.

The full source code for Open and Shut is on Github. It is surprisingly simple; written in one day, in only 125 lines of code, nearly half of them just listing the Morse encoding of each letter. To use it, you must disable screen locking, so your machine remains active when closed. It uses the acpid library to detect the change in state between open and closed.

Jesse describes the motivation behind creating the work:

I implemented it in order to continue procrastinating on my homework. Many of my biggest accomplishments as a developer have been the result of me trying to avoid doing something else.

h/t @foone