Raspberry Pi Writerdeck with DietPi

Setting up a minimalist text-based writing rig cheaply and with parts you may have lying around your house.

← Back to index

Introduction

That's right, you're interested in setting up your own minimalist distraction-free bullshit-free desktop-free Raspberry Pi writer deck. Right? OK. Let's do it. This whole process is about simplicity, and so I've aimed to make this as simple as possible, but still complete, even here in the instructions. If there's anything I left out, let me know. But you should have everything you need here to set up a minimalist text-BASED Emacs writing environment on a cheap-ass mini-computer.

What are you waiting for?

What you'll need

This is a basic unordered list of things you will need to complete the project:

  • Some Linux knowledge or a comfort level sufficient to copy and past commands
  • Raspberry pi (mine is a RPi 3 Model B+)
  • USB flasher for SD card formatting
  • DietPi OS
  • USB keyboard (for creative typing!)
  • SD card (8GB+ recommended)
  • Power supply

Theory

Why do this? The idea of having a friction-free writing environment is all about simplicity and functionality. It's absolutely not necessary to do this if you just need a low-resolution, minimalist writing environment. You can simply use pen and paper. However, there are some kinds of writing that are either much easier on a computer or require a computer (like the famous "writing into the dark" edit-as-you method). For those types of writing and writers, computers are just better and you need one, and if you need one you might as well dedicated to just-writing like an old school word processor.

If I had to sum it up, that's basically what you're doing here: setting up a computer that functions solely for writing, like an antique word processor.

Writing is a simple task that hasn't changed much since the invention of papyrus and quills and on through typewriters and personal computers. However, contemporary computers require a level of functionality that necessitates installation of distracting software like web browsers and notification dinging utilities and all kinds of things that can simply PoP-uP! and chill your focus and ruin your writing streak.

So, minimalist "writerdecks" have popped up to answer this need. The directions contained herein are how I made my own writerdeck, and you can follow this if you like my particular recipe.

Getting the DietPi OS on your Pi

Raspberry Pi OS Lite would also work for this, but DietPi is leaner at about ~200MB base and ships with a TUI installer (dietpi-software) for picking out software you'll want and some nice config menus for doing your network configuration and stuff like that. No desktop is installed by default—which is great because we don't need or want one—you'd have to explicitly add one if you want it.

Just get yourself a copy of the DietPi OS ISO and flash it to your SD card. I use the Raspberry Pi Imager program because it's easy and DietPi is already available as an option. It couldn't be easier than that. And you don't have to risk your drive safety with a poorly formatted dd command.

Now, once you've got a nicely formatted SD card just pop it into your Pi and power that bitch up. That's it! The rest is just configuration.

Network setup

