]> git.friedersdorff.com Git - max/dotfiles.git/commitdiff
Add configuration for qutebrowser
authorMaximilian Friedersdorff <max@friedersdorff.com>
Wed, 22 Aug 2018 09:20:21 +0000 (10:20 +0100)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Wed, 22 Aug 2018 09:20:21 +0000 (10:20 +0100)
qutebrowser/.config/qutebrowser/config.py [new file with mode: 0644]
qutebrowser/.local/share/qutebrowser/userscripts/noscript_disable [new file with mode: 0755]
qutebrowser/.local/share/qutebrowser/userscripts/noscript_enable [new file with mode: 0755]

diff --git a/qutebrowser/.config/qutebrowser/config.py b/qutebrowser/.config/qutebrowser/config.py
new file mode 100644 (file)
index 0000000..bcbb4e8
--- /dev/null
@@ -0,0 +1,14 @@
+config.load_autoconfig()
+
+c.auto_save.session = True
+c.content.cookies.store = False
+c.content.headers.user_agent = "Wget/1.16.1 (linux-gnu)"
+c.content.images = True
+c.editor.command = ['urxvt', '-e', 'vim', '{file}']
+c.tabs.position = 'left'
+c.url.auto_search = 'dns'
+c.url.searchengines = {'DEFAULT': 'https://duckduckgo.com/html?q={}'}
+c.messages.timeout = 5000
+
+config.bind(',ej', 'spawn --userscript noscript_enable')
+config.bind(',dj', 'spawn --userscript noscript_disable')
diff --git a/qutebrowser/.local/share/qutebrowser/userscripts/noscript_disable b/qutebrowser/.local/share/qutebrowser/userscripts/noscript_disable
new file mode 100755 (executable)
index 0000000..77eb76f
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+SANITIZED_URL="$(echo $QUTE_URL | sed 's/[^/]*\/\/\([^@]*@\)\?\([^/]*\).*/\2\/\*/')"
+
+echo "set -u $SANITIZED_URL content.javascript.enabled false" >> "$QUTE_FIFO"
diff --git a/qutebrowser/.local/share/qutebrowser/userscripts/noscript_enable b/qutebrowser/.local/share/qutebrowser/userscripts/noscript_enable
new file mode 100755 (executable)
index 0000000..25334ad
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+SANITIZED_URL="$(echo $QUTE_URL | sed 's/[^/]*\/\/\([^@]*@\)\?\([^/]*\).*/\2\/\*/')"
+
+echo "set -u $SANITIZED_URL content.javascript.enabled true" >> "$QUTE_FIFO"