The reason why, when you open a .html, it might open in your browser instead of a text
editor is XDG. And that stands for X Desktop Group which is the original name of
what is now known as freedesktop.org, and it's just all about standardization or
something. When you get Spotify for example, and it makes you log in through your browser, yeah, the
same thing.
Not to bore you, if you want to just be able to have things like clicking on a link outside of your browser, and having it open in your browser, let's just set up XDG.
Install the portals & utils
GTK portals & utils:
sudo xbps-install -S xdg-desktop-portal xdg-desktop-portal-gtk xdg-utils
When you see it pulling in gnome-desktop or something, don't worry, it's just
freedesktop BLOAT though it's a few megabytes of shared C or stuff libraries apparently. You did get
GTK4 for some shit but you didn't get the whole GNOME desktop environment. It's fine I'd say, the
alternatives -wlr for Wayland/wlroots and -kde might just do the same
thing but with their own stuff, like -kde would pull in Qt/KDE instead. If you are
using KDE or a window manager setup more reliant on Qt, then go with -kde, same logic
if you're using wlroots or something.
After installing, you're done.
Go ahead and try xdg-open with a URL and witness it open in your browser.
If you're using GTK with a dark theme and it turns light for you after installing, just do
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
and it should be back to normal once again.