Mobile computing

Mobile computing is a pain, and even more so if there's no proper desk and chair. Balancing between neck pain and unconfigured software, fighting WiFi using a small and weird keyboard, on a small screen and a slow system, with a battery running out, and quite possibly while being out of one's comfort zone (being driven to use such a setup) and having other things on one's mind, what makes it harder to focus – that's just a brief outline of computing using a portable computer.

I've been stuck with an old netbook for a few weeks, so wrote down some of the things I've learned. That's on Debian stable (Stretch was just released; using it with "non-free" repositories to get GNU documentation), with i3 window manager, and using emacs for most of the tasks.

WiFi is one of the most important things to set. This time, both wpa_cli and wicd claimed that the password is wrong, but nmtui (NetworkManager TUI) has connected just fine – though maybe it has messed up some settings for others somehow. Wicd was hogging resources even while not doing anything useful, as Python programs tend to do, so I've disabled it – it rarely worked anyway. wpa_supplicant writes log messages such as "result=4" and doesn't document those codes in its man page, requiring source code to see what's going on. And NetworkManager just repeats those.

Firefox just starts for 30-40 seconds, and then lags even without JS. I gave up on it, and finally switched to w3m (emacs-w3m); web services such as online banking may not work there, but it is keyboard-friendly, works, and does not lag too much. A handy snippet, borrowed from twb on #emacs at Freenode (the channel is very nice and helpful in general) – to open links in w3m if it's available:

(when (and (fboundp 'w3m-browse-url)
           (executable-find "w3m"))
  (setq browse-url-browser-function 'w3m-browse-url))

To use DDG for search, one should customize w3m-search-default-engine.

As for maps, there is FoxtrotGPS – an OpenStreetMap client that can cache and pre-download maps. It's pretty lightweight and usable.

For video playback, VLC appears to be more reliable than mplayer, even though has a bunch of issues (including bloating, lack of documentation, and resource hogging even while idle). Unfortunately, many videos are not available via bittorrent, being only hosted on youtube.com or similar websites; youtube-dl works to extract those.

One of the painful tasks to perform without a mouse is to copy and paste things between a terminal emulator and other programs (such as GUI Emacs). Actually it's somewhat awkward with a mouse, but even worse without it. Well, emacs-to-terminal-emulator is easy: there are M-w to copy from emacs and shift + insert to paste into a TE. Copying from a TE can be done by selecting with a touchpad, and then M-: (mouse-yank-primary (point)) RET in emacs, though it won't work to insert into a TE; but turns out that one can emulate the middle mouse button by pressing the two touchpad keys simultaneously. It's not great, but works; perhaps a nicer way is to use a terminal multiplexer functionality for that, though then one may have to use nested terminal multiplexers, if they are also using those remotely. Or one could use an emacs TE instead of a separate one, but that could also get awkward.

Speaking of terminal multiplexers: even though normally I'm not using tmux, it is more useful to run remotely with an unstable connection: a remote persistent session partially compensates for the lack of a persistent connection and/or local session.

Doing Haskell programming would be a pain on a netbook because the REPL and cabal would require too much resources, so I'm planning to use a remote server for that: just run both emacs and a REPL process there.

xpdf, mupdf, and zathura are relatively lightweight and portable PDF viewers. Xpdf has ugly GUI buttons and a mostly useless left pane that takes space, others use partially qwerty-oriented (vi-style) key bindings (while I'm using colemak), and the scrolling is quite messy in both mupdf and zathura (in mupdf, there's no way to tell whether you're at the end of a page or not, but scrolling by a little amount would jump a page if you're at the end; zathura may skip a line when scrolling with spacebar). Both xpdf and mupdf allow to adjust colors, zathura doesn't. So I'm using both mupdf and zathura.

Bittorrent clients are not so nice to set and use: both rTorrent and Transmission (transmission-daemon with transmission-cli) have broken emacs interfaces, which I gave up on after brief attempts to debug, since using a netbook doesn't make debugging more fun. Transmission is nicer in that it uses a daemon, which is more suitable for a program like that. To simplify authentication, one should either use netrc (.authinfo.gpg), or disable authentication and only allow local connections:

"rpc-authentication-required": false,
"rpc-bind-address": "",

Then it's not so bad to control with transmission-remote: -a and -w options to add a torrent and write files into a specified path, -l to list tasks, etc. The Transmission IRC channel (#transmission at freenode) is quite helpful, and minor bugs get fixed quickly there.

The situation with music players is pretty similar. I've tried mpd multiple times before, and it never worked, but worked this time (well, after mpc update); mpc is usable to control it, even if not that fancy (i.e., plain CLI). There are some emacs packages: emms supports mpd, but tries to handle all kinds of players, so the support is not so great; bongo seems to have nicer UI, but doesn't support mpd at all; mingus appears to work, but it refreshes its whole buffer all the time, resulting in annoying blinking and rendering it unusable. And there is ncmpc, which is fine; though ncmpc-lyrics has a lot of dependencies, including Ruby. Music playback seems to be one of the most resource-consuming tasks in a system with minimal bloat.

That's it: the rest of my regular software is keyboard-oriented and doesn't hog resources: mu4e with mbsync for mail, circe for IRC, bitlbee and circe for XMPP, org-mode for notes and things like that, and other emacs-based and CLI/TUI tools.

Some people (including myself) like to think that all they need is an internet-connected computer, free time, and some basics to survive, but apparently it's not as simple: a clean and hygienic environment, privacy, comfortable desk and chair, silence when needed, sufficient sleep, and comfort in general are needed to minimize distractions, and to stay focused long enough to do fun computing-related things. Otherwise it's more tempting to go outside, walk, eat out, sleep, and just escape the environment somehow – what's often deemed as fun, but is less satisfying than working on hobby projects or learning interesting subjects (to me, at least). It's quite scary how one can be affected by an environment in such subtle ways, possibly not even noticing how restrictive it is. But on the other hand (and on the more optimistic side), such restrictions imposed even by portable computers may push one to dig deeper, and to look for more: I've learned about a few programs myself during it. After all, it's unsatisfaction that leads to improvement, and virtually any choices lead to some kinds of restrictions.