From 38c00e53cdca519f35a550852af5ef3346e703bc Mon Sep 17 00:00:00 2001 From: Fritz Reichwald Date: Sun, 9 Jul 2017 13:34:10 +0200 Subject: [PATCH] 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