A distraction blocker for Omarchy

Your attention back, in sessions you choose.

X twice a day, five minutes each. Outside those sessions the site is blocked for the whole machine; inside them you get only the people you follow. Tightening is free. Loosening needs a password you can give to someone else.

Arch + Hyprland + Chromium · free · MIT · no backend

X

X is resting. Start a session when you're ready.

Sessions today: 1 of 2 · 5 min each · 5 min left

Calma · calma status in a terminal

Install Omarchy plugin
omarchy plugin add https://github.com/joanreyero/calma --enable
Then click the leaf in the bar → Free. MIT. No telemetry.

The model

A budget of short sessions, and a door that only closes further.

Four ideas, nothing else to learn.

Rules

A rule is a set of websites and apps with a daily budget: so many sessions a day, so many minutes each. x and youtube come as presets; anything else is a list of domains and process names.

Sessions

Outside a session the rule is blocked: Chromium refuses the sites, nothing on the machine can resolve the domains, listed apps are killed as they start. Inside a session you get the minimal site. When the time is up the tabs close.

Tighten for free

Fewer sessions, shorter sessions, more domains, a new rule: any time, no questions asked. Loosening anything, more time, removing a site or a rule, uninstalling, asks for the Calma password.

Give the password away

Set a password and hand it to someone you trust: now it is out of your reach. Never set one and nothing can ever be loosened. Either way, the version of you at eleven at night does not get a vote.

Inside a session

Minimal X, minimal YouTube.

The site you came for, without the parts built to keep you there. Enforced twice: Chromium's managed policy keeps the paths closed, and the extension hides what is left.

X

Stays

  • Following timeline
  • Search
  • Profiles and threads
  • Notifications, messages

Goes

  • For you
  • Explore and trends
  • Grok
  • Promoted posts
  • Who to follow, Discover more
  • Communities, Premium prompts

YouTube

Stays

  • Subscriptions
  • Search
  • Channels and playlists
  • Watching a video
  • History, library

Goes

  • Home feed
  • Shorts
  • Related videos, end screens
  • Comments
  • Autoplay
  • Explore, trending, gaming

Wireframes, not screenshots. On X, /home opens on Following and the For you tab is gone; on YouTube, / and /shorts land on your subscriptions and the autoplay switch is turned off every time it comes back on.

Outside a session

Five layers, each covering for the others.

Nothing clever. Several plain mechanisms, so that no single one is the thing you talk yourself around.

  1. 01
    Chromium managed policy. A policy file every Chromium window of every user obeys and that cannot be changed from inside the browser. Blocked domains while a rule rests; only the minimal paths while it is open.
  2. 02
    Hosts file. While a rule is blocked its domains resolve to nowhere for the whole machine, so Firefox, curl or a desktop app cannot reach them either.
  3. 03
    Process killing. A rule may list process names (steam, discord); while blocked they are killed within a second of starting.
  4. 04
    Browser extension. Loaded by a flag in /etc/chromium-flags.conf. It draws the calm blocked page, shows the countdown, hides feeds and recommendations during a session and closes the tabs the moment it ends.
  5. 05
    Self-protection. A system service that refuses to be stopped and restarts in a second if killed; a watchdog every minute that repairs the policy and flags; a rules file accepted only when the change tightens or is signed with the password-protected key. Anything else is reverted, logged and shown as a notification.

Honesty about root

Calma defeats impulse, not a determined root user with an hour to spare.

Linux gives root the final word, and you are root on your own machine. Every known bypass takes several deliberate steps as root: stopping a service that refuses to stop, editing files the daemon rewrites, deleting the daemon's own trust store, or removing Chromium's policy directory. None of them happens by accident, none of them is one command, and calma doctor tells you when any of them has been done.

The adversary is the five seconds between "I'll just check X" and the tab being open. The goal is that removing Calma is a conscious project, not a reflex. The full list of bypasses, with step counts, is written down on purpose.

Threat model →

Install

Three steps, with your agent or by hand.

Omarchy (Arch Linux, Hyprland, Chromium). The repository is the Omarchy shell plugin: the bar widget comes first and installs the rest.

  1. 1

    Add the plugin

    terminal
    $ omarchy plugin add https://github.com/joanreyero/calma --enable
  2. 2

    Click the leaf in the bar, then Set up with the agent

    Your default coding agent opens with the setup guide and walks you through the install (you run the sudo lines), the password choice and your first rules. Prefer to do it yourself? The manual path is below.

  3. 3

    Restart Chromium

    It picks up the policy and loads the extension. From then on the blocked page, the bar widget and the CLI all start sessions.

Manual path
$ cd ~/.config/omarchy/plugins/io.github.joanreyero.calma
$ sudo ./install.sh
$ sudo calma password        # optional, recommended
$ sudo calma add x --preset x --sessions 2 --minutes 5
Every day
$ calma status      # blocked, open, what is left today
$ calma open x      # start a 5-minute session
$ calma close       # end early; unused time stays in the budget
$ calma doctor      # check that every layer is in place

Without a preset: sudo calma add steam --domain store.steampowered.com --process steam --sessions 1 --minutes 60. The day resets at 04:00. A git clone works too; install.sh knows nothing about the plugin.

Questions

Short answers.

I forgot the password.
Then nothing can be loosened. That is the point. Tightening still works, sessions still work, and the rules you set stay as they are.
Can I use Firefox or another browser?
While a rule is blocked, the hosts layer makes its domains unreachable from every program on the machine. During a session, other browsers get the full site, because the minimal versions only exist in Chromium's policy and extension. If that matters to you, do not keep another browser installed.
What about my phone?
Nothing. Calma only knows about the machine it runs on.
Can I remove it?
sudo calma uninstall asks for the password if one is set, stops the units, removes the files and restores /etc/hosts, the Chromium policy and the flags file. Without the password, removing it is the deliberate multi-step root project described in the threat model.
Is anything sent anywhere?
No. There is no backend and no telemetry. The only network traffic is between the extension, the bar widget and the daemon on 127.0.0.1. The code is short, has no dependencies, and runs as root, so read it.
Why does systemctl stop calma fail?
The unit is marked RefuseManualStop. Stopping the daemon would be the easiest loosening of all, so it is not offered.