If you want to be REAL minimalist and distraction-free, you can skip over this section and not do Internet. I think that's pretty crazy and maybe impossible because if you want to do what I'm doing you'll need Internet at least for installing some packages (like Emacs). DietPi doesn't have vim (as if you'd want to use that anyway). But it does have nano.

I'd advise opting for Internet. You'll also need networking for sending your git repos around (which I use to sync files with my production desktop). Yo, let's do this.

Run dietpi-config → Network Options → WiFi.

  1. Set Country to US (or wherever you at, it's actually important to get this right)
  2. Scan → pick your WiFi network → enter your password.
  3. Toggle Auto Reconnect to [On] so it reconnects after reboot/outage.
  4. Apply.

Verify with:

ip addr show wlan0

Note your self-assigned IP for SSH later.

Software installation

DietPi comes with its text-based software shop where you can browse vairous packages install what you like.

Run dietpi-software, browse to Development and Programming, install:

  • Git
  • Build-Essential (compilers and headers)

This is the basics, you'll need at least those going. I actually couldn't find build-essential last time I ran the dietpi-software program but maybe that was just me that day, and it was easy to just install it with apt. So if you just want to use apt that's fine! I just wanted to make sure you had both options.

I've included some other software I like in order of importance:

sudo apt install emacs-nox git
sudp apt install tmux pandoc aspell aspell-en 
sudo apt install python3-pip python3-venv pipx
sudo apt install fonts-terminus console-setup

Pick and choose what you like. It is your pleasure and privilege to do so.

For you Emacs users

Please note that emacs-nox is the terminal-only (super BASED!) version of Emacs with no X11 dependencies. I would advise installing this flavor of Emacs to keep our build light and fluffy. Why install anything we don't need?!

pipx goes in our Python stack because it's a special package for installing CLI tools written in Python without having to bother with a virtual environment. This should be of use to you if you plan on using my Python-based CLI writing organizer tool, Binder.

About binder

You can skip over this part if you're not planning on using Binder.

Once you have pipx installed you can simply clone the binder repo like this:

git clone https://github.com/cryptstopher/binder.git

Then do the normal install process:

pip install -e .

And open a directory into which you want to install the manuscript skeleton directory structure and do this:

binder --init
# Add chapter files to draft/ (e.g., 1_Chapter_One.txt)
binder --bind

Aiming for simplicity here, but also completeness. I would recommend binder if you're writing fiction in plain text.

Your console font

This is a big one. Because we're not installing an X window server or anything like that, and we're staying all text-BASED, you will actually change your type and font settings at the kernel level. I know that sounds more intimidating than it is, so let's just see how easy it is.

sudo dpkg-reconfigure console-setup

Choices that worked well for me:

  • Encoding: UTF-8
  • Character set: Guess optimal for you
  • Font: Terminus
  • Size: 16x32 (large, very readable for prose)

Apply immediately without reboot:

sudo setupcon

You'll notice when you're back at the prompt, your font is noticeably more readable. But we're not done with the typography yet. We want our writerdeck to simulate an old school word processor like WordStar, so we need to change some colors.

The amber CRT look

Now we're getting into the fun stuff… a e s t h e t i c s of retro computering.

Linux console supports palette remapping via escape codes. So all you got to do is add this jazz to your ~/.bashrc:

if [ "$TERM" = "linux" ]; then
    echo -en "\e]P0000000"  # background: black
    echo -en "\e]P7ff6600"  # foreground: warm amber
    echo -en "\e]P8555555"  # bright black
    echo -en "\e]PFffb000"  # bright white: amber
    clear
fi

Apply:

source ~/.bashrc

You can stop here

I just want to congratulate on your on setting up your nice Raspberry Pi writerdeck. Your system is fully functional now, and you don't need to go any further if you don't want to. But you may notice there's some stuff you might want.

  • SSH service, a nice way to connect to your Pi and transfer files, and stuff like.
  • Git repository configuration, for version control and also a way of moving files around.

If you want to get some of this awesome stuff going, you will find more information below. SO MUCH INFORMATION!

SSH configuration

You'll need a way to connect remotely to your Pi writing station. SSH is great for this. DietPi ships with something called Dropbear on port 22 (the standard SSH port), which is going to block OpenSSH.

Either use Dropbear for connection or shut it down and use OpenSSH. I opted to shutdown Dropbear and use OpenSSH, just because I'm more familiar with it.

sudo apt install openssh
sudo systemctl stop dropbear
sudo systemctl disable dropbear
sudo systemctl enable --now ssh

Verify it's listening:

sudo ss -tlnp | grep :22

From other computer, to test reachability:

nc -zv <self-assigned-ip> 22

Then connect:

ssh dietpi@<self-assigned-ip>

Turn the Pi into a local git server

Now, you can move files around in any way you like, but I'm already using git extensively in my writing process, so it's a natural choice not only for version control but also for redundancy and file transfer, etc.

For this setup, I'll presume you have the Pi (obviously) and, let's say a laptop also running a Linux or Unix-like OS of some kind.

Basic workflow: set up bare git repo (basically a git install with no files in it just a repo) on the Pi (separate from your working directory), and you have working directories on both the Pi and laptop, both workstations push/pull to the bare repo.

Create a bare repo on the Pi

Ok, let's do this first. Set up a bare git repo for your project on the Pi. Remember, this is separate fro the project directory itself. So I put any git repos into ~/git, but you can use any directory on the filesystem you want.

mkdir -p ~/git/projectname.git
cd ~/git/projectname.git
git init --bare

Clone the bare repo as a working copy on the Pi

Since the bare repo is local, no SSH needed — just clone from filesystem path:

cd ~
git clone /home/dietpi/git/projectname.git

That will create a git-working-directory called projectname wherever you did the clone command. If you want to name that directory something else, you can put the desired directory name as argument to the above command:

git clone /home/dietpi/git/projectname.git my-great-American-novel

Now you'll have a directory matching this:

~/my-great-American-novel

The benefit of starting from a clone of a bare repo is that it already has the remote location set up. So if you want to push to the local repo, you can just do a push and you're done. This remote is going to be labelled "origin" by default, but you can make it anything you want!

Push an existing repo from laptop to the Pi's bare repo

If origin doesn't exist yet:

cd ~/path/to/project
git remote add origin dietpi@<self-assigned-ip>:/home/dietpi/git/projectname.git
git push -u origin --all

If origin exists and needs to be repointed:

git remote set-url origin dietpi@<self-assigned-ip>:/home/dietpi/git/projectname.git
git push -u origin --all

Standard git workflow (pushin' and pullin')

This is basically how you will move your files between workstations and also keep your project up-to-date.

Where Command Purpose
laptop git push Send commits to Pi bare repo
Pi git pull Get those commits locally
Pi git push Send commits to bare repo
laptop git pull Get those commits

Example: let's say you've been doing your writing on the Pi workstation, but you're going to be out-of-office for a while and want to continue to working on the laptop; so just push new commits to the local repo on the Pi and pull them down to the laptop, and you're golden.