From 38c00e53cdca519f35a550852af5ef3346e703bc Mon Sep 17 00:00:00 2001 From: Fritz Reichwald Date: Sun, 9 Jul 2017 13:34:10 +0200 Subject: [PATCH 1/3] Add open_url_in_instance.sh script --- scripts/open_url_in_instance.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 scripts/open_url_in_instance.sh diff --git a/scripts/open_url_in_instance.sh b/scripts/open_url_in_instance.sh new file mode 100755 index 000000000..119c3aa4f --- /dev/null +++ b/scripts/open_url_in_instance.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# initial idea: Florian Bruhin (The-Compiler) +# author: Thore Bödecker (foxxx0) + +_url="$1" +_qb_version='0.10.1' +_proto_version=1 +_ipc_socket="${XDG_RUNTIME_DIR}/qutebrowser/ipc-$(echo -n "$USER" | md5sum | cut -d' ' -f1)" + +if [[ -e "${_ipc_socket}" ]]; then + exec printf '{"args": ["%s"], "target_arg": null, "version": "%s", "protocol_version": %d, "cwd": "%s"}\n' \ + "${_url}" \ + "${_qb_version}" \ + "${_proto_version}" \ + "${PWD}" | socat - UNIX-CONNECT:"${_ipc_socket}" +else + exec /usr/bin/qutebrowser --backend webengine "$@" +fi From ead71db41a4c0f2484f39b98d55ab03951fac54e Mon Sep 17 00:00:00 2001 From: Fritz Reichwald Date: Sun, 9 Jul 2017 13:45:16 +0200 Subject: [PATCH 2/3] Add explanation for using open_url_in_instance script --- FAQ.asciidoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/FAQ.asciidoc b/FAQ.asciidoc index 23061db44..d3eea17e3 100644 --- a/FAQ.asciidoc +++ b/FAQ.asciidoc @@ -171,6 +171,19 @@ What's the difference between insert and passthrough mode?:: be useful to rebind escape to something else in passthrough mode only, to be able to send an escape keypress to the website. +Why takes it longer to open an URL in qutebrowser than in chromium?:: + When opening an URL in an existing instance the normal qutebrowser + python script is started and a few PyQT libraries need to be + loaded until it is detected that there is an instance running + where the URL is then passed to. One workaround is to use this + https://github.com/qutebrowser/qutebrowser/blob/master/scripts/open_url_in_instance.sh[script] + and place it in your $PATH with the name "qutebrowser". This + script passes the URL via an unix socket to qutebrowser (if its + running already) using socat which is much faster and starts a new + qutebrowser if it is not running already. Also check if you want + to use webengine as backend in line 17 and change it to your + needs. + == Troubleshooting Configuration not saved after modifying config.:: From fd4bc29beb1bbfdd2d5586251bf48ca7bd3d79a6 Mon Sep 17 00:00:00 2001 From: Fritz Reichwald Date: Sun, 9 Jul 2017 14:10:08 +0200 Subject: [PATCH 3/3] Add some comment --- FAQ.asciidoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FAQ.asciidoc b/FAQ.asciidoc index d3eea17e3..8eba424de 100644 --- a/FAQ.asciidoc +++ b/FAQ.asciidoc @@ -175,7 +175,8 @@ Why takes it longer to open an URL in qutebrowser than in chromium?:: When opening an URL in an existing instance the normal qutebrowser python script is started and a few PyQT libraries need to be loaded until it is detected that there is an instance running - where the URL is then passed to. One workaround is to use this + where the URL is then passed to. This takes some time. + One workaround is to use this https://github.com/qutebrowser/qutebrowser/blob/master/scripts/open_url_in_instance.sh[script] and place it in your $PATH with the name "qutebrowser". This script passes the URL via an unix socket to qutebrowser (if its