Inspiration
Every study session I've had goes the same way. Docs is open on one screen, Distractions open on the other, and three hours later the essay has two paragraphs. I've tried focus timers, and they all do the same thing: they count down and ding. Nothing happens if you ignore them, so I ignored them. I wanted a timer that actually does something when you slack off.
What it does
FocusPlug is a focus timer for Windows that enforces itself. You pick which apps count as studying and which ones are distractions, set a length, and lock in. If you switch to any distractions, you get 10 seconds to go back. If you don't, FocusPlug force-quits it. It also uses your webcam to check that you're still at your desk. That runs entirely on your computer, and the video never leaves it. A small model watches how you're acting, like tabbing back and forth a lot, and tries to catch a drift before it happens. When it thinks you're about to slip, it nudges you and shortens the countdown. After each session it tells you how long you lasted before your first drift.
How we built it
Electron, React and TypeScript. Window detection and force-quitting go through Windows APIs. The webcam check uses MediaPipe's BlazeFace. We also trained our own desk model on top of it, which gets about 95% on images it never saw during training. The drift predictor is a tiny neural network that runs once a second. I used AI coding agents for a lot of the code. Did this on a time crunch so I spent the first day running loops on basic things such as frontend, the timers and whatnot, for the machine learning I had to review and even chance a couple of thing. I used Adaptionlabs api to label some of my data for the machine learning model.
Challenges we ran into
We didn't have real student data, so the drift predictor was trained on simulated study sessions. That means its numbers only show it works on our simulation, not on real people yet. Phone detection was also tough. We labeled almost 2,000 desk photos with, and the phone detector still isn't reliable, so it only nudges you and never closes anything. Plus, a lot of the Windows-specific code had been written on other machines, so the first real runs on Windows turned up bugs.
Accomplishments that we're proud of
Seeing a Distraction actually close the first time. Also, everything runs offline. There's no cloud API anywhere in it.
What we learned
A model that's only sort of accurate shouldn't be allowed to punish anyone. We ended up setting clear rules for what each model is allowed to do, based on how accurate it actually is.
What's next for FocusPlug
Right now its windows only, I might expand it do mac and Linux.
Built With
- adaption-labs
- blazeface
- claude
- cursor
- electron
- electron-vite
- mediapipe
- mobilenetv2
- node.js
- powershell
- puppeteer
- python
- react
- tailwindcss
- tensorflow.js
- typescript
- vite
- vitest
- windows-10
Log in or sign up for Devpost to join the conversation.