I'm doing this on Windows 10, writing this in April 2021.
Is a hacky solution that uses Cold Turkey Blocker and Autohotkey, both free tools.
We want a block that's low friction to activate and high friction to disable.
Low friction = keyboard shortcuts (using Autohotkey)
High Friction = cold turkey, whatever it already uses to block things. It's free.
Use * on websites to block all websites.
Make exempt all the things you might need so you don't have to fret about whether you have a call in an hour so you can't activate block or whatever. For me, this means meet.jit.si, focusmate, and calendar are all unblocked always, as well as brick and roam for writing. Put /* at the end of your domain to be able to go to all subdomains. (eg. meet.jit.si/study for a study call)
Press save and give the block a name (mine is called All Except Essentials). Don't make your name agressive, that's mean and you love yourself.
(Skip to # The Script if you already know this)
Autohotkey works by simulating key presses. Anything you can do by pressing on the keyboard or moving your mouse. Cold Turkey Blocker has a system tray menu you can use to activate blocks, and you can navigate the system tray using button presses. We'll exploit this to get block activation using a keyboard shortcut with Autohotkey.
This is what the system tray menu looks like.
windows
+ b
to activate system traySpace
to open it upUp
or Down
the required amount of times to locate the cold turkey icon. Move it by dragging it around the mouse to a place that requires only one Up
or Down
press, preferably.Shift
+ F10
to simulate a right click. The menu should be open now, we'll activate it with arrow keys.Right
or Enter
Did it work? Congrats! Now you know what we'll make autohotkey zoom through for you so that you only need to press a single shortcut to get the block started.
In Autohotkey, the send
function makes the computer simulate key presses for you.
Special keys are also represented using these symbols:
; control -> ^
; alt -> !
; shift -> +
; windows -> #
So while send, hello
will make the computer type out 'hello' for you whenever its run, send, #s
will make the computer hold down the windows key and press s, activating windows search (try it!)
Follow this quickly to create your first script:
This is the script I use to activate it. Copy paste this in and test it out, making adjustments where necessary.
!f:: ; Press alt+f to activate
Winkill, Cold Turkey Blocker ;Close cold turkey so it's in system tray
send, #{b} ;Activate system tray
send, {Space} ;Open system tray
send, {Up} ;Go to the cold turkey blocker icon
sleep, 20 ;Pause
send, +{F10} ;Right click on the icon
sleep, 500 ; Pause
send, {Down} {Down} {Right} ;Navigate the menu
send, A ;First initial of the block I want
send, {Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down} ;Select the 'one hour' option
return
All done! This should be working now.
Now you need to start pressing alt + f the SECOND you start messing around on your computer. You need to start making it a knee jerk reaction, so that you can be free.
If there's anything stopping you from making it a habit, any service that's blocked that you might actually need because it's an agreement with someone else, fix it. Don't let that stay an excuse to not activate it.
—
Future me here: more power to you if this works for you, but I've found the problem with this solution is it still rewards and assumes aimless browsing is the default behaviour. I'm still trying to figure out how to resolve this. If you have any ideas, please let me know.