From: Maximilian Friedersdorff Date: Wed, 22 Aug 2018 09:20:21 +0000 (+0100) Subject: Add configuration for qutebrowser X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=67cc2191d947ff05ba5be35bdd5852b87a280b20;p=max%2Fdotfiles.git Add configuration for qutebrowser --- diff --git a/qutebrowser/.config/qutebrowser/config.py b/qutebrowser/.config/qutebrowser/config.py new file mode 100644 index 0000000..bcbb4e8 --- /dev/null +++ b/qutebrowser/.config/qutebrowser/config.py @@ -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 index 0000000..77eb76f --- /dev/null +++ b/qutebrowser/.local/share/qutebrowser/userscripts/noscript_disable @@ -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 index 0000000..25334ad --- /dev/null +++ b/qutebrowser/.local/share/qutebrowser/userscripts/noscript_enable @@ -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"