Skip to content

A focus app for Linux that is hard to get around

Focus builds a city.Giving in tears it down.

DeepWork slows distracting sites to a crawl at the network layer, starts focus sessions on a schedule, and raises a building in a 3D city for every session you finish. Quit early and you watch it come down.

deepwork-ui · hamlet → metropolis
Captured from the app. A fresh install starts with an empty field: you build the rest.

Throttle, don’t block

Distracting sites crawl. Docs, mail and work sites run at full speed.

Routines start themselves

Focus slots begin on schedule. Two skips a week, no more.

A city that remembers

Finished sessions raise buildings. Giving in levels them.

Why

Slow beats blocked.

Most blockers start a fight you can win with one command. DeepWork doesn’t try to stop you. It makes the distraction too dull to bother with, and makes giving in cost something you care about.

A block is a puzzle

A blocked site is a challenge, and anyone with sudo and a terminal can solve it in a minute. The urge wins, with a side of pride.

A crawl is just boring

At 256 kbit/s and 400 ms of extra latency, video buffers at 240p and images take half a minute. There is nothing to beat, just nothing worth the wait.

Losing hurts more than winning pleases

Every finished session is a building you watched go up. Quitting early means watching it fall, with your name on the rubble.

How it works

One session, end to end.

No browser extension and no process killing. Enforcement lives in the kernel, where closing a window can’t reach it, and your browser keeps working for the work you sat down to do.
  1. 01Start

    Set a timer or a stopwatch, or let a routine start one for you. The app only asks; the root daemon owns the session.

  2. 02Resolve

    The daemon answers DNS itself. When a name matches your lists, its addresses go into nftables sets. SNI checks catch what DNS misses.

  3. 03Throttle

    tc and netem add latency and cap bandwidth for those addresses only. Linger on a slowed site and the throttle tightens.

  4. 04Build

    Finish and a building rises in your city. Surrender, tamper or tunnel out, and the city takes the damage.

31:42

deep · focus timer · 50 min

in session
  • docs.rust-lang.orgpass
  • mail.google.compass
  • music.youtube.compass
  • youtube.comslow
  • x.comslow
  • reddit.comblock
building · office towerfloor 9 of 14
dig @8.8.8.8 → redirectedQUIC → droppedDoH → dropped
Illustration. Work runs at full speed; the rest waits its turn.

Tour

Every session, kept or quit.

One window: the city, a single card to start a session, and a settings sheet for everything else. Closing it changes nothing; it’s only a view.
A focus session in progress: a building under construction with a crane, and the session timer

In session

A crane works the lot while you work. The card shows time left, the building’s progress and how long you spent on slowed sites.

Surrendering: the building under construction is about to collapse

Surrender

Type the phrase by hand, then wait ten minutes with the throttle still on. The blueprint turns red and the site trembles.

A metropolis after 260 focused hours, with glass towers and landmarks

260 hours in

Hamlet, town, city, metropolis. Each tier is earned in focused hours, and the traffic grows with it.

Close-up of damaged buildings and rubble

What giving in costs

Smashed windows, fire, rubble with rebar. Damage stays until finished sessions repair it.

Stats: focused time per day, completed and surrendered sessions

Stats

Focused time per day, streaks, and every session kept or quit. Surrenders get a red dot.

Site lists, with a loosening change waiting 24 hours

Site lists

Allow, slow or block per domain. Tightening applies at once; loosening waits 24 hours.

The city

Every session is a building.

The city is folded from the daemon’s ledger each time it’s drawn. Nothing is stored that the app could edit, so the only way to grow it is to focus, and the only way to lose it is to give in.

Longer sessions build bigger

Building grades: cottage for any session, shop from 25 minutes, apartments from 50, an office tower from 90, a landmark from 3 hoursCottageany lengthShop25 minApartments50 minOffice tower90 minLandmark3 h

Focused hours grow the settlement

  1. Hamlet

    0 h

  2. Town

    10 h

  3. City

    50 h

  4. Metropolis

    200 h

severe

Surrender

The building under construction collapses into rubble and fire spreads to the three nearest. The time doesn’t count and the streak resets.

major

Tamper

Flush the firewall or edit a qdisc and an earthquake hits your biggest district. The rules are back within a second anyway.

minor

Bypass attempts

A refused sudo, a jump of the wall clock or a SOCKS tunnel cracks your newest building.

repair

Coming back

Every finished session repairs damage, worst first, and builds on the oldest rubble. Twice as fast on a three-day streak.

The inspiration

Named after a book.

In Deep Work (2016), Cal Newport argues that the ability to focus without distraction is getting rarer at exactly the moment it’s getting more valuable, and that you don’t get it back by trying harder. You get it by building rituals and taking the alternatives off the table.

DeepWork is that advice with a root daemon behind it. Each of the book’s four rules maps to something the app does for you, so the decision is made once, calmly, and not again every time a tab beckons.

Rule #1

Work Deeply

Willpower runs out, so build rituals around depth, and keep a compelling scoreboard of the hours you put in.

