Managing my homelab from my phone with a Linux desktop, termscp, and Helix editor.
My previous post was about using a proot Debian desktop on my Android phone as a low-power workstation to manage my homelab. One of the challenges of a full Linux desktop running on Android (without root) is the lack of FUSE filesystems. With the combination of termscp and helix editor I can connect, pull, and put notes into my Obisidan vault from any destkop, including aarch64 on Android.
While working in my homelab, I need access to my Obsidian notes. Typically I work with a terminal, tmux, virt-manager, a browser (Vivaldi), and Obsidian vault opened with copious notes. My notes are stored remotely and synced to my desktops with Syncthing. For configurations like a proot desktop, I typically want to just mount the remote files with WebDAV via dufs.
But, no matter what configuration I use, I cannot mount WebDAV, NFS, or any other remote filesystem inside a desktop on Android. This is where termscp comes in.
termscp
It is no secret I prefer to work in the terminal and termscp makes accessing my files super easy. termscp is a TUI interface for connecting to various remote filesystems. Here’s some of the features listed on their Github:
- Different communication protocols - SFTP - SCP - FTP and FTPS - S3 - SMB - WebDAV
- Explore and operate on the remote and on the local machine file system with a handy UI - Create, remove, rename, search, view and edit files
- Connect to your favourite hosts through built-in bookmarks and recent connections
- View and edit files with your favourite applications
- SFTP/SCP authentication with SSH keys and username/password
For this setup, what is most important to me is accessing WebDAV. However, SMB and SCP access is also extremely useful while moving files around the various VMs on my homelab.
termscp install and config
There are various config options, including updating the theme. For me, all I want to adjust is which editor is used. The config lives in ~/.config/termscp. My only adjustments are to make ~/bin/helix my editor and set WebDAV as the default_protocol.
As you can guess, there is a aarch64 version, so I just grab the binary and drop into ~/bin that’s inside my $PATH.
If you have ever used a dual pane file manager you will feel at home in termscp. To edit the remote files, copy to the local device, edit, and the push to the remote connection. The keymapping is simple and I got the hang of it quickly.
Connecting it with helix is like chocolate and peanut butter.
Helix
I was recently introduced to Helix from this post on Mastodon from codemonkeymike. Helix is a full text editor and IDE for the command line. Much, much lighter than Geany and VSCodium. But, much more involved than micro, my other favorite command line text editor.
Now, I’m not a vim user and I’ve never dabbled with neovim. I am also not a developer. I install sprinklers for a living. So, I have a steep learning curve for a tool like Helix.
But I love it.
First of all, it is wicked fast. Second, it is still unbelievably fast even on low-end hardware (like my Windows Surface RT running Raspberry Pi OS) and my proot Debian desktop running on a (now very old) Samsung S10e. Third, it is a powerful editor with window panes similar to tmux.
I peeked at the documentation and it is extensive.
- Keymapping: https://docs.helix-editor.com/keymap.html
- Commands: https://docs.helix-editor.com/commands.html
- Install: https://docs.helix-editor.com/install.html
aarch64
I am using this out on an Debian proot desktop with [[termscp]] to pull/put notes. To install I’m grabbing the binary from the releases and drop somewhere in my $PATH, which for me is ~/bin.
When doing this, helix also needs its runtime folder, which comes with the download for the binary release. This needs to get copied/moved to ~/.config/helix/. Once this is done it will enable syntax highlighting.
Config
There is a default config file, but create one and place in ~/.config/helix/config.toml and it will be read on the next start.
Theme
Inside of ~/.config/runtime/themes are a ton of preset designs. I want a solid black background and feel more comfortable with a terminal type text and highlighting, so I went with term16_dark.
The syntax in the config.toml should look like this, right at the top of the file:
theme = "term16_dark"
Soft wrap
Soft wrap is not enabled by default. To enable, edit the config like this:
[editor.soft-wrap]
enable = true
max-wrap = 25 # increase value to reduce forced mid-word wrapping
max-indent-retain = 0
wrap-indicator = "" # set wrap-indicator to "" to hide it
How its been going
As you can tell, I love this setup. There has been a learning curve for both tools since I don’t use them daily. I spend most of my time digging holes and laying pipe.
Being a pipe laying motherfucker, vim and git aren’t natural to me, but I have picked up termscp and helix quickly. Having these tools configured and in my toolbelt, along with a full desktop browser, virt-manager, and other basic Linux utilities, I can work on my homelab in a environment I’m comfortable with right from my phone.
Most times I work at my desk with my phone connected with a dock. Sometimes I’ll hang out on the couch using my lapdock while watching a movie with my wife. I am feeling more and more like my phone is my best computer. When I want to work on a Linux desktop, I can. Otherwise I have access to a solid desktop experience with Dex-mode. Right now I have both running at my desk while I write this post and do a few extra things on my LAN.
I honestly see a Samsung S8 or S9 tablet in my future.
- - - - -
Did you like this post? Give it an upvote by clicking on the arrows below! Sending me an upvote is like you and I giving each other a high five.
🙏 😎
Thank you for reading! If you would like to comment on this post you can start a conversation on the Fediverse. Message me on Mastodon at @cinimodev@masto.ctms.me. Or, you may email me at blog.discourse904@8alias.com. This is an intentionally masked email address that will be forwarded to the correct inbox.If you enjoy the random stuff I write here, post to Mastodon, or watch on YouTube, and are feeling generous, I am open to tips of Ko-fi.