2023-11-05 22:26:13 +01:00
|
|
|
import catppuccin
|
2023-11-06 13:52:22 +01:00
|
|
|
|
2023-11-05 22:26:13 +01:00
|
|
|
# pylint: disable=C0111
|
|
|
|
from qutebrowser.config.configfiles import ConfigAPI # noqa: F401
|
|
|
|
from qutebrowser.config.config import ConfigContainer # noqa: F401
|
2023-11-06 13:52:22 +01:00
|
|
|
|
|
|
|
# fmt: off
|
|
|
|
config: ConfigAPI = config # type: ConfigAPI # noqa: F821 pylint: disable=E0602,C0103 # pyright: ignore
|
|
|
|
c: ConfigContainer = c # type: ConfigContainer # noqa: F821 pylint: disable=E0602,C0103 # pyright: ignore
|
|
|
|
# fmt: on
|
2023-11-05 22:26:13 +01:00
|
|
|
|
2023-11-05 22:36:22 +01:00
|
|
|
# load autoconfig values
|
2023-11-05 22:26:13 +01:00
|
|
|
config.load_autoconfig()
|
|
|
|
|
2023-11-05 22:36:22 +01:00
|
|
|
# load catppuccin theme
|
2023-11-06 13:52:22 +01:00
|
|
|
catppuccin.setup(c, "Machiatto", True)
|
2023-11-05 22:36:22 +01:00
|
|
|
|
2023-11-06 13:52:40 +01:00
|
|
|
# load custom configs
|
|
|
|
config.source("pyconfig/redirectors.py")
|
2023-11-05 22:36:22 +01:00
|
|
|
|
2023-11-06 13:52:40 +01:00
|
|
|
# enable dark mode
|
|
|
|
c.colors.webpage.darkmode.enabled = True
|
|
|
|
|
|
|
|
# change startpage and default page
|
|
|
|
c.url.start_pages = ["https://startpage.cronyakatsuki.xyz"]
|
|
|
|
c.url.default_page = "https://startpage.cronyakatsuki.xyz"
|
|
|
|
|
|
|
|
# search engines
|
|
|
|
c.url.searchengines = {
|
|
|
|
"DEFAULT": "https://searx.cronyakatsuki.xyz/?q={}",
|
|
|
|
"aw": "https://wiki.archlinux.org/?search={}",
|
|
|
|
"re": "https://www.reddit.com/r/{}",
|
|
|
|
"w": "https://en.wikipedia.org/wiki/{}",
|
|
|
|
"y": "https://www.youtube.com/results?search_query={}",
|
|
|
|
}
|
2023-11-05 22:36:22 +01:00
|
|
|
|
2023-11-06 13:52:56 +01:00
|
|
|
##-- Fingerprinting settings --##
|
|
|
|
c.content.headers.user_agent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.3"
|
|
|
|
c.content.headers.accept_language = "en-US,en;q=0.5"
|
|
|
|
c.content.headers.custom = {
|
|
|
|
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
|
|
|
|
}
|
|
|
|
c.content.canvas_reading = False
|
|
|
|
c.content.webgl = False
|
|
|
|
c.content.webrtc_ip_handling_policy = "default-public-interface-only"
|
|
|
|
c.content.geolocation = False
|
|
|
|
c.content.blocking.method = "both"
|
2023-11-05 22:36:22 +01:00
|
|
|
c.content.javascript.enabled = False
|
2023-11-06 13:52:56 +01:00
|
|
|
c.content.notifications.enabled = False
|
|
|
|
c.content.cookies.accept = "never"
|
|
|
|
c.content.private_browsing = False
|
2023-11-05 22:36:22 +01:00
|
|
|
|
2023-11-06 13:53:14 +01:00
|
|
|
# History disable
|
|
|
|
c.completion.web_history.max_items = 0
|
|
|
|
c.completion.cmd_history_max_items = 0
|
|
|
|
|
2023-11-06 13:53:27 +01:00
|
|
|
##-- Devtool Settings --##
|
|
|
|
with config.pattern("chrome-devtools://*") as s:
|
|
|
|
s.content.cookies.accept = "all"
|
|
|
|
s.content.images = True
|
|
|
|
s.content.javascript.enabled = True
|
|
|
|
|
|
|
|
with config.pattern("devtools://*") as s:
|
|
|
|
s.content.cookies.accept = "all"
|
|
|
|
s.content.images = True
|
|
|
|
s.content.javascript.enabled = True
|
|
|
|
|
|
|
|
with config.pattern("chrome://*/*") as s:
|
|
|
|
s.content.javascript.enabled = True
|
|
|
|
|
|
|
|
with config.pattern("qute://*/*") as s:
|
|
|
|
s.content.javascript.enabled = True
|
|
|
|
|
|
|
|
##-- Site settings --##
|
|
|
|
with config.pattern("https://searx.cronyakatsuki.xyz/*") as s:
|
|
|
|
s.content.cookies.accept = "all"
|
|
|
|
with config.pattern("https://monkeytype.com") as s:
|
|
|
|
s.content.javascript.enabled = True
|
|
|
|
s.content.cookies.accept = "all"
|
|
|
|
with config.pattern("https://piped.cronyakatsuki.xyz/*") as s:
|
|
|
|
s.content.javascript.enabled = True
|
|
|
|
s.content.cookies.accept = "all"
|
|
|
|
|
|
|
|
|
2023-11-06 13:53:31 +01:00
|
|
|
##-- Aliases --##
|
|
|
|
c.aliases = config.get("aliases")
|
|
|
|
c.aliases["buku"] = "spawn --userscript buku"
|
|
|
|
|
2023-11-06 13:53:42 +01:00
|
|
|
##-- Bindings --##
|
|
|
|
# launch with mpv
|
|
|
|
config.bind(",m", "spawn mpv {url}")
|
|
|
|
config.bind(",M", "hint links spawn mpv {hint-url}")
|
|
|
|
|
|
|
|
# buku bundings
|
|
|
|
config.bind("b", "buku open")
|
|
|
|
config.bind(",ba", "buku add")
|
|
|
|
config.bind(",be", "buku edit")
|
|
|
|
config.bind(",bd", "buku delete")
|
|
|
|
|
|
|
|
# yt-dlp
|
|
|
|
config.bind(",y", "spawn --userscript yt-dlp")
|
|
|
|
config.bind(",Y", "hint links userscript yt-dlp")
|
|
|
|
|
|
|
|
# search current selection
|
|
|
|
config.bind(",f", "open {primary}")
|
|
|
|
config.bind(",F", "open --tab {primary}")
|
|
|
|
|