From 20c8605b9c6ab3071c1d920283325a693a387703 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Thu, 29 Aug 2019 11:09:23 +0200 Subject: [PATCH] add scripts/qutebrowser --- scripts/qutebrowser | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 scripts/qutebrowser diff --git a/scripts/qutebrowser b/scripts/qutebrowser new file mode 100755 index 0000000..fa71a5d --- /dev/null +++ b/scripts/qutebrowser @@ -0,0 +1,10 @@ +#!/bin/sh + +url="$1" +ver='1.6.3' +proto=1 +sock="$XDG_RUNTIME_DIR/qutebrowser/ipc-$(printf "%s" "$USER" | md5sum | cut -d\ -f1)" +bin=$(env PATH="$(echo "$PATH" | sed "s|$(dirname "$0"):||g")" sh -c 'command -v qutebrowser') +fmt='{"args": ["%s"], "target_arg": null, "version": "%s", "protocol_version": %d, "cwd": "%s"}\n' + +printf "$fmt" "$url" "$ver" "$proto" "$PWD" | nc -U "$sock" 2>/dev/null || "$bin" "$@" &