summarylogtreecommitdiffstats
path: root/0001-add-support-for-user-flags.patch
blob: 1bdb3b861ea428f44ff2950cf5d82a610dffd603 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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>
---
 vivaldi-stable | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/vivaldi-stable b/vivaldi-stable
index 5b5f1bf..8e95859 100755
--- a/vivaldi-stable
+++ b/vivaldi-stable
@@ -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