From 67cc2191d947ff05ba5be35bdd5852b87a280b20 Mon Sep 17 00:00:00 2001 From: Maximilian Friedersdorff Date: Wed, 22 Aug 2018 10:20:21 +0100 Subject: [PATCH] Add configuration for qutebrowser --- qutebrowser/.config/qutebrowser/config.py | 14 ++++++++++++++ .../share/qutebrowser/userscripts/noscript_disable | 5 +++++ .../share/qutebrowser/userscripts/noscript_enable | 5 +++++ 3 files changed, 24 insertions(+) create mode 100644 qutebrowser/.config/qutebrowser/config.py create mode 100755 qutebrowser/.local/share/qutebrowser/userscripts/noscript_disable create mode 100755 qutebrowser/.local/share/qutebrowser/userscripts/noscript_enable 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" -- 2.46.2