2017-07-09 13:34:10 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# initial idea: Florian Bruhin (The-Compiler)
|
|
|
|
# author: Thore Bödecker (foxxx0)
|
|
|
|
|
|
|
|
_url="$1"
|
2017-11-29 10:38:09 +01:00
|
|
|
_qb_version='1.0.4'
|
2017-07-09 13:34:10 +02:00
|
|
|
_proto_version=1
|
|
|
|
_ipc_socket="${XDG_RUNTIME_DIR}/qutebrowser/ipc-$(echo -n "$USER" | md5sum | cut -d' ' -f1)"
|
2017-11-24 14:52:33 +01:00
|
|
|
_qute_bin="/usr/bin/qutebrowser"
|
2017-07-09 13:34:10 +02:00
|
|
|
|
2017-11-29 08:40:40 +01:00
|
|
|
printf '{"args": ["%s"], "target_arg": null, "version": "%s", "protocol_version": %d, "cwd": "%s"}\n' \
|
|
|
|
"${_url}" \
|
|
|
|
"${_qb_version}" \
|
|
|
|
"${_proto_version}" \
|
2017-11-29 08:43:02 +01:00
|
|
|
"${PWD}" | socat - UNIX-CONNECT:"${_ipc_socket}" 2>/dev/null || "$_qute_bin" "$@" &
|