2019-08-29 11:09:23 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
bin=$(env PATH="$(echo "$PATH" | sed "s|$(dirname "$0"):||g")" sh -c 'command -v qutebrowser')
|
2023-03-07 18:19:23 +01:00
|
|
|
flags="--qt-flag ignore-gpu-blocklist
|
|
|
|
--qt-flag enable-gpu-rasterization
|
|
|
|
--qt-flag enable-native-gpu-memory-buffers
|
|
|
|
--qt-flag num-raster-threads=4
|
|
|
|
--qt-flag enable-oop-rasterization"
|
2019-08-29 11:09:23 +02:00
|
|
|
|
2021-02-07 11:14:40 +01:00
|
|
|
if pgrep qutebrowser >/dev/null; then
|
2023-03-07 18:19:23 +01:00
|
|
|
exec "$bin" $flags "$@"
|
2021-02-07 11:14:40 +01:00
|
|
|
else
|
|
|
|
url="$1"
|
|
|
|
ver='1.6.3'
|
|
|
|
proto=1
|
|
|
|
sock="$XDG_RUNTIME_DIR/qutebrowser/ipc-$(printf "%s" "$USER" | md5sum | cut -d\ -f1)"
|
|
|
|
fmt='{"args": ["%s"], "target_arg": null, "version": "%s", "protocol_version": %d, "cwd": "%s"}\n'
|
2023-03-07 18:19:23 +01:00
|
|
|
printf "$fmt" "$url" "$ver" "$proto" "$PWD" | nc -U "$sock" 2>/dev/null || exec "$bin" $flags "$@" &
|
2021-02-07 11:14:40 +01:00
|
|
|
fi
|