My New Favorite Phone Game: termux

 A lot of people when bored pull out their phone and play games.  Games just don't do it for me for some reason.  I mean, I played chess for a while, and recently I tried Shoot Bubble and 5 Dice (generic Yahtzee), but for some reason I always forget I even have them available and I end up just scrolling Twitter :-/  My feed is pretty good, if someone gets overly political or negative (usually its a combination of the two) I block them, but stuff still leaks in.  Usually if Twitter is holding my attention for a long time it's because it's making me angry.  I don't like that.  I think I've found a better solution for when I'm bored and pull out my phone: termux.

Termux is a linux command-line environment for Android.  It's a kinda like wsl (or cygwin if you are old like me) or Terminal.app, but for your phone.  It's almost linux but not quite.  Normally I find that very frustrating, especially if I'm trying to get real work done (you may have seen my past blog posts here or here or here or here, for example), but I'm actually enjoying just playing with termux and seeing what it can do.  Apparently Frustration Games is a popular genre now (I'm old enough to remember when they were all Frustration Games), and I'm liking this one!

To be completely honest, I've actually been surprised at how not frustrating it is.  I'd say it's better than trying to get a linux-like environment on Windows or Mac, except for the minor detail that it's on a phone with a tiny screen and no physical keyboard.  I've actually been able to install emacs and python and write a very (very!) basic little SystemVerilog parser, and test it!  And use git to version it!  I'm kind of amazed.

Some things I've learned about termux:

  • The app store version is old and broken, get the apk from github and install that
  • You can use apt to install packages, but the built-in termux pkg command is more convenient (you can type pkg in instead of apt install, which makes a difference using your phone keyboard)
  • It has built-in scripts that do nice things:
    • termux-setup-storage to make it easy to access your files
    • termux-change-repo to easily pick a package repo or group of mirrors
    • termux-backup and termux-restore to backup and restore your environment
    • probably others I wish I knew
  • You can install dropbear for ssh because you are thinking this is a phone and slim simple dropbear would be efficient and cool, but dropbear doesn't support a ~/.ssh/config file
  • When you do pkg remove dropbear it removes dropbear and conveniently installs openssh in its place
  • I use gnu screen (not tmux. Again, I'm old) and I've changed the default ctrl-a to ctrl-j instead, but for some reason ctrl-j j is treated like ctrl-j ctrl-j on termux
  • Files are owned by root and I can't change that
  • I can't make a script executable, it seems.  Hmm, I wonder about a compiled binary?
  • The filesystem is pretty slow, something like git status takes a loooong time
  • Termux hard-codes the DNS server to be 8.8.8.8, it doesn't use whatever the rest of Android is using

I'm sure there's more that I'll come across, but I figured this was enough to fill out a blog post at this point.  If you are looking for a new activity for your phone, give termux a try.

Comments

This blog post is really interesting! I like your enthusiasm and exploratory spirit towards Termux. Your comments and observations have given me a deeper understanding of this app. I hope you continue to enjoy using Termux and share more about your experiences with it!

Popular posts from this blog

SystemVerilog Fork Disable "Gotchas"

'git revert' Is Not Equivalent To 'svn revert'

Put /etc Under Revision Control (with git)