diff options
Diffstat (limited to '.config/qutebrowser/config.py')
-rw-r--r-- | .config/qutebrowser/config.py | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py index 9181c43..4d53e39 100644 --- a/.config/qutebrowser/config.py +++ b/.config/qutebrowser/config.py @@ -1,4 +1,6 @@ +import subprocess import os +from qutebrowser.api import interceptor c.content.cookies.accept = "no-3rdparty" c.content.cookies.store = True @@ -16,10 +18,10 @@ c.content.pdfjs = True c.session.lazy_restore = True c.tabs.background = True -c.tabs.position = "bottom" +c.tabs.position = "top" c.content.autoplay = False -c.editor.command = ['urxvt', '-e', 'vim', '{}'] +c.editor.command = ['alacritty', '-e' 'nvim', '{}'] c.url.default_page = "about:blank" # searches @@ -34,16 +36,15 @@ c.url.searchengines['w'] = 'https://www.google.com/search?q={}+site%3Awired.com' c.url.searchengines['e'] = 'https://duckduckgo.com/?q={}+site%3Ahttps%3A%2F%2Fwww.elliotoracle.com%2Fblog%2F&t=fpas&ia=web' # aliases -c.aliases['lux'] = 'open -t https://live.luxagraf.net/admin/' -c.aliases['aws'] = 'open -t https://console.aws.amazon.com/' -c.aliases['dri'] = 'open -t https://drive.google.com/drive/folders/1Rbbmkz5_Oi9bFzzoNbGtju_RbDMnv2Ul' -c.aliases['co'] = 'open -t https://copilot.condenast.io/wrd/dashboard' -c.aliases['air'] = 'open -t https://airtable.com/tblV9JHwZkvs5aHRR/viwGZg2OuVNR8BUiO?blocks=hide' -c.aliases['gma'] = 'open -t https://mail.google.com/mail/u/0/' +c.aliases['lx'] = 'open -t https://luxagraf.net/' +c.aliases['st'] = 'open -t https://awstats.luxagraf.net/cgi-bin/awstats.pl?config=luxagraf.net' +c.aliases['co'] = 'open -t https://live.luxagraf.net/admin/django_comments/comment/' +c.aliases['wm'] = 'open -t https://webmail.luxagraf.net/rainloop/' +c.aliases['ad'] = 'open -t https://live.luxagraf.net/admin/' -# toggle JS -config.bind("xjt", "set content.javascript.enabled true") -config.bind("xjf", "set content.javascript.enabled false") +# ====================== Special Format Yanking =========== {{{ +config.bind("<y><o>", "yank inline [{title}]({url})") +# }}} # block JS out of the box: c.content.javascript.enabled = False @@ -68,6 +69,20 @@ for site in js_whitelist: with config.pattern(site) as p: p.content.javascript.enabled = True +# ================== Youtube Add Blocking ======================= {{{ +def filter_yt(info: interceptor.Request): + """Block the given request if necessary.""" + url = info.request_url + if ( + url.host() == "www.youtube.com" + and url.path() == "/get_video_info" + and "&adformat=" in url.query() + ): + info.block() + +interceptor.register(filter_yt) +# }}} + # keybinds config.unbind('J', mode='normal') @@ -100,6 +115,8 @@ config.bind (',F', 'open --tab {primary}') config.bind (',e', 'open-editor') +#config.set("colors.webpage.darkmode.enabled", True) + # save bookmark to luxagraf config.bind(',s', "jseval --quiet if(document.getSelection){s=document.getSelection();}else{s='';};document.location='https://live.luxagraf.net/admin/links/link/add?&url='+encodeURIComponent(location.href)+'&description='+encodeURIComponent(s)+'&title='+encodeURIComponent(document.title);") |