void-packages/srcpkgs/vivaldi/patches/support-user-flags.patch

38 lines
1.3 KiB
Diff

From 68c2dec905a7c88895c458dd40708ab9989385cf Mon Sep 17 00:00:00 2001
From: BlackEagle <ike.devolder@gmail.com>
Date: Wed, 19 Jan 2022 20:57:58 +0100
Subject: [PATCH] add support for user flags
Signed-off-by: BlackEagle <ike.devolder@gmail.com>
---
opt/vivaldi/vivaldi | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/opt/vivaldi/vivaldi b/opt/vivaldi/vivaldi
index 5b5f1bf..8e95859 100755
--- a/opt/vivaldi/vivaldi
+++ b/opt/vivaldi/vivaldi
@@ -53,6 +53,13 @@ export CHROME_VERSION_EXTRA="stable"
# We don't want bug-buddy intercepting our crashes. http://crbug.com/24120
export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME
+# Allow users to override command-line options
+XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
+VIVALDI_USER_FLAGS=""
+if [[ -f "$XDG_CONFIG_HOME/vivaldi-$CHROME_VERSION_EXTRA.conf" ]]; then
+ VIVALDI_USER_FLAGS="$(cat "$XDG_CONFIG_HOME/vivaldi-$CHROME_VERSION_EXTRA.conf")"
+fi
+
# Sanitize std{in,out,err} because they'll be shared with untrusted child
# processes (http://crbug.com/376567).
exec < /dev/null
@@ -60,4 +67,4 @@ exec > >(exec cat)
exec 2> >(exec cat >&2)
# Note: exec -a below is a bashism.
-exec -a "$0" "$HERE/vivaldi-bin" "$@"
+exec -a "$0" "$HERE/vivaldi-bin" $VIVALDI_USER_FLAGS "$@"
--
2.34.1