X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/6d69f0a6677e5428d554ac89b877294eed33e3d9..e0f52edab239cc479d296f039c1ecf8d1b01de33:/qutebrowser/config.py diff --git a/qutebrowser/config.py b/qutebrowser/config.py index abb63f3..a3bf122 100644 --- a/qutebrowser/config.py +++ b/qutebrowser/config.py @@ -13,7 +13,9 @@ c.aliases = {'w': 'session-save', 'quit': 'close', 'q': 'close', + 'qa': 'quit', 'wq': 'quit --save', + 'wqa': 'quit --save', 'mpv': 'spawn --userscript ~/src/qutebrowser/misc/userscripts/view_in_mpv' } @@ -113,12 +115,22 @@ c.auto_save.session = True ## Background color of the context menu. If set to null, the Qt default ## is used. ## Type: QssColor -# c.colors.contextmenu.bg = None +# 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.fg = None +# 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 @@ -269,7 +281,7 @@ c.colors.prompts.bg = '#333333' ## Background color of the statusbar in private browsing + command mode. ## Type: QssColor -# c.colors.statusbar.command.private.bg = 'grey' +# c.colors.statusbar.command.private.bg = 'darkslategray' ## Foreground color of the statusbar in private browsing + command mode. ## Type: QssColor @@ -431,6 +443,10 @@ c.colors.prompts.bg = '#333333' ## Type: QtColor # c.colors.webpage.bg = 'white' +## Force `prefers-color-scheme: dark` colors for websites. +## Type: Bool +c.colors.webpage.prefers_color_scheme_dark = True + ## Number of commands to save in the command history. 0: no history / -1: ## unlimited ## Type: Int @@ -547,14 +563,29 @@ c.confirm_quit = ['downloads'] ## Type: Bool # c.content.canvas_reading = True -## Which cookies to accept. +## Which cookies to accept. Note that with QtWebKit, only `all` and +## `never` are supported as per-domain values. Setting `no-3rdparty` or +## `no-unknown-3rdparty` per-domain on QtWebKit will have the same effect +## as `all`. ## 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 = 'no-3rdparty' +c.content.cookies.accept = 'never' + +config.set('content.cookies.accept', 'no-3rdparty', '*://*.amazon.co.uk/*') +config.set('content.cookies.accept', 'no-3rdparty', '*://*.amazon.de/*') +config.set('content.cookies.accept', 'no-3rdparty', '*://*.duckduckgo.com/*') +config.set('content.cookies.accept', 'no-3rdparty', '*://*.freedesktop.org/*') +config.set('content.cookies.accept', 'no-3rdparty', '*://*.github.com/*') +config.set('content.cookies.accept', 'no-3rdparty', '*://*.gitlab.com/*') +config.set('content.cookies.accept', 'no-3rdparty', '*://*.google.com/*') +config.set('content.cookies.accept', 'no-3rdparty', '*://*.humblebundle.com/*') +config.set('content.cookies.accept', 'no-3rdparty', '*://*.mailfence.com/*') +config.set('content.cookies.accept', 'no-3rdparty', '*://*.reddit.com/*') +config.set('content.cookies.accept', 'no-3rdparty', '*://*.steampowered.com/*') ## Store cookies. Note this option needs a restart with QtWebEngine on Qt ## < 5.9. @@ -577,13 +608,23 @@ c.confirm_quit = ['downloads'] ## 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. ## Type: Bool # c.content.frame_flattening = False +## Set fullscreen notification overlay timeout in milliseconds. If set to +## 0, no overlay will be displayed. +## Type: Int +# c.content.fullscreen.overlay_timeout = 3000 + +## Limit fullscreen to the browser window (does not expand to fill the +## screen). +## Type: Bool +# c.content.fullscreen.window = False + ## Allow websites to request geolocations. ## Type: BoolAsk ## Valid values: @@ -595,7 +636,7 @@ c.confirm_quit = ['downloads'] ## Value to send in the `Accept-Language` header. Note that the value ## read from JavaScript is always the global value. ## Type: String -c.content.headers.accept_language = 'en-US,en,de,fr' +c.content.headers.accept_language = 'en-UK;q=1.0, en;q=0.9, de;q=0.7, fr;q=0.7, *;q=0.5' ## Custom headers for qutebrowser HTTP requests. ## Type: Dict @@ -748,7 +789,9 @@ c.content.headers.accept_language = 'en-US,en,de,fr' ## - true ## - false ## - ask -# c.content.notifications = 'ask' +c.content.notifications = 'ask' +config.set('content.notifications', True, '*://*.gitlab.com/*') +config.set('content.notifications', True, '*://*.google.com/*') ## 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 @@ -798,6 +841,10 @@ c.content.headers.accept_language = 'en-US,en,de,fr' ## - false ## - ask # c.content.register_protocol_handler = 'ask' +with config.pattern('*://mail.google.com/*') as p: + p.content.register_protocol_handler = False +with config.pattern('*://calendar.google.com/*') as p: + p.content.register_protocol_handler = False ## Enable quirks (such as faked user agent headers) needed to get ## specific sites to work properly. @@ -812,6 +859,14 @@ c.content.headers.accept_language = 'en-US,en,de,fr' ## - ask # c.content.ssl_strict = 'ask' +## How navigation requests to URLs with unknown schemes are handled. +## Type: String +## Valid values: +## - disallow: Disallows all navigation requests to URLs with unknown schemes. +## - allow-from-user-interaction: Allows navigation requests to URLs with unknown schemes that are issued from user-interaction (like a mouse-click), whereas other navigation requests (for example from JavaScript) are suppressed. +## - allow-all: Allows all navigation requests to URLs with unknown schemes. +# c.content.unknown_url_scheme_policy = 'allow-from-user-interaction' + ## List of user stylesheet filenames to use. ## Type: List of File, or File # c.content.user_stylesheets = [] @@ -830,11 +885,6 @@ c.content.headers.accept_language = 'en-US,en,de,fr' ## - disable-non-proxied-udp: WebRTC should only use TCP to contact peers or servers unless the proxy server supports UDP. This doesn't expose any local addresses either. # c.content.webrtc_ip_handling_policy = 'all-interfaces' -## Limit fullscreen to the browser window (does not expand to fill the -## screen). -## Type: Bool -# c.content.windowed_fullscreen = False - ## Monitor load requests for cross-site scripting attempts. Suspicious ## scripts will be blocked and reported in the inspector's JavaScript ## console. Note that bypasses for the XSS auditor are widely known and @@ -898,11 +948,11 @@ c.editor.command = ['urxvtc', '-e', 'vim', '{file}', '-c', 'normal {line}G{colum ## Font used in the completion categories. ## Type: Font -# c.fonts.completion.category = 'bold 10pt monospace' +# c.fonts.completion.category = 'bold default_size default_family' ## Font used in the completion widget. ## Type: Font -# c.fonts.completion.entry = '10pt monospace' +# c.fonts.completion.entry = 'default_size default_family' ## Font used for the context menu. If set to null, the Qt default is ## used. @@ -911,48 +961,56 @@ c.editor.command = ['urxvtc', '-e', 'vim', '{file}', '-c', 'normal {line}G{colum ## Font used for the debugging console. ## Type: QtFont -# c.fonts.debug_console = '10pt monospace' +# c.fonts.debug_console = 'default_size default_family' + +## Default font families to use. Whenever "default_family" is used in a +## 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"] + +## 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 +## either a float value with a "pt" suffix, or an integer value with a +## "px" suffix. +## Type: String +# c.fonts.default_size = '10pt' ## Font used for the downloadbar. ## Type: Font -# c.fonts.downloads = '10pt monospace' +# c.fonts.downloads = 'default_size default_family' ## Font used for the hints. ## Type: Font -# c.fonts.hints = 'bold 10pt monospace' +# c.fonts.hints = 'bold default_size default_family' ## Font used in the keyhint widget. ## Type: Font -# c.fonts.keyhint = '10pt monospace' +# c.fonts.keyhint = 'default_size default_family' ## Font used for error messages. ## Type: Font -# c.fonts.messages.error = '10pt monospace' +# c.fonts.messages.error = 'default_size default_family' ## Font used for info messages. ## Type: Font -# c.fonts.messages.info = '10pt monospace' +# c.fonts.messages.info = 'default_size default_family' ## Font used for warning messages. ## Type: Font -# c.fonts.messages.warning = '10pt monospace' - -## Default monospace fonts. Whenever "monospace" is used in a font -## setting, it's replaced with the fonts listed here. -## Type: Font -c.fonts.monospace = 'Hack, "xos4 Terminus", Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal' +# c.fonts.messages.warning = 'default_size default_family' ## Font used for prompts. ## Type: Font -# c.fonts.prompts = '10pt sans-serif' +# c.fonts.prompts = 'default_size sans-serif' ## Font used in the statusbar. ## Type: Font -# c.fonts.statusbar = '10pt monospace' +# c.fonts.statusbar = 'default_size default_family' ## Font used in the tab bar. ## Type: QtFont -# c.fonts.tabs = '10pt monospace' +# c.fonts.tabs = 'default_size default_family' ## Font family for cursive fonts. ## Type: FontFamily @@ -1052,10 +1110,18 @@ c.hints.min_chars = 2 ## Type: List of Regex # c.hints.next_regexes = ['\\bnext\\b', '\\bmore\\b', '\\bnewer\\b', '\\b[>→≫]\\b', '\\b(>>|»)\\b', '\\bcontinue\\b'] +## Padding (in pixels) for hints. +## Type: Padding +# c.hints.padding = {'top': 0, 'bottom': 0, 'left': 3, 'right': 3} + ## Comma-separated list of regular expressions to use for 'prev' links. ## Type: List of Regex # c.hints.prev_regexes = ['\\bprev(ious)?\\b', '\\bback\\b', '\\bolder\\b', '\\b[<←≪]\\b', '\\b(<<|«)\\b'] +## Rounding radius (in pixels) for the edges of hints. +## Type: Int +# c.hints.radius = 3 + ## Scatter hint key chains (like Vimium) or not (like dwb). Ignored for ## number hints. ## Type: Bool @@ -1179,7 +1245,7 @@ c.hints.scatter = False ## - last-visible: Open new tabs in the most recently visible window. # c.new_instance_open_target_window = 'last-focused' -## Show a filebrowser in upload/download prompts. +## Show a filebrowser in download prompts. ## Type: Bool # c.prompt.filebrowser = True @@ -1200,6 +1266,13 @@ c.hints.scatter = False ## Type: String # c.qt.force_platform = None +## Force a Qt platformtheme to use. This sets the `QT_QPA_PLATFORMTHEME` +## environment variable which controls dialogs like the filepicker. By +## default, Qt determines the platform theme based on the desktop +## environment. +## Type: String +# c.qt.force_platformtheme = None + ## Force software rendering for QtWebEngine. This is needed for ## QtWebEngine to work with Nouveau drivers and can be useful in other ## scenarios related to graphic issues. @@ -1246,7 +1319,7 @@ c.hints.scatter = False ## - always: Always show the scrollbar. ## - never: Never show the scrollbar. ## - when-searching: Show the scrollbar when searching for text in the webpage. With the QtWebKit backend, this is equal to `never`. -c.scrolling.bar = 'never' +c.scrolling.bar = 'when-searching' ## Enable smooth scrolling for web pages. Note smooth scrolling does not ## work with the `:scroll-px` command. @@ -1266,6 +1339,11 @@ c.scrolling.bar = 'never' ## Type: Bool # c.search.incremental = True +## Wrap around at the top and bottom of the page when advancing through +## text matches using `:search-next` and `:search-prev`. +## Type: Bool +# c.search.wrap = True + ## Name of the session to save by default. If this is set to null, the ## session which was last loaded is saved. ## Type: SessionName @@ -1517,16 +1595,20 @@ c.tabs.select_on_remove = 'prev' # c.tabs.title.alignment = 'left' ## Format to use for the tab title. The following placeholders are -## defined: * `{perc}`: Percentage as a string like `[10%]`. * -## `{perc_raw}`: Raw percentage, e.g. `10`. * `{current_title}`: Title of -## the current web page. * `{title_sep}`: The string ` - ` if a title is -## set, empty otherwise. * `{index}`: Index of this tab. * `{id}`: -## Internal tab ID of this tab. * `{scroll_pos}`: Page scroll position. * -## `{host}`: Host of the current web page. * `{backend}`: Either -## ''webkit'' or ''webengine'' * `{private}`: Indicates when private mode -## is enabled. * `{current_url}`: URL of the current web page. * -## `{protocol}`: Protocol (http/https/...) of the current web page. * -## `{audio}`: Indicator for audio/mute status. +## defined: +## * `{perc}`: Percentage as a string like `[10%]`. +## * `{perc_raw}`: Raw percentage, e.g. `10`. +## * `{current_title}`: Title of the current web page. +## * `{title_sep}`: The string ` - ` if a title is set, empty otherwise. +## * `{index}`: Index of this tab. +## * `{id}`: Internal tab ID of this tab. +## * `{scroll_pos}`: Page scroll position. +## * `{host}`: Host of the current web page. +## * `{backend}`: Either ''webkit'' or ''webengine'' +## * `{private}`: Indicates when private mode is enabled. +## * `{current_url}`: URL of the current web page. +## * `{protocol}`: Protocol (http/https/...) of the current web page. +## * `{audio}`: Indicator for audio/mute status. ## Type: FormatString # c.tabs.title.format = '{audio}{index}: {current_title}' @@ -1583,14 +1665,24 @@ c.url.default_page = 'https://duckduckgo.com/?t=chakra' ## Type: Bool # c.url.open_base_url = False -## Search engines which can be used via the address bar. Maps a search +## Search engines which can be used via the address bar. Maps a search ## engine name (such as `DEFAULT`, or `ddg`) to a URL with a `{}` ## placeholder. The placeholder will be replaced by the search term, use -## `{{` and `}}` for literal `{`/`}` signs. The search engine named -## `DEFAULT` is used when `url.auto_search` is turned on and something -## else than a URL was entered to be opened. Other search engines can be -## used by prepending the search engine name to the search term, e.g. -## `:open google qutebrowser`. +## `{{` and `}}` for literal `{`/`}` braces. The following further +## placeholds are defined to configure how special characters in the +## search terms are replaced by safe characters (called 'quoting'): +## * `{}` and `{semiquoted}` quote everything except slashes; this is the +## most sensible choice for almost all search engines (for the search +## term `slash/and&` this placeholder expands to `slash/and%26amp`). +## * `{quoted}` quotes all characters (for `slash/and&` this +## placeholder expands to `slash%2Fand%26amp`). +## * `{unquoted}` quotes nothing (for `slash/and&` this placeholder +## expands to `slash/and&`). +## The search engine named `DEFAULT` is used when +## `url.auto_search` is turned on and something else than a URL was +## entered to be opened. Other search engines can be used by prepending +## the search engine name to the search term, e.g. `:open google +## qutebrowser`. ## Type: Dict c.url.searchengines = {'DEFAULT': 'https://duckduckgo.com/?t=chakra&q={}', 'ddg': 'https://duckduckgo.com/?t=chakra&q={}', @@ -1764,6 +1856,10 @@ 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 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('tch', 'spawn --userscript config-cycle-tld -p -t content.cookies.accept no-3rdparty never;; reload') # config.bind('tIH', 'config-cycle -p -u *://*.{url:host}/* content.images ;; reload') # config.bind('tIh', 'config-cycle -p -u *://{url:host}/* content.images ;; reload') # config.bind('tIu', 'config-cycle -p -u {url} content.images ;; reload') @@ -1808,6 +1904,9 @@ config.bind('m', 'spawn mpv {url}') # config.bind('yp', 'yank pretty-url') # config.bind('yt', 'yank title') # config.bind('yy', 'yank') +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('{{', 'navigate prev -t') # config.bind('}}', 'navigate next -t')