diff options
Diffstat (limited to '.config/qutebrowser/config.py')
-rw-r--r-- | .config/qutebrowser/config.py | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py index 9181c43..2470922 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 = ['foot', 'nvim', '{}'] c.url.default_page = "about:blank" # searches @@ -29,21 +31,9 @@ c.url.searchengines['g'] = 'http://www.google.com/search?hl=en&source=hp&ie=ISO- c.url.searchengines['a'] = 'https://wiki.archlinux.org/?search={}' c.url.searchengines['y'] = 'https://www.youtube.com/results?search_query={}' c.url.searchengines['ap'] = 'https://www.archlinux.org/packages/?sort=&q={}' -c.url.searchengines['aw'] = 'https://www.amazon.com/s?k={}' 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' +c.url.searchengines['t'] = '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/' - -# toggle JS -config.bind("xjt", "set content.javascript.enabled true") -config.bind("xjf", "set content.javascript.enabled false") # block JS out of the box: c.content.javascript.enabled = False @@ -68,22 +58,36 @@ 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 +# fix J/K config.unbind('J', mode='normal') config.unbind('K', mode='normal') -config.unbind('<Ctrl+v>') config.bind('J', 'tab-prev', mode='normal') config.bind('K', 'tab-next', mode='normal') -# Userscripts -# search history/bookmarks in dmenu -config.bind (',m', 'spawn --userscript dmenu-open ', mode='normal') -config.bind (',o', 'spawn --userscript dmenu-open ', mode='normal') -config.bind (',O', 'spawn --userscript dmenu-open --tab', mode='normal') +# get rid of things I always hit accidentally +config.unbind('<Ctrl+v>') +config.unbind('<Ctrl+q>') +config.unbind('<Ctrl+h>') +# Userscripts # call readability on page -config.bind (',r', 'spawn --userscript readability', mode='normal') +config.bind (',r', 'spawn --userscript myread.py', mode='normal') #download current or hinted video config.bind(';y', 'spawn --userscript youtube-dl') @@ -100,6 +104,10 @@ config.bind (',F', 'open --tab {primary}') config.bind (',e', 'open-editor') +# clear cookies +config.bind('co', 'spawn bisc', mode='normal') +#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);") @@ -125,12 +133,8 @@ config.set( "content.host_blocking.whitelist", [ "duckduckgo.com", - "github.com", - "stackoverflow.com", - "seekingalpha.com", ], ) - solarized = { 'base03': '#002b36', 'base02': '#073642', |