diff --git a/.gitignore b/.gitignore index edfd3be..46d9e37 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,8 @@ sponsorblock.txt /qutebrowser/.config/qutebrowser/qsettings /qutebrowser/.config/qutebrowser/bookmarks /qutebrowser/.config/qutebrowser/stylesheets +# ignore the generated readability file for webpages +readability.html # ignore vifm & ueberzug utility files vifm-help.txt diff --git a/nvim/.config/nvim/spell/en.utf-8.add b/nvim/.config/nvim/spell/en.utf-8.add index ddb0308..3fe5087 100644 --- a/nvim/.config/nvim/spell/en.utf-8.add +++ b/nvim/.config/nvim/spell/en.utf-8.add @@ -101,3 +101,4 @@ indices Anthropocene ecotourism legitimation +wellbeing diff --git a/qutebrowser/.config/qutebrowser/config.py b/qutebrowser/.config/qutebrowser/config.py index 5faabad..3776ece 100644 --- a/qutebrowser/.config/qutebrowser/config.py +++ b/qutebrowser/.config/qutebrowser/config.py @@ -41,7 +41,7 @@ c.downloads.location.directory = os.getenv("XDG_DOWNLOAD_DIR", "~/downloads") c.downloads.location.prompt = False config.source("alias.py") -config.source("keys.py") +config.source("maps.py") config.source("content.py") config.source("url.py") diff --git a/qutebrowser/.config/qutebrowser/content.py b/qutebrowser/.config/qutebrowser/content.py index 0a204c9..d0e0269 100644 --- a/qutebrowser/.config/qutebrowser/content.py +++ b/qutebrowser/.config/qutebrowser/content.py @@ -12,6 +12,7 @@ c.content.blocking.hosts.lists = [ ] c.content.blocking.whitelist = ["piwik.org"] c.content.autoplay = False +c.content.prefers_reduced_motion = True c.content.pdfjs = False c.content.javascript.enabled = False js_whitelist = [ @@ -19,7 +20,6 @@ js_whitelist = [ "*://127.0.0.1/*", "*://asciinema.org/*", "*://calendar.google.com/*", - "*://clockify.me/tracker*", "*://darksky.net/*", "*://deepl.com/*", "*://duckduckgo.com/*", @@ -32,8 +32,6 @@ js_whitelist = [ "*://*.martyoeh.me/*", "*://news.ycombinator.com/*", "*://old.reddit.com/*", - "*://todoist.com/*", - "*://toggl.com/*", "*://translate.google.com/*", "chrome://*/*", "file://*", diff --git a/qutebrowser/.config/qutebrowser/keys.py b/qutebrowser/.config/qutebrowser/maps.py similarity index 76% rename from qutebrowser/.config/qutebrowser/keys.py rename to qutebrowser/.config/qutebrowser/maps.py index 71e8758..68e935e 100644 --- a/qutebrowser/.config/qutebrowser/keys.py +++ b/qutebrowser/.config/qutebrowser/maps.py @@ -1,6 +1,8 @@ # Key mappings -# 'Leader' key binding +# 'Leader' key binding -- for general personal maps leader = "" +# 'LocalLeader' key binding -- intended for 'in-page' personal maps +lleader = "," ## CHANGED DEFAULTS @@ -24,18 +26,19 @@ config.bind(leader + "tV", "set tabs.position left") # [M]edia shortcuts - watch, queue, download media # bind mpv to play the current page/links, using a single instance which queues the next link passed -config.bind(leader + "M", "spawn umpv {url}") -config.bind(leader + "m", "hint links spawn umpv {hint-url}") +config.bind(lleader + "M", "spawn umpv {url}") +config.bind(lleader + "m", "hint links spawn umpv {hint-url}") + # bind youtube-dl to download the current page/links -config.bind(leader + "dM", "spawn vidl {url}") +config.bind(lleader + "dM", "spawn vidl {url}") config.bind( - leader + "dm", + lleader + "dm", "hint --rapid links spawn vidl {hint-url}", ) - # Download shortcuts -config.bind(leader + "dd", "download", mode="normal") -config.bind(leader + "dp", "save_to_pdf", mode="normal") +config.bind(lleader + "dd", "download", mode="normal") +config.bind(lleader + "dp", "save_to_pdf", mode="normal") + # open last download config.bind("gD", "spawn --userscript open_download") @@ -45,12 +48,12 @@ config.bind('"s', "add-shaarli", mode="normal") config.bind('"a', "send-to-archive", mode="normal") config.bind('"o', "send-to-outline", mode="normal") -config.bind('"g', "translate-page-google", mode="normal") -config.bind('"G', "translate-selection-google", mode="normal") +config.bind('"t', "translate-page-google", mode="normal") +config.bind('"T', "translate-selection-google", mode="normal") config.bind('"q', "show-qr") -config.bind(leader + "r", "spawn --userscript readability") +config.bind(lleader + "r", "spawn --userscript readability") # set stylesheets for the browser to use config.bind( diff --git a/qutebrowser/.config/qutebrowser/url.py b/qutebrowser/.config/qutebrowser/url.py index bcaf601..3a82b12 100644 --- a/qutebrowser/.config/qutebrowser/url.py +++ b/qutebrowser/.config/qutebrowser/url.py @@ -1,26 +1,59 @@ +from qutebrowser.api import interceptor, message + c.url.searchengines = { + "#sci": "https://sci-hub.do/{}", "DEFAULT": "https://search.martyoeh.me/?q={}", - "l": "https://links.martyoeh.me/?searchterm={}&searchtags=", - "ddg": "https://duckduckgo.com/?q={}", + "al": "https://wiki.archlinux.org/index.php/{}", + "alt": "https://alternativeto.net/software/{}/?license=opensource", + "aur": "https://aur.archlinux.org/packages/?K={}", "d": "https://www.dict.cc/?s={}", - "t": "https://www.thesaurus.com/browse/{}", - "gt": "https://translate.google.com/#auto/de/{}", + "ddg": "https://duckduckgo.com/?q={}", "dt": "https://www.deepl.com/translator#en/de/{}", "g": "https://www.google.com/search?q={}", - "r": "https://old.reddit.com/r/{}", - "w": "https://en.wikipedia.org/w/index.php?search={}", "gh": "https://github.com/search?q={}", - "al": "https://wiki.archlinux.org/index.php/{}", - "aur": "https://aur.archlinux.org/packages/?K={}", - "yt": "https://www.youtube.com/results?search_query={}", - "maps": "https://www.google.fr/maps?q={}", "gol": "https://golang.org/pkg/{}/", - "man": "https://manned.org/browse/search?q={}", - "lib": "http://libgen.fun/search.php?req={}", - "#sci": "https://sci-hub.do/{}", - "alt": "https://alternativeto.net/software/{}/?license=opensource", + "gt": "https://translate.google.com/#auto/de/{}", "hn": "https://hn.algolia.com/?q={}", - "kb": "https://soeg.kb.dk/discovery/search?query=any,contains,{}&tab=Everything&search_scope=MyInst_and_CI&vid=45KBDK_KGL:KGL&offset=0&lang=en", + "kb": "https://soeg.kb.dk/discovery/search?query=any,contains,{}&lang=en", + "l": "https://links.martyoeh.me/?searchterm={}&searchtags=", + "lib": "http://libgen.fun/search.php?req={}", + "man": "https://manned.org/browse/search?q={}", + "maps": "https://www.google.fr/maps?q={}", + "r": "https://www.reddit.com/r/{}", + "t": "https://www.thesaurus.com/browse/{}", + "w": "https://en.wikipedia.org/w/index.php?search={}", + "yt": "https://www.youtube.com/results?search_query={}", } c.url.default_page = "https://start.duckduckgo.com" c.url.start_pages = ["https://start.duckduckgo.com"] + +redirects = { + "reddit.com": "teddit.net", + "www.reddit.com": "teddit.net", + "youtube.com": "yewtu.be", + "www.youtube.com": "www.yewtu.be", + "twitter.com": "nitter.net", + "www.twitter.com": "nitter.net", + "instagram.com": "bibliogram.art", + "www.instagram.com": "bibliogram.art", +} + + +def rewrite(request: interceptor.Request): + if ( + request.resource_type != interceptor.ResourceType.main_frame + or request.request_url.scheme() in {"data", "blob"} + ): + return + + url = request.request_url + + redir = redirects.get(url.host()) + if redir is not None and url.setHost(redir) is not False: + try: + request.redirect(url) + except: + pass + + +interceptor.register(rewrite)