iPhone as portable terminal

..

2021-07-11

I've previously written about installing Lastpass-CLI in the command line on iSH, a virtual machine running Alpine Linux that you can run on iOS.

Accessing Lastpass on the command line in iOS

Here are some other programs and games I run on my iPhone. But mostly, I'm using this as a portable Linux terminal, sometimes with an external keyboard plugged in. This isn't nearly the same as using my laptop. It's not a coding machine. It's just a way to have a basic portable linux terminal.

On the one hand, maybe I should be using 'devices' / computers less often and instead carry just a book. I do tend to have a book with me, and my moleskine cahier notebook, but I do like having this terminal mostly for longform writing with the keyboard. I feel a little sheepish to be this needy to always have a computer on me though. But I'll detail my setup:

Beyond the things I'm detailing here, you may want to read the Alpine Newbie apk packages wiki page.

Alpine Newbie apk packages

On the phone without a keyboard plugged you'll need to use the onscreen buttons for the escape key, control, tab, paste. When you plug the external keyboard in, the onscreen one goes away.

The external keyboard I use is a tiny mechanical keyboard, the Keyboardio Atreus. It's case can even hang off a belt, and it holds my connection adaptor and usb-c cable. I slip this in a backpack and bike to the river or park, pull out my phone, connector and keyboard and have a little setup for writing, blogging, editing.

Keyboard.io Atreus

Here's some basic packages you may want. Remember to use apk add to install package. You can install many at a time by adding multiple after apk add. In Alpine Linux the man-pages aren't added as default. Usually there will be a separate package with the -doc added to the end.

git
python
pip
dialog
dialog-doc
neovim
nano
nano-doc
fish
less
less-doc
ssh

After this I usually use git to clone my dotfiles or just import my neovim and vimrc file.

Fish shell

Not just essential on my home computers. When you're typing on a phone you want all the autocomplete and suggestions you can get.

After installing fish you can change the default ash shell to fish by editing the file /etc/passwd The first line of this file should be edited to specify your preferred starting shell:

root:x:0:0:root:/root:/usr/bin/fish

ssh

I use ssh to connect to servers. I regularly log into the Ctrl-C.club tilde this way, which also lets me run software installed there like Amfora.

Nano / Emacs / Neovoim / Vim / etc

It's very simple to install the CLI editor of your choice. With an external keyboard you can easily construct your own cyberdeck. I'm mostly using Neovim for taking notes, editing this gemini capsule or editing system files. Vi is already installed.
apk add neovim

Neovim is launched with the command nvim by the way.

Nethack

Works surprisingly well if I need a 'gaming' break (lol), even on my iPhone SE and even with the onscreen keyboard as long as I turn my phone sideways, though using an external keyboard will give back much more screen real estate.

I won't go into this game in much detail beyond to say it's a classic roguelike and requires knowing vim-keys (hjkl) to move instead of the arrow keys.

Hopefully that's enough to get started and to encourage you to explore further.

You can comment on this post by sending an email to the email listed on the index page.