my linux nerd toolbox August 29, 2017

Geeks! Some of you asked for it, and I'm not –yet 😄– web-famous enough to be on usesthis, so here's a blog about my setup! Hope you find useful bits 🙂.

Without further ado: 🔥 🎆 🎇 my linux nerd toolbox 🎇 🎆 🔥 .

Hardware

As admirably summed up by Peter Welch, tech jobs rarely involve a "4700-hour week digging a tunnel under Mordor with a screwdriver", but damaging ourselves as little as possible doesn't seem like premature optimization. So,

  • TypeMatrix keyboards don't suck: narrow (thus bringing the mouse within closer reach), orthogonal, Enter + Backspace in the middle (thus accessible to both hands). Oh, and their blank (label-less) version helped forced me learn to touch-type, which you should do. Not sure about the orthogonal layout? Fine, but really, do yourself a favor and buy a narrow/compact keyboard without numeric keypad, it makes for a more natural mouse position.
    • On the software side of keyboards, I roll with a custom xkb layout. No Dvorak for me, it's a vanilla US layout (for a. commonness and b. uncrazy brackets placement), spruced up with frequent-for-me characters behind the Alt dead key: local ones (French â é ê ô ù), conveniences (→ ↔ ← ≠ ≥ © – —), and common emojis (👍 🙂 😄 😕). As to why a dead key making Alt+e into é is any better than, say, a US International layout converting 'e to é, it's because this 'e logic gets in my way when I need to type let animal = 'elk'. See that gist; it's a bit similar to that European layout.
  • A vertical mouse (e.g. Evoluent or Logitech) that doesn't twist my wrist. Say that again? Friends don't let friends twist their wrist.
  • A big screen and beefed up font sizes in apps where I read a lot (email client, code editor, etc). I'm myopic, and can't help to occasionally bend my neck to get closer to the text. Getting a 27" screen at work accidentally solved a years-long shoulder/neck pain; I thought I had good ergonomics & posture, but it turns out I frequently unconsciously sat in terrible bent-forwards posture.
    • Also, no multi-monitor, it's a recipe for potentially long sessions with the head skewed towards a non-centered screen. I get along just fine on one fat monitor thanks to simple window/splits management and efficient window switching (read below about marathon).
  • Desk at a height that lets my forearms rest, monitors centered and just below my eyes (computer ergo 101).
  • Chair? At work, I thought I liked fancy Aeron chairs, until I realized a simple sturdy & cushion-less chair supports my lower back even better. At home, a DIY standing desk. The sitting at work / standing at home yo-yo is 👍.

OS

Code

  • Whatever language to get a specific task done:
    • At work I'm doing okay with modern node.js, which TypeScript makes usable. Curious to see if Deno picks up. I'd like to give Erlang / Elixir a try one of these days: much of the pain in web/backend software lies in distribution and communication while growing, so seeing these concerns baked in the language itself is attractive.
    • I like Python 3 too for the respectful community, the attitude, and the reliable, batteries-included stdlib (fuuuu the npm ecosystem and the typical mountain of micro-packages 🤬).
    • I don't have much low-level experience. Didn't write much C and am not eager to write C++. Gave Rust a try some time ago; I want to love it because the tech & community & attitude are giant balls of light, but it's a tough love. Maybe next time I try it, both of us will be wiser.
    • Babbled with löve and Godot for gamedev attempts, and will babble again.
    • Before inflicting a shell script upon earth, I reach for ShellCheck's help through a plugin for my $EDITOR.
    • Regular expressions are our friends. Play with them on regex101.
  • These days, for an almost-IDE-like experience but lighter and more bendable, I like VS Code, with a few common extensions.
  • The vvvery full-featured DBeaver helps me SQL.
  • To build interwebs, my framework of choice is—WHOA WAIT. This would be a worthless piece of information, as these things change faster than a request-response round-trip these days. I'll quietly pass by the flamewar, muttering that when I don't want to start a web project with (choices ✕ more choiceshey, other choices), my rules of thumb are to:
    • Pick popular-and-stable.js for good StackOverflow factor.
    • Roll with static when I can. This blog is built with obscure-but-oh-so-cute-and-hackable chisel. But ignore this and just pick the most popular static site generator for your favorite language.
    • Barf HTTP with vscode REST Client > Insomnia > httpie > cURL.

