From 95d1e0257bff21806f9b96aa17d5d31a84880dd8 Mon Sep 17 00:00:00 2001 From: Rizal Martin <49640119+rizalmart@users.noreply.github.com> Date: Mon, 2 Oct 2023 21:40:30 +0800 Subject: [PATCH] hacks-postinstall2.sh: added workaround for browsers, CEF-based, and electron-based application If a package was a chromium-based browser or QtWebkit/CEF-based/electron-based application. run as spot by default --- .../usr/local/petget/hacks-postinstall2.sh | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/woof-code/rootfs-skeleton/usr/local/petget/hacks-postinstall2.sh b/woof-code/rootfs-skeleton/usr/local/petget/hacks-postinstall2.sh index 08b46f12ef4..2c711827bfe 100644 --- a/woof-code/rootfs-skeleton/usr/local/petget/hacks-postinstall2.sh +++ b/woof-code/rootfs-skeleton/usr/local/petget/hacks-postinstall2.sh @@ -25,3 +25,31 @@ echo "#!/bin/sh chmod +x $pmhib done fi + + +if [ "$(grep "/opt" "$PKGFILES" | grep -m 1 "/QtWebEngineProcess")" != "" ]; then + + for fle in $(grep -E "\.desktop" "$PKGFILES" | tr '\n' ' ') + do + sed -i -e "s#^Exec=#Exec=run-as-spot\ #g" "$fle" + done + +fi + + +if [ "$(echo "$PKGFILES" | grep -E "chrome|vivaldi|opera|chromium|brave|srware|rekonq|microsoft\-edge|msdge")" != "" ]; then + + for fle in $(grep -E "\.desktop" "$PKGFILES" | tr '\n' ' ') + do + sed -i -e "s#^Exec=#Exec=run-as-spot\ #g" "$fle" + done + +elif [ "$(grep -m 1 "/chrome-sandbox" "$PKGFILES")" != "" ]; then + + for fle in $(grep -E "\.desktop" "$PKGFILES" | tr '\n' ' ') + do + sed -i -e "s#^Exec=#Exec=run-as-spot\ #g" "$fle" + done + +fi +