š¾ Archived View for gemini.omarpolo.com āŗ post āŗ state-of-theme-switching.gmi captured on 2023-04-19 at 22:58:54. Gemini links have been rewritten to link to archived content
ā¬ ļø Previous capture (2023-01-29)
-=-=-=-=-=-=-
A cry for help.
Written while listening to āGethsemaneā by Nightwish.
Published: 2021-07-26
Tagged with:
Two years ago I decided to switch to a light-theme and I was really happy with that. Maybe itās just me, but black text on white background is perfectly readable, and it didnāt give me problems or eye tiredness, not even when itās 1 am and Iām still hacking together something.
Fast forward two years, and Iām still happily using only light themes. Sometimes, I get some comments like āyouāve burnt my eyesā when I share a screenshot with someone for the first time, but thatās all.
However, this summer Iāve started to (temporary) switch to a dark theme on some occasions (itās really hot, even at night; I need keep the windows open to catch a brief breeze and not being eaten alive by mosquitoes) and Iām particularly disappointed with the current state of theme switching and dark mode in general.
My goal would be a single *painless* action to switch my entire environment from a light to a dark theme and vice versa. How hard can it be?
These are the applications I have usually open
all running on cwm, my favourite window manager.
Switching the background image to something more dark-y (yes, my current wallpaper is mostly white too) is painless. Open an xterm, āC-r fehā and kshā i-search leads me to the correct command. Cool.
Emacs is the easiest to tame. M-x disable-theme followed by a M-x load-theme and youāre set. I could even automatize this and bind a key.
xterm is sort of okay-ish to tame. I have a .Xdefaults with the colors; yesterday Iāve extracted my theme to .Xdefaults-light and selected a random dark theme in .Xdefaults-dark. In .Xdefaults Iāve added
#include ".Xdefaults-light" ! #include ".Xdefaults-dark"
and when I want to switch theme I can simply switch the comments. Yes, I have to close and re-open all my xterms, but itās not a real issue. All my terminal windows are usually volatile: if I need to run something that takes more than a couple of seconds, I usually run it in a tmux session, so no problem with closing and re-opening xterms, really.
Now the difficult part: firefox and other GTK programs.
Firefox is extremely hard to tame in this regard, and even really buggy. Iām using a custom ACME-y light theme built with the āfirefox colorsā extension, which overrides the current theme at startup. Go wonders. Switching theme is clunky. On firefox 90 I have to go āhamburger menuā ā āmore toolsā ā ācustomize toolbarā and then switch the theme in the bar at the bottom. But this is only one part: then you have to go to about:config and set ui.systemUsesDarkTheme to 1 to set the theme preference for websites. Iām honestly surprised nobody wrote an extension to automatize this. I suspect I can automatize all of this by changing some files in ~/.mozilla/firefox, butā¦
And then thereās the web. (WARNING: rant ahead)
Seriously, itās that difficult to build a website that adapts to the prefers-color-scheme media query? I didnāt realized, given that all my sites (well, except my cgit instance) adapts to the user preferred theme, without a line of javascript involved. Out of all the website I tried yesterday night (admittedly a short number) only duckduckgo was adapting to my preference. Props to them.
The instance of pleroma Iām using sometimes to waste time in the fediverse has a theme switcher icon. Meh. But at least is always visible in the navbar at the top. Simple 0-css-or-so websites have of course this bright white background. I love white background, but when youāre in a dark-themed environment switching to a bright page is painful.
I guess that this mess is due to allowing page authors to decide how pages are rendered on the usersā end. One more reason to ditch the web.
(end of rant)
My solution to the problem is to use firefox even less. The duckling-proxy does a *tolerable* job when thrown at a wikipedia page, and other simple pages are OK-ish to read. Sure, a terminal web browser like w3m are best suited for this, but I like the experience of never having to leave Telescope.
GTK applications (or gajim, since itās the only one I routinely use) are also meh, but tame-able. I have a solarized dark theme (which I personally hate, but Iām too lazy to find something else) installed and I can switch to that with lxappearance. Then restart gajim.
I wrote this rant^W entry in a hurry, so I hope it makes sense. What Iām gonna do from now on? Iāll try to automatize some manual steps: for instance, switching theme on Emacs could also change the wallpaper and patch the .Xdefaults. For firefox and other GTK applications I guess manual intervention is still needed, or maybe Iāll be able to ditch them, who knows?
-- text: CC0 1.0; code: public domain (unless specified otherwise). No copyright here.