diff options
Diffstat (limited to '.config/qutebrowser/config.py')
-rw-r--r-- | .config/qutebrowser/config.py | 81 |
1 files changed, 32 insertions, 49 deletions
diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py index 88b9d7e..273883d 100644 --- a/.config/qutebrowser/config.py +++ b/.config/qutebrowser/config.py @@ -1,25 +1,41 @@ import os +## In v2.0.0+, one of the following two lines is REQUIRED +# config.load_autoconfig(False) +config.load_autoconfig(True) c.content.cookies.accept = "no-3rdparty" c.content.cookies.store = True +c.content.dns_prefetch = False +c.content.default_encoding = 'utf-8' +c.content.geolocation = False + +## I like my start page(s) and default page to be blank +c.url.start_pages = ["about:blank"] +c.url.default_page = "about:blank" c.downloads.location.directory = '/home/lxf/inbox/' c.downloads.location.suggestion = "both" -c.downloads.remove_finished = 20 +c.downloads.remove_finished = 100 c.spellcheck.languages = ["en-US"] c.auto_save.session = True +## Display PDFs within qutebrowser c.content.pdfjs = True +c.scrolling.bar = 'always' + c.session.lazy_restore = True c.tabs.background = True c.tabs.position = "bottom" c.content.autoplay = False +c.content.blocking.method = 'both' + c.editor.command = ['urxvt', '-e', 'vim', '{}'] +config.bind(',vs', 'view-source --edit') c.url.default_page = "about:blank" # searches @@ -35,32 +51,22 @@ 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' +# fuck new reddit +config.bind (',r2o', 'open https://old.reddit.com/{url:path}') + # aliases c.aliases['lux'] = 'open -t https://luxagraf.net/' c.aliases['live'] = 'open -t https://live.luxagraf.net/' 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") - # block JS out of the box: c.content.javascript.enabled = False -js_whitelist = [ - "*://localhost/*", - "*://127.0.0.1/*", - "*://github.com/*", - "*://gitlab.com/*", - "*://duckduckgo.com/*", - "*://*.youtube.com/*", - "*://*.luxagraf.net/*" - "*://translate.google.com/*", - "*://schoolsfirst.com/*", -] -private_whitelist = os.path.expanduser("~/.config/qutebrowser/private-whitelist") -if os.path.exists(private_whitelist): - with open(private_whitelist) as f: +#enable JS for approved sites +js_whitelist = [] +whitelist = os.path.expanduser("~/.config/qutebrowser/js-whitelist") +if os.path.exists(whitelist): + with open(whitelist) as f: js_whitelist += filter(lambda l: bool(l), f.read().split("\n")) for site in js_whitelist: @@ -102,39 +108,20 @@ config.bind (',e', 'open-editor') # 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);") +# save note to wirednotes config.bind(',wn', "jseval --quiet if(document.getSelection){s=document.getSelection();}else{s='';};document.location='https://live.luxagraf.net/gtd/wirednote/create?url='+encodeURIComponent(location.href)+'&description='+encodeURIComponent(s)+'&title='+encodeURIComponent(document.title);") +# save note to notes config.bind(',n', "jseval --quiet if(document.getSelection){s=document.getSelection();}else{s='';};document.location='https://live.luxagraf.net/gtd/note/create?url='+encodeURIComponent(location.href)+'&description='+encodeURIComponent(s)+'&title='+encodeURIComponent(document.title);") +# check amazon price (not working) config.bind(',c', "jseval --url javascript:void%20function()%7Bvar%20a=0%3C=location.href.search(/(amazon.%7Camzn.)(com%7Cco%5C.uk%7Cca%7Cde%7Cfr%7Ces%7Cit%7Ccn%7Cco%5C.jp).+/i),b=0%3C=location.href.search(/amazon.(com%7Cco%5C.uk%7Cca%7Cde%7Cfr%7Ces%7Cit%7Ccn%7Cco%5C.jp).*%5C/(asin%7Cdp%7Cgp%7Cproduct%7Cexec%5C/obidos%7Cgp%5C/offer-listing%7Cproduct%5C-reviews%7Cgp%5C/aw%5C/d)%5C/[A-Z0-9]%7B10,13%7D/i),c=0%3C=location.href.search(/camelcamelcamel.com/i),d=null!=document.getElementById(%22ccc-injected-links-569DE51E-99CE-4ACE-BD10-7F85542A54A8%22),e=%22ctx_prid=5%26utm_campaign=bookmarklet%26v_camelet=%22+%220.2%22;if(b)try%7Bvar%20f=document.getElementById(%22ASIN%22).value;window.open(%22https://camelcamelcamel.com/search%3Fq=%22+window.location.origin+%22/dp/%22+f+%22%26%22+e,%22_blank%22)%7Dcatch(a)%7Bwindow.open(%22https://camelcamelcamel.com/search%3Fq=%22+encodeURIComponent(location.href)+%22%26%22+e,%22_blank%22)%7Delse%20window.open(%22https://camelcamelcamel.com/%3F%22+e,%22_self%22)%7D();") -import sys, os - -#sys.path.append(os.path.join(sys.path[0], "jblock")) -#config.source("jblock/jblock/integrations/qutebrowser.py") -#config.set( -# "content.host_blocking.lists", -# [ -# "https://easylist.to/easylist/fanboy-annoyance.txt", -# "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt", -# "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/annoyances.txt", -# "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badware.txt", -# "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/privacy.txt", -# "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/resource-abuse.txt", -# "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/unbreak.txt", -# "https://www.malwaredomainlist.com/hostslist/hosts.txt", -# ], -#) - -config.set( - "content.blocking.whitelist", - [ - "duckduckgo.com", - "github.com", - "stackoverflow.com", - ], -) +#////////////////////////////////////////// +# everything below is color scheme related + +#////////////////////////////////////////// solarized = { 'base03': '#002b36', 'base02': '#073642', @@ -154,10 +141,6 @@ solarized = { 'green': '#859900' } -## This is here so configs done via the GUI are still loaded. -## Remove it to not load settings done via the GUI. -config.load_autoconfig() - ## Background color of the completion widget category headers. ## Type: QssColor c.colors.completion.category.bg = solarized['base03'] |