Useful for writing things where you need a lot of soul searching than google searching.

Put this script anywhere in your $PATH, and make it executable. Call the file ‘write’ maybe. And use it by typing ‘write’ from terminal.

#!/bin/sh
set -e
sudo systemctl stop iwd
vim ~/documents/journal.txt
sudo systemctl start iwd
echo "gg"

This is what it does:

  • Stops the iwd service that’s responsible for internet access.
  • Then it opens the file I want to work on in vim.
  • I do my writing
  • Once I exit vim, iwd is started again, restoring internet access.

Updated: