X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/1c89bd14849b914e9c62febdb065fbf66db53aed..2bc5cc531c50d87c208965cdc80c0f42df56ecb1:/qutebrowser/config.py diff --git a/qutebrowser/config.py b/qutebrowser/config.py index 2378f63..cbb8310 100644 --- a/qutebrowser/config.py +++ b/qutebrowser/config.py @@ -1,11 +1,24 @@ ## Autogenerated config.py +## +## NOTE: config.py is intended for advanced users who are comfortable +## with manually migrating the config file on qutebrowser upgrades. If +## you prefer, you can also configure qutebrowser using the +## :set/:bind/:config-* commands without having to write a config.py +## file. +## ## Documentation: ## qute://help/configuring.html ## qute://help/settings.html -## 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() +def in_terminal(cmd: list): + """Wraps cmd to be run in the default TERMINAL, as set by environment. + + :cmd: cmd to execute in TERMINAL + :returns: A shell command as a list + """ + from os import getenv + t = getenv('TERMINAL', 'xterm') + return [t, '-e'] + cmd try: from qutebrowser.api import interceptor, message @@ -14,7 +27,7 @@ try: def intercept(info: interceptor.Request): url = info.request_url if url.host() == "twitter.com": - url.setHost("nitter.net") + url.setHost("nitter.eu") message.info("Redirecting to " + url.toString()) info.redirect(url) if url.host() == "xkcd.com": @@ -30,6 +43,10 @@ try: except ImportError: pass +## 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(True) + ## Aliases for commands. The keys of the given dictionary are the ## aliases, while the values are the commands they map to. ## Type: Dict @@ -57,429 +74,50 @@ c.aliases = {'w': 'session-save', c.auto_save.session = True ## Backend to use to display websites. qutebrowser supports two different -## web rendering engines / backends, QtWebKit and QtWebEngine. QtWebKit -## was discontinued by the Qt project with Qt 5.6, but picked up as a -## well maintained fork: https://github.com/annulen/webkit/wiki - -## qutebrowser only supports the fork. QtWebEngine is Qt's official -## successor to QtWebKit. It's slightly more resource hungry than -## QtWebKit and has a couple of missing features in qutebrowser, but is -## generally the preferred choice. +## web rendering engines / backends, QtWebEngine and QtWebKit (not +## recommended). QtWebEngine is Qt's official successor to QtWebKit, and +## both the default/recommended backend. It's based on a stripped-down +## Chromium and regularly updated with security fixes and new features by +## the Qt project: https://wiki.qt.io/QtWebEngine QtWebKit was +## qutebrowser's original backend when the project was started. However, +## support for QtWebKit was discontinued by the Qt project with Qt 5.6 in +## 2016. The development of QtWebKit was picked up in an official fork: +## https://github.com/qtwebkit/qtwebkit - however, the project seems to +## have stalled again. The latest release (5.212.0 Alpha 4) from March +## 2020 is based on a WebKit version from 2016, with many known security +## vulnerabilities. Additionally, there is no process isolation and +## sandboxing. Due to all those issues, while support for QtWebKit is +## still available in qutebrowser for now, using it is strongly +## discouraged. ## Type: String ## Valid values: -## - webengine: Use QtWebEngine (based on Chromium). -## - webkit: Use QtWebKit (based on WebKit, similar to Safari). +## - webengine: Use QtWebEngine (based on Chromium - recommended). +## - webkit: Use QtWebKit (based on WebKit, similar to Safari - many known security issues!). # c.backend = 'webengine' -## This setting can be used to map keys to other keys. When the key used -## as dictionary-key is pressed, the binding for the key used as -## dictionary-value is invoked instead. This is useful for global -## remappings of keys, for example to map Ctrl-[ to Escape. Note that -## when a key is bound (via `bindings.default` or `bindings.commands`), -## the mapping is ignored. +## Map keys to other keys, so that they are equivalent in all modes. When +## the key used as dictionary-key is pressed, the binding for the key +## used as dictionary-value is invoked instead. This is useful for global +## remappings of keys, for example to map to . NOTE: +## This should only be used if two keys should always be equivalent, i.e. +## for things like (keypad) and (non-keypad). For normal +## command bindings, qutebrowser works differently to vim: You always +## bind keys to commands, usually via `:bind` or `config.bind()`. Instead +## of using this setting, consider finding the command a key is bound to +## (e.g. via `:bind gg`) and then binding the same command to the desired +## key. Note that when a key is bound (via `bindings.default` or +## `bindings.commands`), the mapping is ignored. ## Type: Dict # c.bindings.key_mappings = {'': '', '': '', '': '', '': '', '': '', '': '', '': '', '': '', '': ''} -## Background color of the completion widget category headers. -## Type: QssColor -# c.colors.completion.category.bg = 'qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #505050)' - -## Bottom border color of the completion widget category headers. -## Type: QssColor -# c.colors.completion.category.border.bottom = 'black' - -## Top border color of the completion widget category headers. -## Type: QssColor -# c.colors.completion.category.border.top = 'black' - -## Foreground color of completion widget category headers. -## Type: QtColor -# c.colors.completion.category.fg = 'white' - -## Background color of the completion widget for even rows. -## Type: QssColor -# c.colors.completion.even.bg = '#333333' - -## Text color of the completion widget. May be a single color to use for -## all columns or a list of three colors, one for each column. -## Type: List of QtColor, or QtColor -# c.colors.completion.fg = ['white', 'white', 'white'] - -## Background color of the selected completion item. -## Type: QssColor -# c.colors.completion.item.selected.bg = '#e8c000' - -## Bottom border color of the selected completion item. -## Type: QssColor -# c.colors.completion.item.selected.border.bottom = '#bbbb00' - -## Top border color of the selected completion item. -## Type: QssColor -# c.colors.completion.item.selected.border.top = '#bbbb00' - -## Foreground color of the selected completion item. -## Type: QtColor -# c.colors.completion.item.selected.fg = 'black' - -## Foreground color of the matched text in the selected completion item. -## Type: QtColor -# c.colors.completion.item.selected.match.fg = '#ff4444' - -## Foreground color of the matched text in the completion. -## Type: QtColor -# c.colors.completion.match.fg = '#ff4444' - -## Background color of the completion widget for odd rows. -## Type: QssColor -# c.colors.completion.odd.bg = '#444444' - -## Color of the scrollbar in the completion view. -## Type: QssColor -# c.colors.completion.scrollbar.bg = '#333333' - -## Color of the scrollbar handle in the completion view. -## Type: QssColor -# c.colors.completion.scrollbar.fg = 'white' - -## Background color of disabled items in the context menu. If set to -## null, the Qt default is used. -## Type: QssColor -# c.colors.contextmenu.disabled.bg = None - -## Foreground color of disabled items in the context menu. If set to -## null, the Qt default is used. -## Type: QssColor -# c.colors.contextmenu.disabled.fg = None - -## Background color of the context menu. If set to null, the Qt default -## is used. -## Type: QssColor -# c.colors.contextmenu.menu.bg = None - -## Foreground color of the context menu. If set to null, the Qt default -## is used. -## Type: QssColor -# c.colors.contextmenu.menu.fg = None - -## Background color of the context menu's selected item. If set to null, -## the Qt default is used. -## Type: QssColor -# c.colors.contextmenu.selected.bg = None - -## Foreground color of the context menu's selected item. If set to null, -## the Qt default is used. -## Type: QssColor -# c.colors.contextmenu.selected.fg = None - -## Background color for the download bar. -## Type: QssColor -# c.colors.downloads.bar.bg = 'black' - -## Background color for downloads with errors. -## Type: QtColor -# c.colors.downloads.error.bg = 'red' - -## Foreground color for downloads with errors. -## Type: QtColor -# c.colors.downloads.error.fg = 'white' - -## 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 = 'white' - -## 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 = 'white' - -## 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 = 'qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 247, 133, 0.8), stop:1 rgba(255, 197, 66, 0.8))' - -## Font color for hints. -## Type: QssColor -# c.colors.hints.fg = 'black' - -## Font color for the matched part of hints. -## Type: QtColor -# c.colors.hints.match.fg = 'green' - -## 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 = '#FFFFFF' - -## Highlight color for keys to complete the current keychain. -## Type: QssColor -# c.colors.keyhint.suffix.fg = '#FFFF00' - -## Background color of an error message. -## Type: QssColor -# c.colors.messages.error.bg = 'red' - -## Border color of an error message. -## Type: QssColor -# c.colors.messages.error.border = '#bb0000' - -## Foreground color of an error message. -## Type: QssColor -# c.colors.messages.error.fg = 'white' - -## Background color of an info message. -## Type: QssColor -# c.colors.messages.info.bg = 'black' - -## Border color of an info message. -## Type: QssColor -# c.colors.messages.info.border = '#333333' - -## Foreground color of an info message. -## Type: QssColor -# c.colors.messages.info.fg = 'white' - -## Background color of a warning message. -## Type: QssColor -# c.colors.messages.warning.bg = 'darkorange' - -## Border color of a warning message. -## Type: QssColor -# c.colors.messages.warning.border = '#d47300' - -## Foreground color of a warning message. -## Type: QssColor -# c.colors.messages.warning.fg = 'white' - -## Background color for prompts. -## Type: QssColor -c.colors.prompts.bg = '#333333' - -## Border used around UI elements in prompts. +## When to show a changelog after qutebrowser was upgraded. ## Type: String -# c.colors.prompts.border = '1px solid gray' - -## Foreground color for prompts. -## Type: QssColor -# c.colors.prompts.fg = 'white' - -## Background color for the selected item in filename prompts. -## Type: QssColor -# c.colors.prompts.selected.bg = 'grey' - -## Background color of the statusbar in caret mode. -## Type: QssColor -# c.colors.statusbar.caret.bg = 'purple' - -## Foreground color of the statusbar in caret mode. -## Type: QssColor -# c.colors.statusbar.caret.fg = 'white' - -## Background color of the statusbar in caret mode with a selection. -## Type: QssColor -# c.colors.statusbar.caret.selection.bg = '#a12dff' - -## Foreground color of the statusbar in caret mode with a selection. -## Type: QssColor -# c.colors.statusbar.caret.selection.fg = 'white' - -## Background color of the statusbar in command mode. -## Type: QssColor -# c.colors.statusbar.command.bg = 'black' - -## Foreground color of the statusbar in command mode. -## Type: QssColor -# c.colors.statusbar.command.fg = 'white' - -## Background color of the statusbar in private browsing + command mode. -## Type: QssColor -# c.colors.statusbar.command.private.bg = 'darkslategray' - -## Foreground color of the statusbar in private browsing + command mode. -## Type: QssColor -# c.colors.statusbar.command.private.fg = 'white' - -## Background color of the statusbar in insert mode. -## Type: QssColor -# c.colors.statusbar.insert.bg = 'darkgreen' - -## Foreground color of the statusbar in insert mode. -## Type: QssColor -# c.colors.statusbar.insert.fg = 'white' - -## Background color of the statusbar. -## Type: QssColor -# c.colors.statusbar.normal.bg = 'black' - -## Foreground color of the statusbar. -## Type: QssColor -# c.colors.statusbar.normal.fg = 'white' - -## Background color of the statusbar in passthrough mode. -## Type: QssColor -# c.colors.statusbar.passthrough.bg = 'darkblue' - -## Foreground color of the statusbar in passthrough mode. -## Type: QssColor -# c.colors.statusbar.passthrough.fg = 'white' - -## Background color of the statusbar in private browsing mode. -## Type: QssColor -# c.colors.statusbar.private.bg = '#666666' - -## Foreground color of the statusbar in private browsing mode. -## Type: QssColor -# c.colors.statusbar.private.fg = 'white' - -## Background color of the progress bar. -## Type: QssColor -# c.colors.statusbar.progress.bg = 'white' - -## Foreground color of the URL in the statusbar on error. -## Type: QssColor -# c.colors.statusbar.url.error.fg = 'orange' - -## Default foreground color of the URL in the statusbar. -## Type: QssColor -# c.colors.statusbar.url.fg = 'white' - -## Foreground color of the URL in the statusbar for hovered links. -## Type: QssColor -# c.colors.statusbar.url.hover.fg = 'aqua' - -## Foreground color of the URL in the statusbar on successful load -## (http). -## Type: QssColor -# c.colors.statusbar.url.success.http.fg = 'white' - -## Foreground color of the URL in the statusbar on successful load -## (https). -## Type: QssColor -# c.colors.statusbar.url.success.https.fg = 'lime' - -## Foreground color of the URL in the statusbar when there's a warning. -## Type: QssColor -# c.colors.statusbar.url.warn.fg = 'yellow' - -## Background color of the tab bar. -## Type: QssColor -# c.colors.tabs.bar.bg = '#555555' - -## Background color of unselected even tabs. -## Type: QtColor -# c.colors.tabs.even.bg = 'darkgrey' - -## Foreground color of unselected even tabs. -## Type: QtColor -# c.colors.tabs.even.fg = 'white' - -## Color for the tab indicator on errors. -## Type: QtColor -# c.colors.tabs.indicator.error = '#ff0000' - -## Color gradient start for the tab indicator. -## Type: QtColor -# c.colors.tabs.indicator.start = '#0000aa' - -## Color gradient end for the tab indicator. -## Type: QtColor -# c.colors.tabs.indicator.stop = '#00aa00' - -## 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 = 'grey' - -## Foreground color of unselected odd tabs. -## Type: QtColor -# c.colors.tabs.odd.fg = 'white' - -## Background color of pinned unselected even tabs. -## Type: QtColor -# c.colors.tabs.pinned.even.bg = 'darkseagreen' - -## Foreground color of pinned unselected even tabs. -## Type: QtColor -# c.colors.tabs.pinned.even.fg = 'white' - -## Background color of pinned unselected odd tabs. -## Type: QtColor -# c.colors.tabs.pinned.odd.bg = 'seagreen' - -## Foreground color of pinned unselected odd tabs. -## Type: QtColor -# c.colors.tabs.pinned.odd.fg = 'white' - -## Background color of pinned selected even tabs. -## Type: QtColor -# c.colors.tabs.pinned.selected.even.bg = 'black' - -## Foreground color of pinned selected even tabs. -## Type: QtColor -# c.colors.tabs.pinned.selected.even.fg = 'white' - -## Background color of pinned selected odd tabs. -## Type: QtColor -# c.colors.tabs.pinned.selected.odd.bg = 'black' - -## Foreground color of pinned selected odd tabs. -## Type: QtColor -# c.colors.tabs.pinned.selected.odd.fg = 'white' - -## Background color of selected even tabs. -## Type: QtColor -# c.colors.tabs.selected.even.bg = 'black' - -## Foreground color of selected even tabs. -## Type: QtColor -# c.colors.tabs.selected.even.fg = 'white' - -## Background color of selected odd tabs. -## Type: QtColor -# c.colors.tabs.selected.odd.bg = 'black' - -## Foreground color of selected odd tabs. -## Type: QtColor -# c.colors.tabs.selected.odd.fg = 'white' - -## Background color for webpages if unset (or empty to use the theme's -## color). -## Type: QtColor -# c.colors.webpage.bg = 'white' +## - major: Show changelog for major upgrades (e.g. v2.0.0 -> v3.0.0). +## - minor: Show changelog for major and minor upgrades (e.g. v2.0.0 -> v2.1.0). +## - patch: Show changelog for major, minor and patch upgrades (e.g. v2.0.0 -> v2.0.1). +## - never: Never show changelog after upgrades. +c.changelog_after_upgrade = 'patch' ## Which algorithm to use for modifying how colors are rendered with ## darkmode. The `lightness-cielab` value was added with QtWebEngine 5.14 @@ -532,7 +170,9 @@ c.colors.prompts.bg = '#333333' ## - smart: Apply dark mode based on image content. Not available with Qt 5.15.0. # c.colors.webpage.darkmode.policy.images = 'smart' -## Which pages to apply dark mode to. +## Which pages to apply dark mode to. The underlying Chromium setting has +## been removed in QtWebEngine 5.15.3, thus this setting is ignored +## there. Instead, every element is now classified individually. ## Type: String ## Valid values: ## - always: Apply dark mode filter to all frames, regardless of content. @@ -554,9 +194,17 @@ c.colors.prompts.bg = '#333333' ## Type: Int # c.colors.webpage.darkmode.threshold.text = 256 -## Force `prefers-color-scheme: dark` colors for websites. -## Type: Bool -c.colors.webpage.prefers_color_scheme_dark = True +## Value to use for `prefers-color-scheme:` for websites. The "light" +## value is only available with QtWebEngine 5.15.2+. On older versions, +## it is the same as "auto". The "auto" value is broken on QtWebEngine +## 5.15.2 due to a Qt bug. There, it will fall back to "light" +## unconditionally. +## Type: String +## Valid values: +## - auto: Use the system-wide color scheme setting. +## - light: Force a light theme. +## - dark: Force a dark theme. +# c.colors.webpage.preferred_color_scheme = 'auto' ## Number of commands to save in the command history. 0: no history / -1: ## unlimited @@ -632,9 +280,9 @@ c.completion.shrink = True ## A list of patterns which should not be shown in the history. This only ## affects the completion. Matching URLs are still saved in the history -## (and visible on the qute://history page), but hidden in the -## completion. Changing this setting will cause the completion history to -## be regenerated on the next start, which will take a short while. +## (and visible on the `:history` page), but hidden in the completion. +## Changing this setting will cause the completion history to be +## regenerated on the next start, which will take a short while. ## Type: List of UrlPattern # c.completion.web_history.exclude = [] @@ -671,6 +319,12 @@ c.confirm_quit = ['downloads'] ## Type: Bool # c.content.blocking.enabled = True +## Block subdomains of blocked hosts. Note: If only a single subdomain is +## blocked but should be allowed, consider using +## `content.blocking.whitelist` instead. +## Type: Bool +# c.content.blocking.hosts.block_subdomains = True + ## List of URLs to host blocklists for the host blocker. Only used when ## the simple host-blocker is used (see `content.blocking.method`). The ## file can be in one of the following formats: - An `/etc/hosts`-like @@ -719,7 +373,7 @@ c.confirm_quit = ['downloads'] ## page cache allows for a nicer user experience when navigating forth or ## back to pages in the forward/back history, by pausing and resuming up ## to _n_ pages. For more information about the feature, please refer to: -## http://webkit.org/blog/427/webkit-page-cache-i-the-basics/ +## https://webkit.org/blog/427/webkit-page-cache-i-the-basics/ ## Type: Int # c.content.cache.maximum_pages = 0 @@ -742,14 +396,21 @@ c.confirm_quit = ['downloads'] ## unknown-3rdparty` per-domain on QtWebKit will have the same effect as ## `all`. If this setting is used with URL patterns, the pattern gets ## applied to the origin/first party URL of the page making the request, -## not the request URL. +## not the request URL. With QtWebEngine 5.15.0+, paths will be stripped +## from URLs, so URL patterns using paths will not match. With +## QtWebEngine 5.15.2+, subdomains are additionally stripped as well, so +## you will typically need to set this setting for `example.com` when the +## cookie is set on `somesubdomain.example.com` for it to work properly. +## To debug issues with this setting, start qutebrowser with `--debug +## --logfilter network --debug-flag log-cookies` which will show all +## cookies being set. ## Type: String ## Valid values: ## - all: Accept all cookies. ## - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail. ## - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty. ## - never: Don't accept cookies at all. -c.content.cookies.accept = 'never' +c.content.cookies.accept = 'no-3rdparty' ## Store cookies. ## Type: Bool @@ -770,7 +431,7 @@ c.content.cookies.accept = 'never' ## Try to pre-fetch DNS entries to speed up browsing. ## Type: Bool -c.content.dns_prefetch = True +# c.content.dns_prefetch = True ## Expand each subframe to its contents. This will flatten all the frames ## to become one scrollable page. @@ -811,8 +472,10 @@ c.content.headers.accept_language = 'en-UK;q=1.0, en;q=0.9, de;q=0.7, fr;q=0.7, # c.content.headers.do_not_track = True ## When to send the Referer header. The Referer header tells websites -## from which website you were coming from when visiting them. No restart -## is needed with QtWebKit. +## from which website you were coming from when visiting them. Note that +## with QtWebEngine, websites can override this preference by setting the +## `Referrer-Policy:` header, so that any websites visited from them get +## the full referer. No restart is needed with QtWebKit. ## Type: String ## Valid values: ## - always: Always send the Referer. @@ -836,31 +499,6 @@ c.content.headers.accept_language = 'en-UK;q=1.0, en;q=0.9, de;q=0.7, fr;q=0.7, ## Type: FormatString # c.content.headers.user_agent = 'Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {qt_key}/{qt_version} {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version}' -## Enable host blocking. -## Type: Bool -# c.content.host_blocking.enabled = True - -## List of URLs of lists which contain hosts to block. The file can be -## in one of the following formats: - An `/etc/hosts`-like file - One -## host per line - A zip-file of any of the above, with either only one -## file, or a file named `hosts` (with any extension). It's also -## possible to add a local file or directory via a `file://` URL. In case -## of a directory, all files in the directory are read as adblock lists. -## The file `~/.config/qutebrowser/blocked-hosts` is always read if it -## exists. -## Type: List of Url -# c.content.host_blocking.lists = ['https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts'] - -## A list of patterns that should always be loaded, despite being ad- -## blocked. Note this whitelists blocked hosts, not first-party URLs. As -## an example, if `example.org` loads an ad from `ads.example.org`, the -## whitelisted host should be `ads.example.org`. If you want to disable -## the adblocker on a given page, use the `content.host_blocking.enabled` -## setting with a URL pattern instead. Local domains are always exempt -## from hostblocking. -## Type: List of UrlPattern -# c.content.host_blocking.whitelist = [] - ## Enable hyperlink auditing (``). ## Type: Bool # c.content.hyperlink_auditing = False @@ -969,9 +607,36 @@ c.content.headers.accept_language = 'en-UK;q=1.0, en;q=0.9, de;q=0.7, fr;q=0.7, ## - true ## - false ## - ask -c.content.notifications = 'ask' -config.set('content.notifications', True, '*://*.gitlab.com/*') -config.set('content.notifications', True, '*://*.google.com/*') +c.content.notifications.enabled = 'ask' +config.set('content.notifications.enabled', True, '*://*.gitlab.com/*') +config.set('content.notifications.enabled', True, '*://*.google.com/*') + +## What notification presenter to use for web notifications. Note that +## not all implementations support all features of notifications: - With +## PyQt 5.14, any setting other than `qt` does not support the `click` +## and `close` events, as well as the `tag` option to replace existing +## notifications. - The `qt` and `systray` options only support showing +## one notification at the time and ignore the `tag` option to replace +## existing notifications. - The `herbe` option only supports showing one +## notification at the time and doesn't show icons. - The `messages` +## option doesn't show icons and doesn't support the `click` and +## `close` events. +## Type: String +## Valid values: +## - auto: Tries `libnotify`, `systray` and `messages`, uses the first one available without showing error messages. +## - qt: Use Qt's native notification presenter, based on a system tray icon. Switching from or to this value requires a restart of qutebrowser. Recommended over `systray` on PyQt 5.14. +## - libnotify: Shows messages via DBus in a libnotify-compatible way. If DBus isn't available, falls back to `systray` or `messages`, but shows an error message. +## - systray: Use a notification presenter based on a systray icon. Falls back to `libnotify` or `messages` if not systray is available. This is a reimplementation of the `qt` setting value, but with the possibility to switch to it at runtime. +## - messages: Show notifications as qutebrowser messages. Most notification features aren't available. +## - herbe: (experimental!) Show notifications using herbe (github.com/dudik/herbe). Most notification features aren't available. +# c.content.notifications.presenter = 'auto' + +## Whether to show the origin URL for notifications. Note that URL +## patterns with this setting only get matched against the origin part of +## the URL, so e.g. paths in patterns will never match. Note that with +## the `qt` presenter, origins are never shown. +## Type: Bool +# c.content.notifications.show_origin = True ## Allow pdf.js to view PDF files in the browser. Note that the files can ## still be downloaded by clicking the download button in the pdf.js @@ -992,6 +657,14 @@ config.set('content.notifications', True, '*://*.google.com/*') ## Type: Bool # c.content.plugins = False +## Request websites to minimize non-essentials animations and motion. +## This results in the `prefers-reduced-motion` CSS media query to +## evaluate to `reduce` (rather than `no-preference`). On Windows, if +## this setting is set to False, the system-wide animation setting is +## considered. +## Type: Bool +# c.content.prefers_reduced_motion = False + ## Draw the background color and images also when the page is printed. ## Type: Bool # c.content.print_element_backgrounds = True @@ -1031,15 +704,35 @@ with config.pattern('*://calendar.google.com/*') as p: ## Enable quirks (such as faked user agent headers) needed to get ## specific sites to work properly. ## Type: Bool -# c.content.site_specific_quirks = True +# c.content.site_specific_quirks.enabled = True -## Validate SSL handshakes. -## Type: BoolAsk +## Disable a list of named quirks. The js-string-replaceall quirk is +## needed for Nextcloud Calendar < 2.2.0 with QtWebEngine < 5.15.3. +## However, the workaround is not fully compliant to the ECMAScript spec +## and might cause issues on other websites, so it's disabled by default. +## Type: FlagList ## Valid values: -## - true -## - false -## - ask -# c.content.ssl_strict = 'ask' +## - ua-whatsapp +## - ua-google +## - ua-slack +## - ua-googledocs +## - js-whatsapp-web +## - js-discord +## - js-string-replaceall +## - js-globalthis +## - js-object-fromentries +## - misc-krunker +## - misc-mathml-darkmode +# c.content.site_specific_quirks.skip = ['js-string-replaceall'] + +## How to proceed on TLS certificate errors. +## Type: String +## Valid values: +## - ask: Ask how to proceed for every certificate error (unless non-overridable due to HSTS). +## - ask-block-thirdparty: Ask how to proceed for normal page loads, but silently block resource loads. +## - block: Automatically block loading on certificate errors. +## - load-insecurely: Force loading pages despite certificate errors. This is *insecure* and should be avoided. Instead of using this, consider fixing the underlying issue or importing a self-signed certificate via `certutil` (or Chromium) instead. +# c.content.tls.certificate_errors = 'ask' ## How navigation requests to URLs with unknown schemes are handled. ## Type: String @@ -1109,6 +802,13 @@ c.downloads.open_dispatcher = "rifle" ## - bottom # c.downloads.position = 'top' +## Automatically abort insecure (HTTP) downloads originating from secure +## (HTTPS) pages. For per-domain settings, the relevant URL is the URL +## initiating the download, not the URL the download itself is coming +## from. It's not recommended to set this setting to false globally. +## Type: Bool +# c.downloads.prevent_mixed_content = True + ## Duration (in milliseconds) to wait before removing finished downloads. ## If set to -1, downloads are never removed. ## Type: Int @@ -1121,12 +821,20 @@ c.downloads.open_dispatcher = "rifle" ## `{line0}`: Same as `{line}`, but starting from index 0. * `{column0}`: ## Same as `{column}`, but starting from index 0. ## Type: ShellCommand -c.editor.command = ['urxvtc', '-e', 'vim', '{file}', '-c', 'normal {line}G{column0}l'] +c.editor.command = in_terminal(['vim', '{file}', '-c', 'normal {line}G{column0}l']) ## Encoding to use for the editor. ## Type: Encoding # c.editor.encoding = 'utf-8' +## Command (and arguments) to use for selecting a single folder in forms. +## The command should write the selected folder path to the specified +## file or stdout. The following placeholders are defined: * `{}`: +## Filename of the file to be written to. If not contained in any +## argument, the standard output of the command is read instead. +## Type: ShellCommand +c.fileselect.folder.command = in_terminal(['ranger', '--choosedir={}']) + ## Handler for selecting file(s) in forms. If `external`, then the ## commands specified by `fileselect.single_file.command` and ## `fileselect.multiple_files.command` are used to select one or multiple @@ -1135,21 +843,24 @@ c.editor.command = ['urxvtc', '-e', 'vim', '{file}', '-c', 'normal {line}G{colum ## Valid values: ## - default: Use the default file selector. ## - external: Use an external command. -# c.fileselect.handler = 'default' +c.fileselect.handler = 'external' ## Command (and arguments) to use for selecting multiple files in forms. -## The command should write the selected file paths to the specified -## file, separated by newlines. The following placeholders are defined: * -## `{}`: Filename of the file to be written to. +## The command should write the selected file paths to the specified file +## or to stdout, separated by newlines. The following placeholders are +## defined: * `{}`: Filename of the file to be written to. If not +## contained in any argument, the standard output of the command is +## read instead. ## Type: ShellCommand -# c.fileselect.multiple_files.command = ['xterm', '-e', 'ranger', '--choosefiles={}'] +c.fileselect.multiple_files.command = in_terminal(['ranger', '--choosefiles={}']) ## Command (and arguments) to use for selecting a single file in forms. -## The command should write the selected file path to the specified file. -## The following placeholders are defined: * `{}`: Filename of the file -## to be written to. +## The command should write the selected file path to the specified file +## or stdout. The following placeholders are defined: * `{}`: Filename of +## the file to be written to. If not contained in any argument, the +## standard output of the command is read instead. ## Type: ShellCommand -# c.fileselect.single_file.command = ['xterm', '-e', 'ranger', '--choosefile={}'] +c.fileselect.single_file.command = in_terminal(['ranger', '--choosefile={}']) ## Font used in the completion categories. ## Type: Font @@ -1172,7 +883,7 @@ c.editor.command = ['urxvtc', '-e', 'vim', '{file}', '-c', 'normal {line}G{colum ## font setting, it's replaced with the fonts listed here. If set to an ## empty value, a system-specific monospace default is used. ## Type: List of Font, or Font -c.fonts.default_family = ["Hack"] +c.fonts.default_family = ["Fira Code"] ## Default font size to use. Whenever "default_size" is used in a font ## setting, it's replaced with the size listed here. Valid values are @@ -1301,7 +1012,7 @@ c.hints.chars = 'aoeuidhtns' ## Leave hint mode when starting a new page load. ## Type: Bool -# c.hints.leave_on_load = True +# c.hints.leave_on_load = False ## Minimum number of characters used for hint strings. ## Type: Int @@ -1381,7 +1092,7 @@ c.hints.scatter = False ## unreliable on this setting, and they may match the url you are ## navigating to, or the URL you are navigating from. ## Type: Bool -# c.input.insert_mode.leave_on_load = False +c.input.insert_mode.leave_on_load = True ## Switch to insert mode when clicking flash and other plugins. ## Type: Bool @@ -1391,6 +1102,11 @@ c.hints.scatter = False ## Type: Bool # c.input.links_included_in_focus_chain = True +## Whether the underlying Chromium should handle media keys. On Linux, +## disabling this also disables Chromium's MPRIS integration. +## Type: Bool +# c.input.media_keys = True + ## Enable back and forward buttons on the mouse. ## Type: Bool # c.input.mouse.back_forward_buttons = True @@ -1405,7 +1121,7 @@ c.hints.scatter = False ## cleared after this time. If set to 0, partially typed bindings are ## never cleared. ## Type: Int -c.input.partial_timeout = 5000 +# c.input.partial_timeout = 0 ## Enable spatial navigation. Spatial navigation consists in the ability ## to navigate between focusable elements in a Web page, such as @@ -1457,7 +1173,7 @@ c.input.partial_timeout = 5000 ## Duration (in milliseconds) to show messages in the statusbar for. Set ## to 0 to never clear messages. ## Type: Int -# c.messages.timeout = 2000 +# c.messages.timeout = 3000 ## How to open links in an existing instance if a new one is launched. ## This happens when e.g. opening a link from a terminal. See @@ -1496,7 +1212,7 @@ c.input.partial_timeout = 5000 ## https://peter.sh/experiments/chromium-command-line-switches/ for a ## list) will work. ## Type: List of String -c.qt.args = [str('proxy-pac-url=file://' / config.configdir / 'proxy.pac')] +c.qt.args = ['proxy-pac-url=file://' + str(config.configdir / 'proxy.pac')] ## Additional environment variables to set. Setting an environment ## variable to null/None will unset it. @@ -1556,6 +1272,25 @@ c.qt.args = [str('proxy-pac-url=file://' / config.configdir / 'proxy.pac')] ## - single-process: Run all tabs in a single process. This should be used for debugging purposes only, and it disables `:open --private`. # c.qt.process_model = 'process-per-site-instance' +## Work around locale parsing issues in QtWebEngine 5.15.3. With some +## locales, QtWebEngine 5.15.3 is unusable without this workaround. In +## affected scenarios, QtWebEngine will log "Network service crashed, +## restarting service." and only display a blank page. However, It is +## expected that distributions shipping QtWebEngine 5.15.3 follow up with +## a proper fix soon, so it is disabled by default. +## Type: Bool +# c.qt.workarounds.locale = False + +## Delete the QtWebEngine Service Worker directory on every start. This +## workaround can help with certain crashes caused by an unknown +## QtWebEngine bug related to Service Workers. Those crashes happen +## seemingly immediately on Windows; after one hour of operation on other +## systems. Note however that enabling this option *can lead to data +## loss* on some pages (as Service Worker data isn't persisted) and will +## negatively impact start-up time. +## Type: Bool +# c.qt.workarounds.remove_service_workers = False + ## When/how to show the scrollbar. ## Type: String ## Valid values: @@ -1595,7 +1330,7 @@ c.qt.args = [str('proxy-pac-url=file://' / config.configdir / 'proxy.pac')] ## Load a restored tab as soon as it takes focus. ## Type: Bool -c.session.lazy_restore = True +# c.session.lazy_restore = False ## Whether to automatically save a session when it is closed. ## Type: Bool @@ -1677,7 +1412,7 @@ c.spellcheck.languages = ['en-GB'] # c.statusbar.show = 'always' ## List of widgets displayed in the statusbar. -## Type: List of String +## Type: List of StatusbarWidget ## Valid values: ## - url: Current page URL. ## - scroll: Percentage of the current page position like `10%`. @@ -1686,6 +1421,7 @@ c.spellcheck.languages = ['en-GB'] ## - tabs: Current active tab, e.g. `2`. ## - keypress: Display pressed keys when composing a vi command. ## - progress: Progress bar for the current page loading. +## - text:foo: Display the static text after the colon, `foo` in the example. # c.statusbar.widgets = ['keypress', 'url', 'scroll', 'history', 'tabs', 'progress'] ## Open new tabs (middleclick/ctrl+click) in the background. @@ -1951,8 +1687,11 @@ c.url.default_page = 'https://duckduckgo.com/?t=chakra' ## Type: Dict c.url.searchengines = {'DEFAULT': 'https://duckduckgo.com/?t=chakra&q={}', 'ddg': 'https://duckduckgo.com/?t=chakra&q={}', + 'cdda': 'https://nornagon.github.io/cdda-guide/?v=0.F-2#/search/{}', 'slack': 'https://focalpointpositioning.slack.com/messages/{}', 'std': 'http://en.cppreference.com/mwiki/index.php?title=Special%3ASearch&search={}', + 'hoogle': 'https://hoogle.haskell.org/?hoogle={}', + 'h': 'https://hoogle.haskell.org/?hoogle={}', } ## Page(s) to open at the start. @@ -2076,11 +1815,11 @@ config.bind('J', 'tab-prev') # config.bind('PP', 'open -t -- {primary}') # config.bind('Pp', 'open -t -- {clipboard}') # config.bind('R', 'reload -f') -# config.bind('Sb', 'open qute://bookmarks#bookmarks') -# config.bind('Sh', 'open qute://history') -# config.bind('Sq', 'open qute://bookmarks') -# config.bind('Ss', 'open qute://settings') -# config.bind('T', 'tab-focus') +# config.bind('Sb', 'bookmark-list --jump') +# config.bind('Sh', 'history') +# config.bind('Sq', 'bookmark-list') +# config.bind('Ss', 'set') +# config.bind('T', 'set-cmd-text -sr :tab-focus') # config.bind('U', 'undo -w') # config.bind('V', 'mode-enter caret ;; selection-toggle --line') # config.bind('ZQ', 'quit') @@ -2111,15 +1850,17 @@ config.bind('co', 'download-open') # config.bind('gf', 'view-source') # config.bind('gg', 'scroll-to-perc 0') # config.bind('gi', 'hint inputs --first') +config.bind('gl', 'tab-move -') # config.bind('gm', 'tab-move') # config.bind('go', 'set-cmd-text :open {url:pretty}') +config.bind('gr', 'tab-move +') +# config.bind('gt', 'set-cmd-text -s :tab-select') # config.bind('gu', 'navigate up') # config.bind('h', 'scroll left') # config.bind('i', 'mode-enter insert') # config.bind('j', 'scroll down') # config.bind('k', 'scroll up') # config.bind('l', 'scroll right') -# config.bind('m', 'quickmark-save') config.bind('m', 'spawn mpv {url}') # config.bind('n', 'search-next') # config.bind('o', 'set-cmd-text -s :open') @@ -2131,8 +1872,9 @@ config.bind('m', 'spawn mpv {url}') # config.bind('sk', 'set-cmd-text -s :bind') # config.bind('sl', 'set-cmd-text -s :set -t') # config.bind('ss', 'set-cmd-text -s :set') -config.bind('tCh', 'spawn --userscript config-cycle-tld -p content.cookies.accept no-3rdparty never;; reload') -config.bind('tch', 'spawn --userscript config-cycle-tld -p -t content.cookies.accept no-3rdparty never;; reload') +config.bind('sq', 'quickmark-save') +config.bind('tCh', 'spawn --userscript config-cycle-tld -p content.cookies.accept no-3rdparty never all;; reload') +config.bind('tch', 'spawn --userscript config-cycle-tld -p -t content.cookies.accept no-3rdparty never all;; reload') config.bind('tGh', 'spawn --userscript config-cycle-tld -p content.geolocation ;; reload') config.bind('tgh', 'spawn --userscript config-cycle-tld -p -t content.geolocation ;; reload') # config.bind('tIH', 'config-cycle -p -u *://*.{url:host}/* content.images ;; reload') @@ -2188,6 +1930,7 @@ config.bind('tgh', 'spawn --userscript config-cycle-tld -p -t content.geolocatio config.bind('zl', 'spawn --userscript qute-pass') config.bind('zul', 'spawn --userscript qute-pass --username-only') config.bind('zpl', 'spawn --userscript qute-pass --password-only') +config.bind('zol', 'spawn --userscript qute-pass --otp-only') # config.bind('{{', 'navigate prev -t') # config.bind('}}', 'navigate next -t') @@ -2265,6 +2008,7 @@ config.bind('zpl', 'spawn --userscript qute-pass --password-only') ## Bindings for insert mode # config.bind('', 'edit-text', mode='insert') # config.bind('', 'mode-leave', mode='insert') +# config.bind('', 'fake-key ', mode='insert') # config.bind('', 'insert-text -- {primary}', mode='insert') ## Bindings for passthrough mode @@ -2308,3 +2052,5 @@ config.bind('zpl', 'spawn --userscript qute-pass --password-only') # config.bind('Y', 'prompt-accept --save yes', mode='yesno') # config.bind('n', 'prompt-accept no', mode='yesno') # config.bind('y', 'prompt-accept yes', mode='yesno') + +config.source('themes/nord-qutebrowser.py')