← All labs

HOCUS FOCUS

A wizard who guards your focus
Swift · AppKit · On-device speech

Labs / 17

Mac app, shown as a film

(Overview)

A website blocker you have to argue with.

Hocus Focus is a small wizard who lives in the corner of your Mac. During working hours he watches your browser. Open LinkedIn, YouTube or any of the other usual suspects and he walks over, flies up to the tab and zaps it shut, with a line like “Begone, foul scroll!”

You can have a site back, but you have to ask out loud. He shows you a rhyming spell, you read it to your Mac, and if he likes what he hears you get ten minutes. Ask again the same day and it’s five, then two. Saying “bring back to me my YouTube” in an open-plan office turns out to be a good deterrent.

Type
Mac menu bar app, shown here as a film
Built with
Swift and AppKit, with no libraries
Browsers
Chrome, Brave and Edge
Speech
Apple’s speech recognition, running on the Mac
Art and sound
Pixel sprites and chiptune effects, all drawn and synthesised in code
Status
Working on my own Mac. Not released

(In the film)

  1. 0:00First launch. He introduces himself and asks for the three permissions he needs
  2. 0:36Two tabs stray. LinkedIn, then YouTube. Both are zapped shut
  3. 0:53A rank-up to Conjurer, then the menu bar menu with the day’s score
  4. 1:01The spoken spell, ten minutes of YouTube and a sulking wizard
  5. 1:24Woken early, he zaps YouTube again
  6. 1:34Six o’clock. He falls asleep until tomorrow
01

He aims at the actual tab

Every second and a half the app asks the browser for its open tabs and checks them against a blocklist. When one matches, it uses the Mac’s accessibility tools to find where that tab sits on screen, in a strip along the top or a sidebar down the side. The wizard is drawn in a see-through window that sits above everything and lets clicks pass through, so he can walk and fly to the exact spot before the tab is closed.

02

Spells a computer can hear

The first spells were invented nonsense, and speech recognition couldn’t follow a word of it. So each one now opens with real Latin, “alea iacta” or “carpe diem”, and ends on a rhyme for the site you want back. The Mac transcribes you as you speak and the spell power bar fills as your words match. It doesn’t need to be perfect: about two thirds right will do, which is why “Aaliyah actor roll cube” passes.

03

Focus is the score

Every focused minute earns a point, and enough points earn a new rank and a new robe, from the purple Apprentice to the white Grand Archmage. Each unlock costs fifteen points, and a working day with none earns a bonus. The film is a scripted session with the real app: a clean browser profile, the Mac’s own voice reading the spell, and the points nudged so the rank-up lands on camera.

Next lab: Airport Wayfinder All labs