mirror of
https://github.com/Phantop/dotfiles
synced 2025-01-12 07:07:04 +00:00
Qute: clean up redirects, hosts, and the rest
This commit is contained in:
parent
0233bf99c8
commit
cab5d6136c
|
@ -29,15 +29,15 @@ cct.pinned.selected.odd.bg = accent
|
|||
cct.selected.even.bg = accent
|
||||
cct.selected.odd.bg = accent
|
||||
|
||||
cct.selected.even.fg = 'black'
|
||||
cct.selected.odd.fg = 'black'
|
||||
cc.messages.warning.fg = 'white'
|
||||
cct.pinned.selected.even.fg = 'black'
|
||||
cct.pinned.selected.odd.fg = 'black'
|
||||
cc.messages.warning.fg = 'white'
|
||||
cct.selected.even.fg = 'black'
|
||||
cct.selected.odd.fg = 'black'
|
||||
|
||||
cc.messages.warning.bg = 'red'
|
||||
cc.messages.warning.border = 'red'
|
||||
ccc.even.bg = '#29353B'
|
||||
ccc.odd.bg = '#243035'
|
||||
c.hints.border = '1px solid #00A5BA'
|
||||
cc.hints.bg = 'rgba(0, 226, 255, 0.8)'
|
||||
cc.messages.warning.bg = 'red'
|
||||
cc.messages.warning.border = 'red'
|
||||
|
|
|
@ -11,13 +11,13 @@ bind = {
|
|||
';M': 'hint links run mpv4 {hint-url}',
|
||||
|
||||
's1': 'download-open',
|
||||
'sa': 'open https://archive.is/?run=1&url={url}',
|
||||
'sc': 'config-cycle -t content.user_stylesheets adapta.css ""',
|
||||
'sa': 'open -t archive.is/?run=1&url={url}',
|
||||
'sc': 'config-cycle content.user_stylesheets adapta.css ""',
|
||||
'sd': "spawn fish -c 'dl; open (ls | rofi -dmenu -b -i || exit 0)'",
|
||||
'sg': 'debug-dump-page ~/Downloads/dump.html',
|
||||
'sq': 'spawn -u qr',
|
||||
'sr': 'remove-sticky',
|
||||
'st': 'config-cycle -t content.proxy socks://localhost:9050/ system',
|
||||
'st': 'config-cycle content.proxy socks://localhost:9050/ system',
|
||||
}
|
||||
for a, b in bind.items():
|
||||
config.bind(a, b)
|
||||
|
|
|
@ -33,11 +33,11 @@ c.aliases['mpv4'] = mpv + ' --ytdl-format=bestvideo[vcodec^=avc1]+bestaudio'
|
|||
c.aliases['remove-sticky'] = 'jseval -q !function(){var e,o=document.querySelectorAll("body *");for(e=0;e<o.length;e++)["sticky","fixed"].includes(getComputedStyle(o[e]).position)&&o[e].parentNode.removeChild(o[e])}();'
|
||||
|
||||
c.content.blocking.method = "both"
|
||||
hosts = c.content.blocking.hosts.lists
|
||||
hosts.append("https://github.com/Perflyst/PiHoleBlocklist/raw/master/AmazonFireTV.txt")
|
||||
hosts.append("https://github.com/jmdugan/blocklists/raw/master/corporations/twitter/all")
|
||||
hosts.append("https://github.com/jmdugan/blocklists/raw/master/corporations/microsoft/all")
|
||||
hosts.append("https://github.com/jmdugan/blocklists/raw/master/corporations/facebook/all-but-whatsapp")
|
||||
host = c.content.blocking.hosts.lists.append
|
||||
host("https://github.com/Perflyst/PiHoleBlocklist/raw/master/AmazonFireTV.txt")
|
||||
host("https://github.com/jmdugan/blocklists/raw/master/corporations/twitter/all")
|
||||
host("https://github.com/jmdugan/blocklists/raw/master/corporations/microsoft/all")
|
||||
host("https://github.com/jmdugan/blocklists/raw/master/corporations/facebook/all-but-whatsapp")
|
||||
|
||||
config.set('content.persistent_storage', True, 'https://mega.nz')
|
||||
config.set('content.desktop_capture', True, 'https://discord.com')
|
||||
|
|
|
@ -1,30 +1,35 @@
|
|||
invid = 'invidious.fdn.fr'
|
||||
invid = 'invidiou.site'
|
||||
nitter = 'nitter.snopyta.org'
|
||||
reddit = 'teddit.net'
|
||||
|
||||
from qutebrowser.api import interceptor
|
||||
import operator, typing
|
||||
REDIRECT_MAP = {
|
||||
"reddit.com": operator.methodcaller('setHost', reddit),
|
||||
"www.reddit.com": operator.methodcaller('setHost', reddit),
|
||||
"old.reddit.com": operator.methodcaller('setHost', reddit),
|
||||
"twitter.com": operator.methodcaller('setHost', nitter),
|
||||
"api.twitter.com": operator.methodcaller('setHost', nitter),
|
||||
"platform.twitter.com": operator.methodcaller('setHost', nitter),
|
||||
"www.platform.twitter.com": operator.methodcaller('setHost', nitter),
|
||||
"mobile.twitter.com": operator.methodcaller('setHost', nitter),
|
||||
"www.youtube.com": operator.methodcaller('setHost', invid),
|
||||
"youtube.com": operator.methodcaller('setHost', invid),
|
||||
"youtu.be": operator.methodcaller('setHost', invid),
|
||||
"www.instagram.com": operator.methodcaller('setHost', 'bibliogram.snopyta.org'),
|
||||
o = operator.methodcaller
|
||||
s = 'setHost'
|
||||
MAP = {
|
||||
"reddit.com": o(s, reddit),
|
||||
"www.reddit.com": o(s, reddit),
|
||||
"old.reddit.com": o(s, reddit),
|
||||
|
||||
"twitter.com": o(s, nitter),
|
||||
"api.twitter.com": o(s, nitter),
|
||||
"mobile.twitter.com": o(s, nitter),
|
||||
"platform.twitter.com": o(s, nitter),
|
||||
"www.platform.twitter.com": o(s, nitter),
|
||||
|
||||
"youtu.be": o(s, invid),
|
||||
"youtube.com": o(s, invid),
|
||||
"www.youtube.com": o(s, invid),
|
||||
|
||||
"www.instagram.com": o(s, 'bibliogram.art'),
|
||||
"www.amazon.com": o(s, 'smile.amazon.com'),
|
||||
}
|
||||
def int_fn(info: interceptor.Request):
|
||||
"""Block the given request if necessary."""
|
||||
if (info.resource_type != interceptor.ResourceType.main_frame or
|
||||
info.request_url.scheme() in {"data", "blob"}):
|
||||
return
|
||||
url = info.request_url
|
||||
redir = REDIRECT_MAP.get(url.host())
|
||||
redir = MAP.get(url.host())
|
||||
if redir is not None and redir(url) is not False:
|
||||
info.redirect(url)
|
||||
interceptor.register(int_fn)
|
||||
|
|
2
.setup
2
.setup
|
@ -15,7 +15,7 @@ web="arcanist aria2 deluge qutebrowser openssh-server speedtest-cli subliminal"
|
|||
|
||||
sudo eopkg it $audio $dev $gui $media $rice $term $web
|
||||
sudo eopkg rm --ignore-dependency tracker
|
||||
pip3 install --user adblock pipipxx readability-lxml sh
|
||||
parallel pip3 install --user --upgrade ::: adblock pipipxx readability-lxml sh
|
||||
parallel pipx install ::: deemix soundscrape tldr
|
||||
|
||||
rm ~/.bashrc
|
||||
|
|
Loading…
Reference in a new issue