import os ## In v2.0.0+, one of the following two lines is REQUIRED # config.load_autoconfig(False) config.load_autoconfig(True) os.environ['QT_QPA_PLATFORMTHEME'] = 'kde' 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 = 100 c.spellcheck.languages = ["en-US"] c.auto_save.session = True ## Display PDFs within qutebrowser c.content.pdfjs = False 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 c.url.searchengines['DEFAULT'] = 'https://search.brave.com/search?q={}' c.url.searchengines['d'] = 'https://duckduckgo.com/?q={}' c.url.searchengines['b'] = 'https://search.brave.com/search?q={}' c.url.searchengines['s'] = 'https://www.startpage.com/rvd/search?query={}&language=auto' c.url.searchengines['g'] = 'http://www.google.com/search?hl=en&source=hp&ie=ISO-8859-l&q={}' 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' # fuck new reddit config.bind (',2o', '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/' # c.fileselect.handler = 'external' c.fileselect.folder.command = ['urxvt', '-e', 'lfrun', '--choosedir={}'] c.fileselect.multiple_files.command = ['urxvt', '-e', 'sh -c "lfrun"', '--choosefiles={}'] #c.fileselect.single_file.command = ['kitty', '-e', 'vifm', '--choose-files={}'] c.fileselect.single_file.command = ['kitty', "-e", "lfrun", "-selection-path", "{}"] #c.fileselect.single_file.command = ["kitty", "-e", "ranger", "--choosefiles={}"] # block JS out of the box: c.content.javascript.enabled = False #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: with config.pattern(site) as p: p.content.javascript.enabled = True # keybinds config.unbind('J', mode='normal') config.unbind('K', mode='normal') config.unbind('') config.bind('J', 'tab-prev', mode='normal') config.bind('K', 'tab-next', mode='normal') # Userscripts # search history/bookmarks in dmenu config.bind (',o', 'spawn --userscript dmenu_qutebrowser --tab', mode='normal') config.bind (',O', 'spawn --userscript dmenu_qutebrowser ', mode='normal') # call readability on page config.bind (',r', 'spawn --userscript readabilitycustom', mode='normal') #download current or hinted video config.bind(';y', 'spawn --userscript youtube-dl') config.bind(';yh', 'hint links --userscript youtube-dl') # watch current or hinted video config.bind(',yl', 'hint links spawn --detach mpv --force-window yes {hint-url}') config.bind(',yv', 'spawn --detach mpv --force-window yes {url}') config.bind(',ys', 'spawn --userscript youtube-dl') # open selected text in tab config.bind (',f', 'open {primary}') config.bind (',F', 'open --tab {primary}') config.bind (',e', 'edit-text') # 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();") #////////////////////////////////////////// # everything below is color scheme related #////////////////////////////////////////// solarized = { 'base03': '#002b36', 'base02': '#073642', 'base01': '#586e75', 'base00': '#657b83', 'base0': '#839496', 'base1': '#93a1a1', 'base2': '#eee8d5', 'base3': '#fdf6e3', 'yellow': '#b58900', 'orange': '#cb4b16', 'red': '#dc322f', 'magenta': '#d33682', 'violet': '#6c71c4', 'blue': '#268bd2', 'cyan': '#2aa198', 'green': '#859900' } ## Background color of the completion widget category headers. ## Type: QssColor c.colors.completion.category.bg = solarized['base03'] ## Bottom border color of the completion widget category headers. ## Type: QssColor c.colors.completion.category.border.bottom = solarized['base03'] ## Top border color of the completion widget category headers. ## Type: QssColor c.colors.completion.category.border.top = solarized['base03'] ## Foreground color of completion widget category headers. ## Type: QtColor c.colors.completion.category.fg = solarized['base3'] ## Background color of the completion widget for even rows. ## Type: QssColor c.colors.completion.even.bg = solarized['base02'] ## Text color of the completion widget. ## Type: QtColor c.colors.completion.fg = solarized['base1'] ## Background color of the selected completion item. ## Type: QssColor c.colors.completion.item.selected.bg = solarized['violet'] ## Bottom border color of the selected completion item. ## Type: QssColor c.colors.completion.item.selected.border.bottom = solarized['violet'] ## Top border color of the completion widget category headers. ## Type: QssColor c.colors.completion.item.selected.border.top = solarized['violet'] ## Foreground color of the selected completion item. ## Type: QtColor c.colors.completion.item.selected.fg = solarized['base3'] ## Foreground color of the matched text in the completion. ## Type: QssColor c.colors.completion.match.fg = solarized['base2'] ## Background color of the completion widget for odd rows. ## Type: QssColor c.colors.completion.odd.bg = solarized['base02'] ## Color of the scrollbar in completion view ## Type: QssColor c.colors.completion.scrollbar.bg = solarized['base1'] ## Color of the scrollbar handle in completion view. ## Type: QssColor c.colors.completion.scrollbar.fg = solarized['base2'] ## Background color for the download bar. ## Type: QssColor c.colors.downloads.bar.bg = solarized['base03'] ## Background color for downloads with errors. ## Type: QtColor c.colors.downloads.error.bg = solarized['red'] ## Foreground color for downloads with errors. ## Type: QtColor c.colors.downloads.error.fg = solarized['base3'] ## Color gradient start for download backgrounds. ## Type: QtColor # c.colors.downloads.start.bg = '#0000aa' ## Color gradient start for download text. ## Type: QtColor c.colors.downloads.start.fg = solarized['base3'] ## Color gradient stop for download backgrounds. ## Type: QtColor # c.colors.downloads.stop.bg = '#00aa00' ## Color gradient end for download text. ## Type: QtColor # c.colors.downloads.stop.fg = solarized['base3'] ## Color gradient interpolation system for download backgrounds. ## Type: ColorSystem ## Valid values: ## - rgb: Interpolate in the RGB color system. ## - hsv: Interpolate in the HSV color system. ## - hsl: Interpolate in the HSL color system. ## - none: Don't show a gradient. # c.colors.downloads.system.bg = 'rgb' ## Color gradient interpolation system for download text. ## Type: ColorSystem ## Valid values: ## - rgb: Interpolate in the RGB color system. ## - hsv: Interpolate in the HSV color system. ## - hsl: Interpolate in the HSL color system. ## - none: Don't show a gradient. # c.colors.downloads.system.fg = 'rgb' ## Background color for hints. Note that you can use a `rgba(...)` value ## for transparency. ## Type: QssColor c.colors.hints.bg = solarized['violet'] ## Font color for hints. ## Type: QssColor c.colors.hints.fg = solarized['base3'] ## Font color for the matched part of hints. ## Type: QssColor c.colors.hints.match.fg = solarized['base1'] ## Background color of the keyhint widget. ## Type: QssColor # c.colors.keyhint.bg = 'rgba(0, 0, 0, 80%)' ## Text color for the keyhint widget. ## Type: QssColor c.colors.keyhint.fg = solarized['base3'] ## Highlight color for keys to complete the current keychain. ## Type: QssColor c.colors.keyhint.suffix.fg = solarized['yellow'] ## Background color of an error message. ## Type: QssColor c.colors.messages.error.bg = solarized['red'] ## Border color of an error message. ## Type: QssColor c.colors.messages.error.border = solarized['red'] ## Foreground color of an error message. ## Type: QssColor c.colors.messages.error.fg = solarized['base3'] ## Background color of an info message. ## Type: QssColor c.colors.messages.info.bg = solarized['base03'] ## Border color of an info message. ## Type: QssColor c.colors.messages.info.border = solarized['base03'] ## Foreground color an info message. ## Type: QssColor c.colors.messages.info.fg = solarized['base3'] ## Background color of a warning message. ## Type: QssColor c.colors.messages.warning.bg = solarized['orange'] ## Border color of a warning message. ## Type: QssColor c.colors.messages.warning.border = solarized['orange'] ## Foreground color a warning message. ## Type: QssColor c.colors.messages.warning.fg = solarized['base3'] ## Background color for prompts. ## Type: QssColor c.colors.prompts.bg = solarized['base02'] ## Border used around UI elements in prompts. ## Type: String c.colors.prompts.border = '1px solid ' + solarized['base3'] ## Foreground color for prompts. ## Type: QssColor c.colors.prompts.fg = solarized['base3'] ## Background color for the selected item in filename prompts. ## Type: QssColor c.colors.prompts.selected.bg = solarized['base01'] ## Background color of the statusbar in caret mode. ## Type: QssColor c.colors.statusbar.caret.bg = solarized['blue'] ## Foreground color of the statusbar in caret mode. ## Type: QssColor c.colors.statusbar.caret.fg = solarized['base1'] ## Background color of the statusbar in caret mode with a selection. ## Type: QssColor c.colors.statusbar.caret.selection.bg = solarized['violet'] ## Foreground color of the statusbar in caret mode with a selection. ## Type: QssColor c.colors.statusbar.caret.selection.fg = solarized['base1'] ## Background color of the statusbar in command mode. ## Type: QssColor c.colors.statusbar.command.bg = solarized['base03'] ## Foreground color of the statusbar in command mode. ## Type: QssColor c.colors.statusbar.command.fg = solarized['base1'] ## Background color of the statusbar in private browsing + command mode. ## Type: QssColor c.colors.statusbar.command.private.bg = solarized['base01'] ## Foreground color of the statusbar in private browsing + command mode. ## Type: QssColor c.colors.statusbar.command.private.fg = solarized['base3'] ## Background color of the statusbar in insert mode. ## Type: QssColor c.colors.statusbar.insert.bg = solarized['base02'] ## Foreground color of the statusbar in insert mode. ## Type: QssColor c.colors.statusbar.insert.fg = solarized['base1'] ## Background color of the statusbar. ## Type: QssColor c.colors.statusbar.normal.bg = solarized['base03'] ## Foreground color of the statusbar. ## Type: QssColor c.colors.statusbar.normal.fg = solarized['base1'] ## Background color of the statusbar in passthrough mode. ## Type: QssColor c.colors.statusbar.passthrough.bg = solarized['base02'] ## Foreground color of the statusbar in passthrough mode. ## Type: QssColor c.colors.statusbar.passthrough.fg = solarized['base1'] ## Background color of the statusbar in private browsing mode. ## Type: QssColor c.colors.statusbar.private.bg = solarized['base01'] ## Foreground color of the statusbar in private browsing mode. ## Type: QssColor c.colors.statusbar.private.fg = solarized['base3'] ## Background color of the progress bar. ## Type: QssColor c.colors.statusbar.progress.bg = solarized['base1'] ## Foreground color of the URL in the statusbar on error. ## Type: QssColor c.colors.statusbar.url.error.fg = solarized['red'] ## Default foreground color of the URL in the statusbar. ## Type: QssColor c.colors.statusbar.url.fg = solarized['base1'] ## Foreground color of the URL in the statusbar for hovered links. ## Type: QssColor c.colors.statusbar.url.hover.fg = solarized['base2'] ## Foreground color of the URL in the statusbar on successful load ## (http). ## Type: QssColor c.colors.statusbar.url.success.http.fg = solarized['violet'] ## Foreground color of the URL in the statusbar on successful load ## (https). ## Type: QssColor c.colors.statusbar.url.success.https.fg = solarized['base1'] ## Foreground color of the URL in the statusbar when there's a warning. ## Type: QssColor c.colors.statusbar.url.warn.fg = solarized['yellow'] ## Background color of the tab bar. ## Type: QtColor # c.colors.tabs.bar.bg = '#555555' ## Background color of unselected even tabs. ## Type: QtColor c.colors.tabs.even.bg = solarized['base02'] ## Foreground color of unselected even tabs. ## Type: QtColor c.colors.tabs.even.fg = solarized['base1'] ## Color for the tab indicator on errors. ## Type: QtColor c.colors.tabs.indicator.error = solarized['red'] ## Color gradient start for the tab indicator. ## Type: QtColor c.colors.tabs.indicator.start = solarized['violet'] ## Color gradient end for the tab indicator. ## Type: QtColor c.colors.tabs.indicator.stop = solarized['orange'] ## Color gradient interpolation system for the tab indicator. ## Type: ColorSystem ## Valid values: ## - rgb: Interpolate in the RGB color system. ## - hsv: Interpolate in the HSV color system. ## - hsl: Interpolate in the HSL color system. ## - none: Don't show a gradient. # c.colors.tabs.indicator.system = 'rgb' ## Background color of unselected odd tabs. ## Type: QtColor c.colors.tabs.odd.bg = solarized['base03'] ## Foreground color of unselected odd tabs. ## Type: QtColor c.colors.tabs.odd.fg = solarized['base1'] ## Background color of selected even tabs. ## Type: QtColor c.colors.tabs.selected.even.bg = solarized['violet'] ## Foreground color of selected even tabs. ## Type: QtColor c.colors.tabs.selected.even.fg = solarized['base2'] ## Background color of selected odd tabs. ## Type: QtColor c.colors.tabs.selected.odd.bg = solarized['violet'] ## Foreground color of selected odd tabs. ## Type: QtColor c.colors.tabs.selected.odd.fg = solarized['base2'] ## Background color for webpages if unset (or empty to use the theme's ## color) ## Type: QtColor # c.colors.webpage.bg = 'white'