]> git.rmz.io Git - dotfiles.git/blobdiff - qutebrowser/config.py
qutebrowser: tidy config file
[dotfiles.git] / qutebrowser / config.py
index 0d44d35c00a2a0169f8e4d05fe35191db8e9038a..6a55fd14bdea4b8532953e3379bd842d1d7305be 100644 (file)
@@ -1,14 +1,11 @@
-## 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
+# noqa: D100
+
+from qutebrowser.config.configfiles import ConfigAPI
+from qutebrowser.config.config import ConfigContainer
+
+c: ConfigContainer = c      # noqa: F821 pylint: disable=E0602,C0103
+config: ConfigAPI = config  # noqa: F821 pylint: disable=E0602,C0103
+
 
 def in_terminal(cmd: list):
     """Wraps cmd to be run in the default TERMINAL, as set by environment.
@@ -20,28 +17,6 @@ def in_terminal(cmd: list):
     t = getenv('TERMINAL', 'xterm')
     return [t, '-e'] + cmd
 
-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
 
 ## This is here so configs done via the GUI are still loaded.
 ## Remove it to not load settings done via the GUI.
@@ -220,6 +195,7 @@ c.changelog_after_upgrade = 'patch'
 ## 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
+# TODO:
 # c.completion.favorite_paths = []
 
 ## Height (in pixels or as percentage of the window) of the completion.
@@ -668,7 +644,7 @@ config.set('content.notifications.enabled', True, '*://*.google.com/*')
 ## `:prompt-open-download --pdfjs` command (bound to `<Ctrl-p>` by
 ## default) can be used in the download prompt.
 ## Type: Bool
-# c.content.pdfjs = False
+c.content.pdfjs = True
 
 ## Allow websites to request persistent storage quota via
 ## `navigator.webkitPersistentStorage.requestQuota`.
@@ -689,7 +665,7 @@ config.set('content.notifications.enabled', True, '*://*.google.com/*')
 ## this setting is set to False, the system-wide animation setting is
 ## considered.
 ## Type: Bool
-# c.content.prefers_reduced_motion = False
+c.content.prefers_reduced_motion = True
 
 ## Draw the background color and images also when the page is printed.
 ## Type: Bool
@@ -776,7 +752,8 @@ with config.pattern('*://calendar.google.com/*') as p:
 
 ## Enable WebGL.
 ## Type: Bool
-# c.content.webgl = True
+c.content.webgl = False
+config.set('content.webgl', True, '*://meet.google.com/*')
 
 ## Which interfaces to expose via WebRTC.
 ## Type: String
@@ -1083,6 +1060,7 @@ c.hints.scatter = False
 ## CSS selectors used to determine which elements on a page should have
 ## hints.
 ## Type: Dict
+# TODO: reduce hints on some websites like reddit
 c.hints.selectors = {'all': ['a', 'area', 'textarea', 'select',
                              'input:not([type="hidden"])', 'button', 'frame',
                              'iframe', 'img', 'link', 'summary',
@@ -1293,6 +1271,7 @@ c.qt.args = ['proxy-pac-url=file://' + str(config.configdir / 'proxy.pac')]
 ##   - always: Always use low-end device mode.
 ##   - auto: Decide automatically (uses low-end mode with < 1 GB available RAM).
 ##   - never: Never use low-end device mode.
+# TODO: maybe never?
 # c.qt.chromium.low_end_device_mode = 'auto'
 
 ## Which Chromium process model to use. Alternative process models use
@@ -1802,6 +1781,9 @@ c.url.searchengines = {'DEFAULT':        'https://duckduckgo.com/?t=chakra&q={}'
                        'h':              'https://hoogle.haskell.org/?hoogle={}',
                        'fpp/slack':      'https://focalpointpositioning.slack.com/messages/{}',
                        'fpp/confluence': 'https://fppnt.atlassian.net/wiki/search?text={}',
+                       'evk':            'https://gitlab.com/search?&scope=issues&group_id=13301433&search={}',
+                       'dev':            'https://devdocs.io/#q={}',
+                       'phind':          'https://www.phind.com/search?q={}',
                       }
 
 ## Page(s) to open at the start.
@@ -1972,6 +1954,8 @@ config.bind('gr', 'tab-move +')
 # config.bind('k', 'scroll up')
 # config.bind('l', 'scroll right')
 config.bind('m', 'spawn mpv {url}')
+# TODO: add hints.selector for ytdl compatible links
+config.bind('M', 'hint links spawn mpv {hint-url}')
 # config.bind('n', 'search-next')
 # config.bind('o', 'set-cmd-text -s :open')
 # config.bind('pP', 'open -- {primary}')