Tuesday, November 08, 2022

Tasker Powered: Like Samsung's Focus Mode, But Much Uglier

Fandabi Dozi's suggestion, in this video, of not using your phone during the first and last hour of the day caught my attention. It inspired me to consider: what if I turned off my phone not at edges of the day, but when Shira returns home from work? My hypothesis is that when she walks through the door we should be paying attention to each other, not getting distracted by tempting phone content.

Mind you, I didn't really think I had a phone-distraction problem. I thought of this experiment as a sort of a tech based romantic gesture. She'd appreciate that I was putting her first, and I'd show myself just how non-phone addicted I was.

One challenge is that I didn't really want to turn my phone off. What I wanted was a way to keep the utilitarian functions available, while locking myself out of the apps looking to suck up my attention.

Focus Up

Fortunately, my Galaxy S22 comes with just the feature I needed: Focus Mode. In Focus Mode you select which apps you want to remain functional and all others are blocked by a warning.

First off, I deleted the default Focus Modes that came with the phone. I then created a new mode named 'Us Time.' A number of apps always work in Focus Mode. I added to this the camera, my note taking apps and Cronometer which I use for tracking meals. The idea is that when I'm in 'Us Time' I can use phone for capture purposes, but everything else is off limits.

With much fanfare I turned on Focus Mode. In no time, I found myself reaching for my phone to peek at Reddit or look something up on the web. Focus Mode scolded me and I'd put the phone down. Apparently I turn to my phone more often than I expected.

Having the ability to record notes and photos meant that any thoughts that came to me while my phone was in Focus Mode could easily be captured. That proved to be a functional compromise.

I really noticed the Focus Mode effect later in the evening when I had the mode turned off. Shira nudged me: shouldn't you be brushing your teeth? I was standing over my desk reading a fairly useless Reddit discussion on whether long distance hiking is considered a vacation (spoiler alert: it is). I'd been busted. I hadn't intended to sink time into that silly thread, but a free moment had sucked me in.

This little experiment gave me a fresh perspective: while I'm a fan of the very apps I'm blocking in Focus Mode, I realized I want to use them on my terms, not theirs.

The Tasker Version: Way Uglier, Way Functional-er

While I like Samsung's Focus Mode, I find it lacks flexibility. The fastest option I can find for launching Focus Mode involves in three presses. That's a waste: why can't I start it with one? And I'd like to experiment with putting Focus Mode on a schedule or having it start based on an external event, like when Shira walks in the house. In other words, I wanted a Tasker powered version of Focus Mode.

Unfortunately, there's no direct way to manipulate Focus Mode in Tasker. Instead, I needed to implement my own version of Focus Mode from scratch in Tasker. While this sound daunting, it's actually straightforward.

Looking around, it seemed I had three options:

  1. Use ADB WiFi to disable and enable apps. Using this approach, I could disable all apps on my phone except for the ones allowed during Focus Mode. This approach is a bit too heavy handed. I'm looking for a nudge here, not an actual phone lock down.
  2. Create a simple profile that detects when disallowed apps are launched and run the 'Go Home' Task. This approach is simple and effective. You can start any app you want, but within a moment you're back at the home screen.
  3. When the launcher app runs, in my case Smart Launcher, spawn a pop-up that sits on top of the UI. This pop-up will cover the launcher app so you effectively can't use it. The pop-up can contain its own buttons to launch approved apps.

I ended up going with Option #3, and it was surprisingly simple to implement. I created a new Scene, Focus Overlay, that takes up most of the screen. The trick is to 'create' this scene whenever Smart Launcher is running in the foreground. Tasker allows this functionality with a simple profile:

When I launch an app using a button on the Focus Overlay, I destroy the Focus Overlay scene and launch the relevant app. When I eventually return to my home screen, Smart Launcher is launched again and the profile that detects this creates a new copy of the Focus Overlay.

While this approach is far less sexy than the built in versions of Focus Mode, it's just as effective. Best of all, it's trivial to automate. I was able to add widget to my home screen to start Focus Mode in one press. I also created a SMS handler so that if Shira texts me the word 'FOCUS' the mode will start as well. I plan to experiment with ways to have Shira's phone trigger Focus Mode when she walks in the door. My current thinking: I'll have her phone send an AutoRemote message to my phone when her phone join's our home WiFi.

When I initially heard of Samsung's Focus Mode I wrote it off as a marketing gimmick. I was wrong. Focus Mode helps your phone work for you, instead of against you. And what I thought was a simple romantic gesture has turned out to be so much more.

No comments:

Post a Comment