TypeWryter is a terminal application designed for distraction free writing. It doesn't allow any fancy editing. You can write and you can backspace, thats it; preventing the urge to go back and edit. Files save on every carriage return.
This code is a heavily modified version of zerowriter since they had a very good head start on developing this sort of project. Their project is awesome, but is a little different and will have a somewhat different featureset.
- Set up Raspberry Pi with Waveshare 4.1in epaper display - More info available on Waveshare's Website
- Update apt:
sudo apt update
- Upgrade available packages:
sudo apt upgrade
- Update apt-get packages:
sudo apt-get update
- Enable the SPI interface on your Raspberry Pi
sudo raspi-config
- Choose Interfacing Options -> SPI -> Yes Enable SPI interface
sudo reboot now
- Check
/boot/config.txt
, and you can see 'dtparam=spi=on' was written in.
- Install The following (E-Paper Dependencies):
sudo apt-get install python3-pip
sudo apt-get install python3-pil
sudo apt-get install python3-numpy
sudo pip3 install RPi.GPIO
sudo pip3 install spidev
sudo apt install python3-gpiozero
- Install QRcode:
sudo pip3 install qrcode
- Install Flask:
pip3 install Flask
- Install Keyboard:
sudo pip3 install keyboard
- Clone this repo.
git clone https://github.com/RyWhal/TypeWryter.git
- Run it from the TypeWrytes directory with:
sudo python main.py
Optional:
- Install the Pi-Sugar tools, including battery monitor:
curl http://cdn.pisugar.com/release/pisugar-power-manager.sh | sudo bash
I used Raspberry Pi OS (64-bit) Lite. You can use whatever you want, but you may have to tweak minor things.
You can use whatever method you want to make the application on boot (crontab, rc.local, etc.). I chose to set the application up as a systemd service.
/etc/systemd/system/typewryter.service:
[Unit]
Description=TypeWryter free write service
After=multi-user.target
[Service]
Type=idle
WorkingDirectory=/home/logmein/TypeWryter
ExecStart=/usr/bin/python3 /home/logmein/TypeWryter/main.py
RuntimeDirectory=TypeWryter
ProtectSystem=full
StandardOutput=append:/var/log/TypeWryter/systemd_output.log
StandardError=inherit
[Install]
WantedBy=multi-user.target
After you create the service you run:
sudo systemctl daemon-reload
--> to reload the systemctl daemon to include your new servicesudo systemctl enable typewryter.service
--> to enable the service on bootsudo systemctl start typewryter.service
--> to start TypeWrytersudo systemctl restart typewryter.service
--> to restart TypeWrytersudo systemctl status typewryter.service
--> to check service status
- Unable to connect to wifi-networks from within the TypeWrytes application*
- Unable to connect to bluetooth devices from within the TypeWrytes application*
- Scrolling back in text history is not working.
- You cant rename a writing session.
*note: This application is meant to act almost as the OS for my WriterDeck, FreeWrite, TypeWryter, whatever. The plan is for the Raspberry Pi to boot straight into this software when you turn it on. So the software needs to handle some of the things the OS would usually handle. These things that I cant do yet (wifi, bluetooth) only matter if you're not doing them ahead of time in the OS.
If you navigate to Menu --> Network File Browser --> Start Server
A local Flask webserver will spin up on whatever device is running TypeWryter (note the Flask package must be installed on your machine via pip install Flask
)
TypeWryter will present you with a url, QR code, and 4 digit password. You can either visit the URL, or Scan the QR code, and then enter the password to see the files on your TypeWryter.
- Raspberry Pi Zero 2W - https://www.raspberrypi.com/products/raspberry-pi-zero-2-w/
- 4 inch E-ink display - https://www.amazon.com/gp/product/B074NR1SW2
- External battery - https://www.amazon.com/gp/product/B08D678XPR
- Case - modeled in Fusion 360 and 3D printed. I'll share the STL files once they're finalized.