šŸ’¾ Archived View for gemini.omarpolo.com ā€ŗ post ā€ŗ state-of-theme-switching.gmi captured on 2024-03-21 at 15:32:31. Gemini links have been rewritten to link to archived content

View Raw

More Information

ā¬…ļø Previous capture (2023-01-29)

-=-=-=-=-=-=-

The current state of theme switching

A cry for help.

Written while listening to ā€œGethsemaneā€ by Nightwish.

Published: 2021-07-26

Tagged with:

#rant

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?

The current state of the affairs

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.

Wrapping up

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.