Short feedback loops everywhere

... or I go crazy. Things like automatically running tests/rebuilds on file changes (with entr or full-blown incrond), js Hot Reloading, or serving static HTML from the devd live-reloading http server.

Shell

The fish shell is {smart, full-featured, friendly} by default. That being said, out of the interactive shell I don't like the exoticism of fish as a scripting language; I keep preferring shebanged, shellchecked, defensive (ba)sh scripts, they're a stable and portable evil I know.

  • Shell used to happen in gnome-terminal / Alacritty + tmux, whose config & scrollback watness made me look a long time for a replacement. I wanted to love Tilix, but lack of scriptability and keyboard-friendliness made me look further, until I found the powerful and almost sane-by-default Kitty.
  • Git: a few human aliases to interact with the borg, tig for a nice interactive text interface, delta for human-friendly & syntax-highlighted diffs, background cron fetching of work repos. I try to write good commit messages (another take from Greg Ward), and git bisect makes me cry tears of joy each time it lets me isolate the occasional case of hey-here's-this-regression-compared-to-our-last-version-published-six-months-ago-can-you-fix-it-now.
  • Vanilla grep/find/cat are good, but ripgrep/fd/bat are I CANNOT EVEN.
  • I like to run taoup on interactive shell startup.
  • manpages are good but tldrpages are terser.
  • After too much profanity towards the vanilla vi in a ssh-ed server, I mount a pseudo-local folder using sshfs, grin, and enjoy my local toolshed.
  • rsync for backup/deploy chores. Pronounced à la française: ère-cinq.
  • grc helps me colorize unhelpfully-white server logs.
  • sudo-globally-installing python/node command-line tools invariably ends up in divorce with your package manager, so I install those locally:
    • python: pip install --user foo
    • node: npm i -g foo with export npm_config_prefix="$HOME/.node_modules"
    • ... then expose local binaries with export PATH="$HOME/.local/bin:$HOME/.node_modules/bin:$PATH").

Interwebs

Through Firefox, because Mozilla cares about the web & me more than T̛h̶͝e͏ G̶̀o͜o͘g̛. Nightly channel, to get features in my grubby hands 12 weeks earlier, at the cost of the occasional crash that I happily report to the fine folks at Mozilla.

  • Tons of prefix-based keyword searches using the magic %s token, for direct focused searching without any Google / DuckDuckGo hop, like:
    • Searching for a local place in my city (montreal)? Keyword search mon museum will expand that to https://maps.google.ca/maps?q=%s, Montreal QC
    • French Wikipedia? frhttps://fr.wikipedia.org/wiki/%s
    • Etc. Try them! They're amazing.
  • De-cluttering of frequently-used websites through userContent.css, and browser prettifying with userChrome.css + Browser Toolbox.
  • A minimal set of extensions, because I grew a sane suspicion about them (degrading performance, leaking information):

Routers run OpenWrt and its awesome DNS-based ad/abuse domain blocking package, as baseline interjunk bouncer in vanilla browsers and mobile apps. It's like a router-builtin Pi-Hole, with even less config hassle 🙂.

The tech interwebs I like are RSS through Feedly Pro and HN. Then, to cut down on aimless FOMO addicto-HN-browsing, I enjoy the weekly/monthly newsletter format. For me it's hackernewsletter, Exponential View, Schneier, but look at a selection and pick your poison. Real World News™ reaches me through the radio or podcasts, which are 👌 while cooking or doing housework.

Desktop Environment

