Linux Workstation Tooling

This is the tooling behind my daily Linux workstation: a desktop on EndeavourOS built from individual components instead of a desktop environment, and maintained the way I’d maintain software. It lives in one repository of about 6,100 lines of shell, Lua, Python and Fish, with 105 tests, about 2,700 lines of documentation, and checks that refuse a commit when the configuration disagrees with itself.
The window manager is Hyprland, a tiling compositor: windows are arranged automatically and driven from the keyboard. That’s the context and not the subject. The subject is what it takes to keep such a setup correct once nothing is bundled for you.
I designed this setup and built it in Claude Code sessions: the design decisions and approvals are mine, the implementation and tests were written by Claude.
1. A desktop without a desktop environment
A desktop environment hands you a session manager, a lock screen, a keyring, a notification daemon, a launcher and a settings layer that all agree with each other. Without one, each of those is a separate program, and making them agree is your job.
Here the session’s lifecycle runs through systemd user services, with the unit files and their overrides tracked in the repository. The lock screen, idle handling, keyring unlock at login, the authentication agent, notifications, the launcher and the status bar are each configured on their own. Hyprland itself is configured in Lua, in about 520 lines.
Theming shows how far “agree with each other” goes. One dark palette has to reach GTK 3, GTK 4, Qt 5, Qt 6 and a row of terminal tools, and each has its own mechanism. A few of the things the documentation records because they aren’t visible in the config:
- On Wayland, GTK reads its theme and font from a settings database and not from its own config file, so that file is the wrong place to change them.
- One environment variable value reaches both Qt 5 and Qt 6, and the more obvious value leaves Qt 5 applications on a light default palette.
- Icon theme names are case-sensitive, and a misspelled name silently falls back to the default theme, so a change is verified against the files that actually resolve.
2. One accent color across sixteen config files
The desktop has one accent color, used for borders, the active workspace, the clock, selections and folder icons. It can be switched among fourteen colors from a menu in the status bar, and the switch has to land in every program at once.
Configs that can run code read the accent from one state file. Static configs can’t, so a script rewrites them in place: 19 rewrite rules across 16 files, plus the two Qt color schemes and an overlay of folder-icon symlinks. The risk in that design is obvious. A regular expression let loose on someone’s config will eventually recolor the wrong line.
So every rule states the exact number of tokens it must match:
# rule FILE SCOPE REGEX TEMPLATE COUNT
rule mako/config before-section '^border-color=(#[0-9a-f]{6})$' '#%hex%' 1
rule fuzzel/fuzzel.ini section:colors '^(match|selection-match|border)=([0-9a-f]{6})ff$' '%hex%' 3
rule gtk-3.0/gtk.css all '^@define-color accent_bg_color (#[0-9a-f]{6});$' '#%hex%' 1
rule gtk-4.0/gtk.css all '^@define-color accent_bg_color (#[0-9a-f]{6});$' '#%hex%' 1
rule hypr/hyprlock.conf all '^\$accent = (\$[a-z]+)$' '$%name%' 1A file whose rules match a different number is left untouched and reported in a notification. A hand edit can therefore break a switch loudly, and can never make a rule recolor something it doesn’t own. Rules also never replace a bare color value, because once the accent is green, the same green appears in places that aren’t accents. In files where keys repeat, each accent line carries a trailing marker comment, and the rule only touches accent-colored tokens on marked lines.
Three more pieces make it safe to use casually:
- Switches wait for each other on a file lock, and each applies the state file as it stands once it gets the lock, so a burst of quick clicks ends on the color clicked last.
- A check command verifies that every file and the icon overlay agree with the state file, and that the two Qt schemes are identical.
- A pre-commit hook runs that check and refuses a commit while the accent is half-switched:
root=$(git rev-parse --show-toplevel) || exit 1
if ! problems=$(ACCENT_ROOT=$root "$root/hypr/scripts/accent.sh" check 2>&1); then
printf '%s\n' "$problems" >&2
printf 'pre-commit: the accent files disagree; run hypr/scripts/accent.sh apply or set, then commit again.\n' >&2
exit 1
fiThe switcher is 560 lines and its test suite is 950, with 50 tests. Every test runs against a scratch copy of the configs with reloads switched off, so the suite never changes the live desktop.
3. Session save and restore
Hibernation is unreliable on this laptop, so a script brings the terminals back after a restart instead: each on its workspace, as a shell in its folder or as a Claude Code conversation resumed in its own window, along with the workspace names.
The first version saved automatically, on a timer and on window events. I dropped it. Its failures all came from saves racing a session that was changing by itself, above all a logout, which closes the applications before the session reports that it’s stopping. A half-closed session would overwrite a good save.
Saving is now deliberate. The power menu’s log out, reboot and shut down entries save first and then act. The one unattended save comes from the low-battery warning, and it does nothing when the compositor doesn’t answer or when the last save is under a minute old, because that save is the menu’s and the half-closed session must not replace it.
Two details carry most of the correctness:
A conversation is matched to its window by process ID and start time together. Process IDs are reused, and resuming the wrong conversation in a window would be worse than resuming none. The start time comes from the process table, where the command name can itself contain spaces and parentheses:
# Field 22 (start time in clock ticks) of a /proc/<pid>/stat line. The command
# name in field 2 may contain spaces and parentheses, so count after the last
# ") ".
stat_start_time() {
local -a fields
read -ra fields <<<"${1##*) }"
printf '%s\n' "${fields[19]}"
}A save is restored once. At login the restore renames the save file before launching anything, so a restore that crashes the session can’t loop on the next login.
Nothing a terminal was running is run again, except the conversation resume, and that keeps only allowlisted options. The suite here is 740 lines and 55 tests.
4. Tracing a crash into GTK
The repository keeps a file of crash investigations, and it’s honest about their state: some are fixed, some are understood and only worked around, and one is open.
The best of them is a status bar that kept segfaulting, seconds to minutes after nothing in particular. Every recorded crash died at the same two instructions in GTK 3’s Wayland cursor code, reading a cursor image through a pointer into a cursor theme that GTK had already destroyed. The sequence, confirmed with gdb on an isolated copy of the bar:
- The bar asks GTK for a named cursor on every hover and every leave. GTK keeps one object per cursor name in a cache and hands the same object out, so several of the bar’s windows end up sharing one.
- When the pointer enters one of those windows on a scaled display, GTK changes that shared object’s scale in place. The next request no longer matches the cache entry, so GTK creates a new object and replaces the entry. The old object is now outside the cache and still attached to every window that was left earlier.
- Changing the cursor theme makes GTK destroy every loaded theme and re-point only the cursors still in the cache. The evicted object keeps a pointer into freed memory.
- The pointer next enters a window holding that object, and GTK reads the dead theme. It faults only once the memory has been reused, which is why the crash trailed its cause by minutes and looked like a crash on hover.
It was reproduced with a scripted pointer replay against the isolated bar, with freed memory deliberately scribbled so the first stale read faults. That replay also explained why earlier attempts to reproduce it had failed: one sweep of the pointer before the theme change isn’t enough, because it takes a second pass to evict the shared cursor.
This is a bug in GTK 3, which is in maintenance, so an upstream fix is unlikely. The workaround is that changing the cursor theme restarts the bar as its last step: a deliberate one-second restart instead of a random crash minutes later. The alternative was to stop the bar using named cursors at all, which would have cost the hover pointer, and I didn’t take it.
The other entries, with their real status:
| Problem | Status |
|---|---|
| Status bar aborting when a wireless device’s battery entry vanished mid-scan | Fixed, by pinning the battery module to the laptop’s own battery |
| Compositor crashes after a GPU reset | Cause traced to a browser’s GPU process; a mitigation is on trial, with no result recorded yet |
| The whole session ending without a crash | Root-caused: a privileged container running an init system hung up the host’s terminal |
| A kernel panic after resume | Open; the evidence points toward hardware or a corrupting driver, and a memory test is the next step |
5. System files under review
Nineteen root-owned files under /etc matter to this setup, and a user-level repository can’t hold them directly. A script mirrors them into the repository by their absolute paths and reports drift between the two, comparing file modes as well as contents.
Nothing is ever symlinked from /etc into the repository. Those files are acted on as root, and a login-manager config that a normal user could edit would be a way to run things as root. Installing a changed file goes the other way, deliberately: the script validates the file first with a check suited to its type, shows the diff, and only then asks before using sudo. Validation comes first because a broken login or authentication file can lock you out of the graphical session.
Settings that live outside any file get the same treatment in documentation, with instructions for recreating each one.
6. Working with an agent
The repository is structured for agent-driven work, and that structure is what makes it safe.
A short root document holds only what every session needs: the scope, the stack, the policies and a validation checklist. Everything else is in seven topic files, one per area, and a session must read an area’s file before touching it. Those files record what the configuration can’t show: decisions, constraints, failure modes, and the reasons a setting looks wrong but is right, which is exactly what a quick fix would undo.
The guardrails are the mechanical parts described above. Tests run against scratch copies, the pre-commit hook refuses an inconsistent state, and the drift check shows what changed outside the repository. An agent’s change has to pass the same checks mine would.

One small extra came out of working this way. The status bar shows which workspaces have Claude Code sessions and whether each is working or waiting, as dots beside a small mascot that walks while any session is busy. The mascot is Clawd, the Claude Code mascot, and it belongs to Anthropic. I didn’t design it: a script generates the bar’s frames from Claude Code’s own block art, reproducibly, so a diff shows exactly what an art change does. The cursor theme I use is derived the same way, from the pointer that Claude in Chrome draws. Both are things I made for my own desk out of someone else’s artwork.