→The city is the scoreboard

Every focused hour is on the skyline. You see your deep work instead of counting it.

Rule #2

Embrace Boredom

Don’t take breaks from distraction. Take breaks from focus, and decide in advance when they happen.

→Inverted mode

Distracting sites stay slow all day. Finished sessions earn free minutes you spend on purpose.

Rule #3

Quit Social Media

Keep a tool only if its benefits clearly outweigh its costs, judged with a clear head.

→Site lists with a cooling-off

Slow or block per domain. Loosening a list waits 24 hours, so the urge never gets the vote.

Rule #4

Drain the Shallows

Schedule every minute of your day, so deep work has a block of its own instead of the leftovers.

→Routines

Time blocks become sessions that start on their own. Skips are rationed to a few a week.

Read it if you haven’t: Deep Work on calnewport.com DeepWork is an independent project and isn’t affiliated with or endorsed by Cal Newport.

Hard to cheat

You have sudo.
It still isn’t worth it.

The goal isn’t an unbreakable lock. It’s that every way around takes longer than the urge lasts, and every one the daemon can see costs you a building.
You tryDeepWork
Close the app, or kill the daemonRules stay in the kernel and the daemon restarts
Reboot, or suspend through a countdownThe session resumes; time only counts while the machine is awake
Wind the clock forwardElapsed time never reads the wall clock
dig @8.8.8.8, DNS-over-HTTPS, QUICRedirected to the daemon, dropped, or forced back to TCP
Hardcoded IPs, shared CDN addressesSNI inspection judges each new TLS connection by name
sudo nft flush rulesetRepaired within a second, and an earthquake hits your city
sudo, su, pkexec, systemctl stopRefused until the session ends
ssh -D, Tor, v2ray and friendsSpotted, and a building cracks every ten minutes it runs
Loosen the configWaits 24 hours. Tightening applies at once

Every countermeasure, with how it was tested: the threat model

Safety rails

A way out, never a lockout.

Something that fights its own owner needs an exit it can’t take away. These are written into the plan as rails that no later change may remove.

Six hours, then it ends

No session runs past six hours. The ceiling is in the code, not the config, so no setting can raise it.

Surrender is always there

Type a long phrase by hand (paste is refused) and wait ten minutes with the throttle on. Then the session ends, and it costs you.

The sudo lock fails open

If the daemon is down, hung or missing, the PAM gate lets you through. A bug can never lock you out of your own machine.

TTY root always works

Ctrl+Alt+F3 and a root login is the emergency exit, with every step to lift the rules written down.

DNS is yours outside sessions

Your resolver, strict DNS-over-TLS included, is only rerouted while a session runs. A crash can’t break name resolution.

Architecture

The window is only a view.

All policy and all state live in a root daemon written in Rust. Clients can ask for a session but can’t end one early, except by the rules. Kill every client and the kernel keeps enforcing.

You · untrusted

deepwork-ui

The 3D city, the start card and every setting.

Tauri 2three.jsBlender kit

deepwork

The CLI: start, status, surrender, routines, world.

Rust

deepwork-agent

Notifications, heads-ups, nudges, and a bar module for Waybar or the Omarchy shell.

notify-send
unix socket · JSON

# deepworkd · root · Restart=always

Session engine

Countdown, stopwatch, surrender. Time accrues on the monotonic clock and survives reboots.

tokio

DNS forwarder

Plain or DNS-over-TLS upstreams. Matching answers fill the address sets.

hickoryDoT

Scheduler

Routines, skip tokens, nudges and the five-minute heads-up.

Tamper watch

Watches nft, tc and links; fingerprints the rules and repairs any change.

SNI inspector

Reads the TLS ClientHello from NFQUEUE and judges the connection by name.

raw netlink

Ledger

Sessions and penalties. The city is folded from it, never stored.

SQLite
nft -f · tc -batch

Kernel

nftables

table inet deepwork: address sets, marks, DNS redirect, QUIC and DoH drops.

tc + netem

Delay and a bandwidth cap for marked packets, egress and ingress via IFB.

NFQUEUE

New TLS connections queued once for an SNI verdict. Fails open.

Quick start

Two commands to your first building.

The script picks the package for your distribution from the latest release, checks it, installs it with apt, dnf, zypper or pacman, and starts the daemon. The package brings the CLI, the agent and the window, and hooks PAM and polkit.
bash
$ curl -fsSL https://deepwork.sagyamthapa.com.np/get.sh | sh
$ deepwork start 50m
  • Debian, Ubuntu.deb
  • Fedora, openSUSE.rpm
  • Archpacman
  • Anything elsetarball

Read the script before you pipe it, or download a package from the latest release yourself.

What it needs

Linux with systemd: Debian 12+, Ubuntu 22.04+, Fedora, openSUSE or Arch, on x86_64 or ARM64. nftables and tc/netem. DNS-over-TLS keeps working.

Look before you install

cargo run -p deepworkd -- --dry-run logs every nft and tc command instead of running it.

Read the plan

The design, the threat model and how each countermeasure was tested.