Since the starting parameters are fairly hardwired for wezterm anyway I
don't see this making much sense with e.g. xterm. However, long-term, we
should rather change the hard-dependency instead of doing it this way.
Just run `sc <diagnosis number>` and you will instantly be beamed to the
correcsponding shellcheck wiki error page.
E.g. `sc 3001` will transport you to 'In POSIX sh, process substitution
is undefined'.
Prefer regular 'Iosevka' font in most cases, not the highly specific
'Iosevka Nerd Font'. This may break some things back in Archlinux-land
but it is required for iosevka to be correctly displayed in Voidlinux,
and, to be honest, also feels more clean than using such a highly
specialized font for everything.
Additionally, we generally make use of both where possible, defaulting
to the more specific 'Nerd Font' family variant but falling back to
regular old Iosevka.
One exception is 'wezterm' which, though it nicely includes a font
fallback option (and a very configurable one at that), _always_ produces
a warning when the first font in a fallback list is not found -- even
when the specific 'warn_about_missing_glyphs' option is ticked. No clue
why but for now this works well enough for me.
Make more extensive using of dataclasses for typing and simpler future
refactors.
The redirects 'plugin' is now a simple class which can be imported into
the configuration and is automatically active when instantiated. For
that to work it needs access to the qutebrowser python library but that
should hopefully be a given if wanting to have a qutebrowser plugin.
To make the default redirects active, simply import the class and
instantiate it:
```python
from fossredirect import Redirects
_ = Redirects()
```
This loads the defaults and activates them in qutebrowser. Try to go to
e.g. 'reddit.com' and it will automatically open in a libreddit
frontend.
To customize the redirects, provide a custom list of Services:
```python
from fossredirect import Redirects
_ = Redirects(services=[Service(source=["fromhere.com"], target=["tohere"])])
```
It works a little more flexibly now:
Redirects contains a list of Services.
Each service is a simple data container with the following:
```python
Service(
source=["list.of", "hosts.to", "redirect.com"],
target=["farside-redirect"]
)
```
The above redirects any of the source hosts to the far-side provided
target (in this case it would be
`farside.link/farside-redirect/<original-path>`).
However we can also specify 'custom' targets if farside does not have a
service that we want to redirect.
```python
Service(
source=["list.of", "hosts.to", "redirect.com"],
target=["my-redirected-host.org"],
custom_targets=True
)
```
This directly rewrites the host to
`https://my-redirected-host.org/<original-path>`.
Lastly, we can have custom preprocess/postprocess functions which fix
some more involved redirect:
```python
Service(
source=["list.of", "hosts.to", "redirect.com"],
target=["my-redirected-host.org"],
postprocess=lambda item: item
)
```
Be aware that the functions take 'QUrl' objects so you have to access
e.g. the actual host with `item.host()` before rewriting. Look at the
breezewiki rewrite function for an easy example.
Renamed from `docker` to `hub` since I otherwise always accidentally
search the actual docker hub when I want to find solutions for docker
issues.
Also sorted search engines alphabetically.
Added privacy-aware redirects for goodreads (biblioreads) and
twitch (safetwitch). Safetwitch unfortunately requires
javascript enabled but is still heaps lighter of a website
than the official streaming one.
Farside does not offer redirects for these services yet so we
keep a manual list to redirect to for the time being.
The redirector can now be fed with either a list of targets to pick from
(as before) or a "farside" entry which points to a farside service
redirect or multiple.
The dict entry then looks like:
```python
"quora": {
"source": ["quora.com"],
"farside": ["quetre"],
}
```
It has the source service url as usual, but then instead of a "target"
entry contains a "farside" entry.
A redirect dict entry can take both "target" and "farside" entries, but
will then always give precedence to farside choices.
This should go a long way in helping keep OSS frontends up to date. It
now mostly depends on farside entries in turn being updated.
One potential concern is the new centralization in relying on farside as
the redirect authority.
These are the redirects that made the most trouble for me, and honestly I
do not think wikipedia really belongs in the same category of 'necessary
to redirect' surveillance pages like reddit,instagram or twitter.
Updated reddit redirects once again.
Will soon have to figure out a different way of
approaching the lib- redirections with so many
services blocking/throttling/shutting down the
FOSS frontends. For now, I will bear with it.
Since we now use dotter we can simplify the dir structure for
qutebrowser a lot. Everything dot-filed earlier can now reside
in simple directories called config (for ~/.config/qutebrowser),
data (for ~/.local/share/qutebrowser), and scripts
(for ~/.local/bin) files.