Skip to content

massix/dot-termux

Repository files navigation

Termux Configuration

Termux

Termux is an opensource, GNU/Linux environment for Android which is available for install on either the Play Store or the alternative F-Droid applications repository.

This git repository contains the configuration files I use with it, along with some scripts to facilitate the installation of a working environment on new devices.

At the moment of writing, this environment has only been tested on a non-rooted Google Pixel 7 Pro, although I plan to install the exact same environment on an old Samsung Tab A6.

Setup the environment

Before installing the different modules there are a couple of preliminary steps that need to be performed manually since they will pop confirmation dialogs up and need interaction with the user.

Install fish

Install the fish shell and set it as default, this is mandatory for the remainder of the installation process since all the scripts use the fish syntax (sorry bash!)

$ pkg install -y fish
$ chsh

Package manager

Setup the default package manager (pkg) and choose a mirror close to your location

$ termux-setup-package-manager
$ termux-change-repo

Storage access

If you need to access stuff on either your SD card or the /storage/emulated/0 folder (the writable part of the system’s disk):

  • Go to the termux application settings in Android and give it the permission to access the files, then
$ termux-setup-storage

This will create a storage folder in your $HOME. If you use orgmode, also create a symbolic link to the org folder in your $HOME:

$ cd $HOME
$ ln -s ./storage/org

Termux API

One of the Neovim’s plugin I use (https://github.com/massix/termux.nvim) needs to interact with the Android’s APIs, those APIs are exposed in the Termux environment using Termux:API, you can download it for free on the F-Droid store, afterwards you just need to run the command:

$ termux-setup-api

Modules

Some modules are handled, for each of them an installation script is provided, together with a corresponding install_module.fish.

Termux

This simple module will create a sane termux.properties file and copy over the 0xProto patched font from NerdFonts.

Git

Simple module that simply creates a .gitconfig file and stores it in the home folder of Termux.

Fish

The default termux environment comes with a bash shell, this module replaces that default shell with fish and some plugins.

This module will also install some packages which will be used by fish and NeoVim:

  • curl
  • ripgrep
  • bat
  • fd
  • fzf
  • uuid-utils, used by orgmode
  • tldr using tealdeer
  • broot

On top of that, it will also configure some useful environment variables to interact with the different tools. It also configures broot to use modal mode by default and a colorscheme which matches the overall style of the configuration (catppuccin-mocha).

Fisher

fisher is a plugin manager for the fish shell, it uses a plain text file to keep track of the installed plugins and gives you an easy access to new plugins which may be located remotely (on GitHub or even locally if you want to develop your own.

Tide

tide is a modern prompt for fish with icons, git branch display and other cool stuff. After installing you can easily configure it with the command tide configure

Z

Z is a directory hopper for fish, similar to the one which exists for zsh

Bang Bang

Bang bang is a plugin which adds a functionality similar to the !! pattern in bash.

Neovim

This is the biggest and by far the most curated module in this repository and probably the one which will see the most evolutions. This module creates a working NeoVim installation using Lazy.nvim and some plugins for productivity, including (list seriously not exhaustive):

  • orgmode to work with .org files
  • nvim-cmp to provide basic completion for most common stuff
  • nvim-treesitter for syntax highlighting
  • neogit to work with git repositories…
  • toggleterm to handle terminal buffers easily
  • telescope fuzzy finder
  • which-key to guide your next keystroke
  • venn.nvim to design beautiful diagrams like the one below
  • nvim-lspconfig to configure the LSP for Neovim

This is basically a tuned-down configuration of my main repository here.

DevOps

This module installs some useful tools to work on DevOps environments from the comfort of your smartphone. It installs azure-cli using the embedded libsodium library, it configures it with some defaults (take a look at the configuration file) and it also installs kubectl and k9s with a delightful catppuccin-mocha colorscheme.

Coding

This module allows for some basic development on Android devices, for now only the following languages are supported (with LSP where available):

  • C, C++ and derivates
  • Javascript and Typescript
  • typst for document writing
  • go with delve debugger