Is GNOME, for the elegance, continued refinement, and amount on eyeballs looking at it, at the cost of A. designers occasionally sawing a UX branch I was sitting on, and B. being shoved down the throat a language that I can appreciate to serve web pages, but which for a desktop environment is garbage (-collected), leaky, perf-adverse, and whose shakiness is made shakier by GNOME failing to provide a stable documented extension API, forcing extension authors to do brittle monkey-patching that makes them (and me) crazy because their code breaks at each release. I'll probably switch to MATE or Xfce or LXQt next time things break. Delaying the switch because, when it works, and accepting that .0 releases are generally kinda broken for a month, it's polished.

  • Alt+Tab-ing, clicking buttons on a taskbar, or using a slow-as-molasses Activities menu are inefficient and distracting. I focus windows (usually maximized or half-split) using my little marathon which lets me bind keyboard shortcuts to focus/launch apps.
  • Shell's Super + {Left, Right} keyboard shortcuts makes for dead-simple window splits without going all the tiling-WM way.
  • Theme nits; Ctrl+Shift+I in any GTK3 app started with GTK_DEBUG=interactive to pop the inspector. Persist changes in ~/.config/gtk-3.0/gtk.css.
  • Nautilus scripts are nice to automate common file-contextual tasks.
  • Autokey for text expansion and simple X scripting.
  • A few UI changes with GNOME Tweaks, and a few extensions: Better OSD, K/AppIndicator Support, GTK Title Bar, Clipboard Indicator, Emoji Selector, Pomodoro.
  • Fonts? I like them thick, for readability. So, in the terminal & editor I roll with monospace Cascadia or Ubuntu Mono, but pick your favorite with Programming fonts test drive. And for graphical / non-monospace, I like Ubuntu Regular.
    • Hideous Arial, Verdana, Calibri and, gah, Courier New still used by many sites make my eyes bleed, so a fontconfig replace rule fixes that. Also, fontconfig emoji tweaks. Also, you want to set sexy default fonts in Firefox prefs.

Miscellaneous

  • Non-code creation:
  • Miscellaneousmiscellaneous :
    • Clementine is the only featureful-yet-suckless graphical Linux media player I tolerate (hail foobar in Windows-land). MUBI sells an awesome movie selection for CHEAP per month, and I get subtitles for the occasional illegal flick in seconds from VLC's VLSub extension.
    • When I want to bundle/isolate a heavy or privacy-intrusive webapp, nativefier behaves like I want. That is, opens links in my $BROWSER.
    • I help mom with TeamViewer.
    • Wine runs the occasional Windows app. Steam gaming happens on a dedicated Windows box, where an nvidia GPU doesn't mean death-by-driver-induced-madness.
    • Calibre to manage ebooks, Foliate to read them.
    • gcalcli to quickly add to my Google Calendar from the terminal.
    • To prune a full hard drive, (graphical) qdirstat or (term) dua/ncdu.

Phew! Got one more magic trick to suggest? Please do, via twitter/email.

Lastly, writing this waaaay-too-long collection brought back to mind Ryan Dahl's "I hate almost all software" rant. So, a reminder (which I address to myself too): stay curious about craft & tools, but then move on and do stuff with them 🙂.


EDIT 2018-01-24 following discussion on r/Arch: added guetzli, dbeaver, fd, gcalcli, universal-ctags, qdirstat / ncdu.

EDIT 2018-04-14: moved from zsh to fish shell.

EDIT 2018-05-10: added Refined GitHub and grc. Added bat, discovered on Ask HN: What are your favorite terminal programs?

EDIT 2018-09-22: added offline Google Fonts.

EDIT 2018-09-25: replaced tmux + gnome-term with Kitty.

EDIT 2018-10-12: added fontconfig-based font replacement and fontconfig emoji tweaks.

EDIT 2018-11-02: replaced Shutter with my homebrew maim + zenity + inkscape screenshot script.

EDIT 2018-11-20: added arch-wiki-docs and arch-wiki-lite.

EDIT 2018-12-03: added yourduskquibbles/webannoyances list to the Firefox / uBlock section.

EDIT 2018-12-25: added a few Firefox addons: Pin Unpin Tab, Copy selection as Markdown, Redirector, Simple Tab Groups.

EDIT 2019-01-02: added OpenWrt & its adblock package.

EDIT 2019-01-08: added diff-so-fancy.

EDIT 2019-03-14: added Giflossy.

EDIT 2019-04-23: updated GNOME Shell extensions.

EDIT 2019-04-30: added taoup.

EDIT 2019-09-25: added Firefox userContent.css, / userChrome.css.

EDIT 2019-10-16: added background cron fetching of git repos.

EDIT 2019-10-19: added good commit messages (other take on the same lines).

EDIT 2020-01-17: added Cascadia and Programming fonts test drive.

EDIT 2020-02-10: goodbye diff-so-fancy, hello delta.

EDIT 2020-04-06: added Powertop + TLP.

Comments and feedback welcome @ronjouch or by email.