general cleanup

This commit is contained in:
Felix Van der Jeugt 2024-07-24 08:35:41 +02:00
parent ffced8fca4
commit 3ffb35cc2e
No known key found for this signature in database
GPG key ID: 58B209295023754D
25 changed files with 149 additions and 120 deletions

View file

@ -1,8 +1,7 @@
#!/usr/bin/python
from qutebrowser.api import interceptor
from PyQt5.QtCore import QUrl, QUrlQuery
from unalix import clear_url
from PyQt6.QtCore import QUrl, QUrlQuery
config.backend = "webengine"
config.load_autoconfig(False)
@ -48,10 +47,6 @@ c.url.searchengines = { "startpage": "https://startpage.com/do/search?query={}"
, "mellowchan": "https://srx.mellowchan.xyz/?q={}"
, "DEFAULT": "https://srx.mellowchan.xyz/?q={}"
}
c.colors.webpage.preferred_color_scheme = "dark"
c.colors.webpage.darkmode.enabled = True
#c.colors.webpage.darkmode.policy.images = "never"
c.colors.webpage.bg = 'black'
# Privacy
c.content.proxy = "socks://localhost:9050"
@ -159,10 +154,10 @@ config.bind("<Alt+j>", "prompt-item-focus next", mode="prompt")
config.bind("<Alt+k>", "prompt-item-focus prev", mode="prompt")
config.bind("<Alt+l>", "fake-key -g /", mode="prompt")
config.bind("<Alt+h>", "rl-unix-filename-rubout", mode="prompt")
config.bind("o", "set-cmd-text -s :open -s ", mode="normal")
config.bind("O", "set-cmd-text -s :open -s -t ", mode="normal")
config.bind("\\", "set-cmd-text -s :open ", mode="normal")
config.bind("|", "set-cmd-text -s :open -t ", mode="normal")
config.bind("o", "cmd-set-text -s :open -s ", mode="normal")
config.bind("O", "cmd-set-text -s :open -s -t ", mode="normal")
config.bind("\\", "cmd-set-text -s :open ", mode="normal")
config.bind("|", "cmd-set-text -s :open -t ", mode="normal")
config.bind(";t", "hint links spawn --detach tempbrowser {hint-url}", mode="normal")
config.bind(";n", "hint links spawn --detach newbrowser {hint-url}", mode="normal")
config.bind("gt", "spawn --detach tempbrowser {url}", mode="normal")
@ -241,7 +236,7 @@ def intercept(info: interceptor.Request) -> None:
if not info.request_url.scheme().startswith('http'):
return
new_url = QUrl(clear_url(info.request_url.url()))
new_url = QUrl(info.request_url.url())
if new_host := redirects.get(new_url.host()):
new_url.setHost(new_host)