I realized I had way too many browser tabs open, and the silly idea came to me; how hard would it be to make a hardware knob to switch between them?

Turns out Native Messaging is a viable way to get data from an USB/serial port into your Firefox extension, which has a nice API to access the tabs.

I created a mount for my thinkpad X220, a knob, picked a rotary encoder and an arduino, and the whole thing was done in an afternoon. Elen wrote the extension, I made the firmware, both of which are very simple.

I made a silly video of it, which took 2 days in total. Watch it here: https://diode.zone/videos/watch/89fa7e87-2f07-4148-9009-f70ae06c8d03

The source code and 3d model is available on Github: https://github.com/tachiniererin/webtuner

This seemingly pointless thing turned out to be actually useful, and I catch myself using it unironically since then.

The reason is, the browser always receives the events, even when it is out of focus. I can work on something, have the browser be open on a different screen, and with the WebTuner I can switch tabs without my main application ever losing focus.