How can I block nearly every site for short periods of time to improve my focus on work?

If you want to block all sites except for example.com and work.com, the following is one way to add a 90 minute focus session.

pluck + allow+ example.com
pluck + allow+ work.com
pluck + when now+90m block+ text

As long as example.com and work.com are already in your configuration, and have elevated priority via allow+, then they alone will be unaffected by the elevated priority rule block+ text.

(To gain a better understanding of how elevated priority works, see priority modifiers.)

Does this work for applications as well?

Yes, you can block distracting desktop applications as well as distracting sites. The same principles as in the previous example apply.

To block all programs and sites and focus only on VS Code for 90 minutes, the following will work.

pluck + allow+ program code  # unix systems
pluck + allow+ program code.exe  # windows systems
pluck + when now+90m block+ otherwise

What if I want to automate it with a script?

If you’d like a ready-made script, see focus.sh.

TODO: write a similar script for Windows.


Last updated: 2024-04-10