]> git.rmz.io Git - dotfiles.git/blobdiff - qutebrowser/config.py
qutebrowser: accept no-3rd-party cookies
[dotfiles.git] / qutebrowser / config.py
index 4b308310b21e434eea83d6b63a03178122c29040..599b419c6b0ce63b28bdf6f8b81de0907e37f945 100644 (file)
@@ -3,6 +3,16 @@
 ##   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()
@@ -14,7 +24,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":
@@ -348,7 +358,7 @@ c.confirm_quit = ['downloads']
 ##   - 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
@@ -720,7 +730,7 @@ 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
@@ -734,21 +744,21 @@ 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.
 ## 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.
 ## Type: ShellCommand
-# c.fileselect.single_file.command = ['xterm', '-e', 'ranger', '--choosefile={}']
+c.fileselect.multiple_files.command = in_terminal(['ranger', '--choosefile={}'])
 
 ## Font used in the completion categories.
 ## Type: Font
@@ -980,7 +990,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
@@ -1004,7 +1014,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
@@ -1095,7 +1105,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.
@@ -1552,6 +1562,8 @@ c.url.searchengines = {'DEFAULT': 'https://duckduckgo.com/?t=chakra&q={}',
                        'ddg':     'https://duckduckgo.com/?t=chakra&q={}',
                        '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.
@@ -1787,6 +1799,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')