**coltonlewis.name: My Gentoo Laptop [Org] All L1 (Kernel Hacker Mode) ---

My Gentoo Laptop

If you've paid attention to any of my previous posts, like about recommending the programming language Ada or how I have an OpenBSD server, you might have gathered that I'm sympathetic to unconventional technology. This is another post along the same lines. My primary personal laptop runs Gentoo.

My personal laptop is a ThinkPad T14 and it runs Gentoo. If you have any familiarity with certain corners of the internet, you will recognize this as a common meme from the g board of 4chan. It's a meme, but I proudly own up that I do some things for the memes. It's fun to see the shock on people's faces when I tell them I run Gentoo unironically. It's not any objective technical analysis leading to that choice. There are better supported technologies, but I live for sharpening the skills to operate the more hidden gems.

Snapshots

The best thing about my laptop is how I've set up a Btrfs root file system with separate sub-volumes for / and /home. Sub-volumes are cool because they allow you to have logical separation of file systems without needing to muck about with separate partitions or LVM like you need to with more primitive file systems.

Btrfs has many cool features, but the primary one I use is the ease of creating snapshots. Because Btrfs is primarily Copy-On-write (COW), it's very easy to keep many snapshots of the file system around without redundantly taking up space. If a file on my home directory needs to be written, a new copy is produced but the old copy sticks around in my archival snapshots.

The provided script runs as an hourly cron job

#!/bin/bash
# Make a snapshot backup of / and /home
date="$(date -I)"
datetime="$(date -Isecond)"
homevol=/snapshot/home
rootvol=/snapshot/gentoo

mkdir --parents "$rootvol/$date" "$homevol/$date"
btrfs subvolume snapshot -r / "$rootvol/$date/$datetime"
btrfs subvolume snapshot -r /home "$homevol/$date/$datetime"

What this means is I have an exact snapshot of the state of my file system at every hour over the last two weeks. While it should be noted this is not a substitute for regular backups because there is no redundancy to different hardware, it has meant I've never been afraid of accidentally deleting a file. if I do it's always waiting for me in the most recent snapshot.

Portage

Portage is the standard Gentoo package manager. It's infamous for being source based, meaning every updated package has to be recompiled by default. They also ship binary packages for those who choose, and sadly I do have to compromise a bit for Firefox. It's just to long to wait for a single package update.

But besides that, I appreciate the flexibility of a source based package manager. Everything on my system can be tuned for the hardware I actually have and there is a small but detectable performance boost from that. But better than that is the ability to turn many compile time features on and off at will. I am not beholden to the packagers of my distro what features my software includes. And if I want the more up to date and unstable builds, I can list which packages I want that for.

Besides specifying the details in how my packages are compiled, Portage offers excellent organizational capabilities. Though it is not as good as functional package managers like Nix and Guix, It is very simple to group packages into sets through /etc/portage/sets and then treat the sets as atomic units. For example, I can upgrade just my Emacs packages separately with emerge @emacs.

i3 WM

You probably guessed already that I'm the type to use a tiling window manager. I like it for several reasons.

It encourages keyboard use and I don't have to use a mouse as often to move windows around, a useful feature for a laptop. I'm not against the computer mouse on principle but I don't think trackpads work nearly as well and I'm not getting out a mouse every time I open a laptop.

It enforces the constraint that my windows always take up the full screen and don't overlap. This is my favorite thing about tiling window managers in general. There is no reason, none, I have ever wanted one window to partially obscure another, so the default paradigm of floating window managers are theoretically more flexible but the additional flexibility is a bad thing.

Emacs

As an Emacs devotee, I'm very glad my window manager gets out of the way so I can spend more time in Emacs. My Emacs is the command and control center for my laptop. Not only is it a great text editor for programming in, I can use it in place of installing any additional terminals or shells. Eshell is all I need 99% of the time and I feel more efficient with that because all my normal Emacs commands work.

I posted a snippet before about how I have a custom Emacs commands to start a new blog post. I also have one that opens wpa_supplicant.conf for me to add a new WiFi network and has a hook to execute wpa_cli reconfigure to make the changes take effect when I save the file. I have an Emacs command that executes a shell command to lock the screen. I have an emacs command to edit /etc/portage so I can add packages to my package sets there.