mullane.info

Transparent kitty and Firefox, eventually

2026-11-27 · workbench

Every time I set up a machine, one of the first things I do is make the terminal and the browser a bit see-through. On Windows that meant Mica and a handful of strange Firefox settings that I mostly copied from forum threads and never fully understood. So on the laptop I asked the agent to set kitty’s transparency to 0.92, figuring that would take about a minute.

It took a bit longer than that. The agent runs as its own user and can’t touch my kitty, so it pointed me at ~/.config/kitty/local.conf, which workbench includes last, and I added background_opacity there. Nothing happened. It turns out kitty only changes the opacity on a config reload if dynamic_background_opacity was already on when that kitty started, so the first time around you have to quit kitty and start it again (zmx keeps the layouts running, so that’s cheap). I settled on 0.8, and no blur, since the wallpaper behind it is calm enough.

Then Firefox. The agent offered two options: a Hyprland window rule that fades the whole window, text included, or the userChrome route, where only the backgrounds go translucent and the text stays solid. I wanted the second one, at 0.9. Somewhere in here the agent also confidently told me it was working on desktom, when it was in fact sitting on laptom the whole time (it had read laptom’s files and turned off laptom’s sudo, while describing them as desktom’s). To its credit it owned that plainly once I pointed it out.

I’d been toying with making transparency a default in workbench, if only because I turn it on every single time. I don’t think forcing it on everyone is a good idea, but I’d bet most people installing this setup want some of it, so it’s now an optional section: bench setup transparency, off by default, which asks for an opacity for kitty and for Firefox. For kitty it writes a small include (with dynamic_background_opacity on, so the restart dance only happens once). For Firefox it puts a managed block in each profile’s user.js and userChrome.css, plus a stylesheet whose colors come from the current theme, linked into the profile so switching themes reaches Firefox too. Turning it off takes all of that back out and leaves my own lines alone.

I pulled it, ran it, and Firefox was exactly as opaque as before. The files were all in place and the prefs had been read, so the agent went looking, and the answer was in a couple of Mozilla bug reports from people trying the same thing (2037206 and 2045222). Two things had changed under everyone’s feet. Since Firefox 150 the toolbar color is painted on <body>, not on the toolbars, so every rule aimed at #navigator-toolbox and friends was styling something nobody could see. And Firefox also wants widget.transparent-windows, or it never asks the compositor for a see-through window in the first place. Mozilla closed both bugs as unsupported setups (userChrome is “the way forward”, as one developer put it), which is fair, but it does mean this can break again with any update.

The fix went out, I pulled it, and Firefox was still solid. This one was more mundane: pulling the fix only changes the templates in my clone, and nothing rewrites the files in the profile until bench setup transparency runs again. I hadn’t run it again. The agent ran just that step as me, from my own clone, I restarted Firefox, and the tab bar finally showed the wallpaper through it. It didn’t need the Wayland opaque-region pref the bug reports also mention, which I’m glad of, since that’s one less thing to keep track of.

That covers the window, but pages still paint their own backgrounds, so most of the web stays solid. What I remembered from Windows was a set of add-ons with a library of styles per site, and the agent found them: Zen Internet (with its style library in sameerasw/my-internet, one stylesheet per domain, fetched at runtime) and the smaller Transparent Zen. They’re written for Zen Browser, but they work in plain Firefox, and I’d had them working before, until a Windows update broke the whole arrangement (as Windows updates do). The agent checked the signed package against the add-on store’s hash and dropped it into the profile, then pointed out that Dark Reader, which I’d forgotten was installed, paints a solid dark background on every page and would cover exactly the sites Zen Internet styles. So Dark Reader gets switched off per site now.

It all works. It took two wrong guesses about Firefox and one about which computer we were on, but it’s now a setting instead of an afternoon of forum threads, which is really what I wanted out of it.

Update, later the same evening: Zen Internet couldn’t fetch its styles. The console was full of CORS errors, and I was pretty sure uBlock Origin was the culprit, but it can’t touch another add-on’s requests at all. The real reason was how the add-on got there. Because the agent dropped the file into the profile instead of me installing it from the add-on store, Firefox enabled it without ever granting it access to any website. Without that, its fetch (which sends a Cache-Control header) turns into a CORS preflight, and GitHub Pages answers the preflight with a 405, so the request never happens. One toggle fixed it: about:addons, the add-on’s Permissions tab, “Access your data for all websites”. Next time it gets installed from the store, if only because the store’s prompt does that part for you.