From 5d48489faddc89f2c4817705938cd9218e06b712 Mon Sep 17 00:00:00 2001 From: Phantop Date: Fri, 21 Jun 2024 10:39:40 -0400 Subject: [PATCH] ditch splash for priviblur fully --- qutebrowser/bindings.py | 2 +- qutebrowser/redirects.py | 2 +- qutebrowser/userscripts/priviblur | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 qutebrowser/userscripts/priviblur diff --git a/qutebrowser/bindings.py b/qutebrowser/bindings.py index b388c2b..d3868ec 100644 --- a/qutebrowser/bindings.py +++ b/qutebrowser/bindings.py @@ -39,7 +39,7 @@ bind = { 'E': 'config-cycle -p content.javascript.enabled ;; reload', 's1': 'download-open', 'sa': 'open -t archive.is/submit/?url={url}', - 'sb': 'open tumblash.fly.dev/?u={url}', + 'sb': 'spawn -u priviblur', 'sc': 'toggle-dark', 'sd': "spawn fish -c 'dl; open (ls -a | rofi -dmenu -b -i || exit 0)'", 'sg': 'debug-dump-page ~/Downloads/dump.html', diff --git a/qutebrowser/redirects.py b/qutebrowser/redirects.py index dbbb117..543b746 100644 --- a/qutebrowser/redirects.py +++ b/qutebrowser/redirects.py @@ -73,7 +73,7 @@ m = { "www.twitch.tv" : o(s, 'twineo.exozy.me'), "discord.com" : o(s, 'canary.discord.com'), - "tumblr.com" : o(s, 'tumblash.fly.dev'), + "tumblr.com" : o(s, 'priviblur.fly.dev'), "www.tumblr.com" : o(s, 'priviblur.fly.dev'), "www.npr.org" : o(s, 'text.npr.org'), "www.goodreads.com" : o(s, 'bl.vern.cc'), diff --git a/qutebrowser/userscripts/priviblur b/qutebrowser/userscripts/priviblur new file mode 100755 index 0000000..ef370fc --- /dev/null +++ b/qutebrowser/userscripts/priviblur @@ -0,0 +1,8 @@ +#!/usr/bin/fish +set json (trurl --json $QUTE_URL | jq .[].parts) +set blog (echo $json | jq -r .host | cut -d. -f1) +set page (echo $json | jq -r .path) +set instances https://github.com/syeopite/priviblur/raw/master/instances.md +set instances priviblur.fly.dev (curl -L $instances | grep https | awk -F'[][]' '{print $2}') +set instance (random choice $instances) +echo "open $instance/$blog$page" >> $QUTE_FIFO