## Autogenerated config.py ## Documentation: ## qute://help/configuring.html ## qute://help/settings.html 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 ## 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() try: from qutebrowser.api import interceptor, message from PyQt5.QtCore import QUrl def intercept(info: interceptor.Request): url = info.request_url if url.host() == "twitter.com": url.setHost("nitter.eu") message.info("Redirecting to " + url.toString()) info.redirect(url) if url.host() == "xkcd.com": url.setHost("m.xkcd.com") message.info("Redirecting to " + url.toString()) info.redirect(url) if url.host() == "www.bristolpost.co.uk": url.setUrl("https://outline.com/" + url.toString()) message.info("Redirecting to " + url.toString()) info.redirect(url) interceptor.register(intercept) except ImportError: pass ## Aliases for commands. The keys of the given dictionary are the ## aliases, while the values are the commands they map to. ## Type: Dict 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' } ## Time interval (in milliseconds) between auto-saves of ## config/cookies/etc. ## Type: Int # c.auto_save.interval = 15000 ## Always restore open sites when qutebrowser is reopened. Without this ## option set, `:wq` (`:quit --save`) needs to be used to save open tabs ## (and restore them), while quitting qutebrowser in any other way will ## not save/restore the session. By default, this will save to the ## session which was last loaded. This behavior can be customized via the ## `session.default_name` setting. ## Type: Bool 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. ## Type: String ## Valid values: ## - webengine: Use QtWebEngine (based on Chromium). ## - webkit: Use QtWebKit (based on WebKit, similar to Safari). # 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. ## Type: Dict # c.bindings.key_mappings = {'': '', '': '', '': '', '': '', '': '', '': '', '': '', '': '', '': ''} #TODO ## Which algorithm to use for modifying how colors are rendered with ## darkmode. The `lightness-cielab` value was added with QtWebEngine 5.14 ## and is treated like `lightness-hsl` with older QtWebEngine versions. ## Type: String ## Valid values: ## - lightness-cielab: Modify colors by converting them to CIELAB color space and inverting the L value. Not available with Qt < 5.14. ## - lightness-hsl: Modify colors by converting them to the HSL color space and inverting the lightness (i.e. the "L" in HSL). ## - brightness-rgb: Modify colors by subtracting each of r, g, and b from their maximum value. # c.colors.webpage.darkmode.algorithm = 'lightness-cielab' ## Contrast for dark mode. This only has an effect when ## `colors.webpage.darkmode.algorithm` is set to `lightness-hsl` or ## `brightness-rgb`. ## Type: Float # c.colors.webpage.darkmode.contrast = 0.0 ## Render all web contents using a dark theme. Example configurations ## from Chromium's `chrome://flags`: - "With simple HSL/CIELAB/RGB-based ## inversion": Set `colors.webpage.darkmode.algorithm` accordingly. - ## "With selective image inversion": Set ## `colors.webpage.darkmode.policy.images` to `smart`. - "With selective ## inversion of non-image elements": Set ## `colors.webpage.darkmode.threshold.text` to 150 and ## `colors.webpage.darkmode.threshold.background` to 205. - "With ## selective inversion of everything": Combines the two variants above. ## Type: Bool # c.colors.webpage.darkmode.enabled = False ## Render all colors as grayscale. This only has an effect when ## `colors.webpage.darkmode.algorithm` is set to `lightness-hsl` or ## `brightness-rgb`. ## Type: Bool # c.colors.webpage.darkmode.grayscale.all = False ## Desaturation factor for images in dark mode. If set to 0, images are ## left as-is. If set to 1, images are completely grayscale. Values ## between 0 and 1 desaturate the colors accordingly. ## Type: Float # c.colors.webpage.darkmode.grayscale.images = 0.0 ## Which images to apply dark mode to. With QtWebEngine 5.15.0, this ## setting can cause frequent renderer process crashes due to a ## https://codereview.qt-project.org/c/qt/qtwebengine- ## chromium/+/304211[bug in Qt]. ## Type: String ## Valid values: ## - always: Apply dark mode filter to all images. ## - never: Never apply dark mode filter to any images. ## - 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. ## Type: String ## Valid values: ## - always: Apply dark mode filter to all frames, regardless of content. ## - smart: Apply dark mode filter to frames based on background color. # c.colors.webpage.darkmode.policy.page = 'smart' ## Threshold for inverting background elements with dark mode. Background ## elements with brightness above this threshold will be inverted, and ## below it will be left as in the original, non-dark-mode page. Set to ## 256 to never invert the color or to 0 to always invert it. Note: This ## behavior is the opposite of `colors.webpage.darkmode.threshold.text`! ## Type: Int # c.colors.webpage.darkmode.threshold.background = 0 ## Threshold for inverting text with dark mode. Text colors with ## brightness below this threshold will be inverted, and above it will be ## left as in the original, non-dark-mode page. Set to 256 to always ## invert text color or to 0 to never invert text color. ## 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 ## Number of commands to save in the command history. 0: no history / -1: ## unlimited ## Type: Int # c.completion.cmd_history_max_items = 100 ## Delay (in milliseconds) before updating completions after typing a ## character. ## Type: Int # c.completion.delay = 0 ## Default filesystem autocomplete suggestions for :open. The elements of ## this list show up in the completion window under the Filesystem ## category when the command line contains `:open` but no argument. ## Type: List of String # c.completion.favorite_paths = [] ## Height (in pixels or as percentage of the window) of the completion. ## Type: PercOrInt c.completion.height = 150 ## Minimum amount of characters needed to update completions. ## Type: Int # c.completion.min_chars = 1 ## Which categories to show (in which order) in the :open completion. ## Type: FlagList ## Valid values: ## - searchengines ## - quickmarks ## - bookmarks ## - history ## - filesystem # c.completion.open_categories = ['searchengines', 'quickmarks', 'bookmarks', 'history', 'filesystem'] ## Move on to the next part when there's only one possible completion ## left. ## Type: Bool c.completion.quick = False ## Padding (in pixels) of the scrollbar handle in the completion window. ## Type: Int # c.completion.scrollbar.padding = 2 ## Width (in pixels) of the scrollbar in the completion window. ## Type: Int # c.completion.scrollbar.width = 12 ## When to show the autocompletion window. ## Type: String ## Valid values: ## - always: Whenever a completion is available. ## - auto: Whenever a completion is requested. ## - never: Never. # c.completion.show = 'always' ## Shrink the completion to be smaller than the configured size if there ## are no scrollbars. ## Type: Bool c.completion.shrink = True ## Format of timestamps (e.g. for the history completion). See ## https://sqlite.org/lang_datefunc.html and ## https://docs.python.org/3/library/datetime.html#strftime-strptime- ## behavior for allowed substitutions, qutebrowser uses both sqlite and ## Python to format its timestamps. ## Type: String # c.completion.timestamp_format = '%Y-%m-%d %H:%M' ## Execute the best-matching command on a partial match. ## Type: Bool # c.completion.use_best_match = False ## 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. ## Type: List of UrlPattern # c.completion.web_history.exclude = [] ## Number of URLs to show in the web history. 0: no history / -1: ## unlimited ## Type: Int # c.completion.web_history.max_items = -1 ## Require a confirmation before quitting the application. ## Type: ConfirmQuit ## Valid values: ## - always: Always show a confirmation. ## - multiple-tabs: Show a confirmation if multiple tabs are opened. ## - downloads: Show a confirmation if downloads are running ## - never: Never show a confirmation. c.confirm_quit = ['downloads'] ## Automatically start playing `