From d78897fe62a26bec189771b0d41b3fbc34ba5994 Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 9 Oct 2024 06:42:07 +0200 Subject: Use less env, make more reliable --- SpacebarDiscordDesktopLauncher/Program.cs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/SpacebarDiscordDesktopLauncher/Program.cs b/SpacebarDiscordDesktopLauncher/Program.cs index e72a641..9ab2af0 100644 --- a/SpacebarDiscordDesktopLauncher/Program.cs +++ b/SpacebarDiscordDesktopLauncher/Program.cs @@ -1,4 +1,4 @@ -// See https://aka.ms/new-console-template for more information +// See https://aka.ms/new-console-template for more information using System.Diagnostics; using System.Text.Json; @@ -41,17 +41,34 @@ internal class Program if (File.Exists(settingsJsonPath)) discordSettings = JsonSerializer.Deserialize(File.ReadAllText(settingsJsonPath)); + // skip updates discordSettings!["SKIP_HOST_UPDATE"] = true; + discordSettings!["SKIP_MODULE_UPDATE"] = true; + //discordSettings!["ALWAYS_ALLOW_UPDATES"] = false; + //discordSettings!["ALWAYS_BOOTSTRAP_MODULES"] = false; + discordSettings!["USE_LOCAL_MODULE_VERSIONS"] = true; + + // enable devtools + discordSettings!["DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING"] = true; + + // various behavior changes + discordSettings!["WEBAPP_ENDPOINT"] = "https://dev.app.spacebar.chat"; + discordSettings!["trayBalloonShown"] = true; // We don't need to be re-introduced to how system trays work + discordSettings!["MIN_WIDTH"] = 1; + discordSettings!["MIN_HEIGHT"] = 1; + discordSettings!["BACKGROUND_COLOR"] = "#0000FF"; + + File.WriteAllText(settingsJsonPath, JsonSerializer.Serialize(discordSettings)); Console.WriteLine($"Wrote settings.json... Contents: {discordSettings}"); Console.WriteLine($"Full path: {settingsJsonPath}"); } - var psi = new ProcessStartInfo(discordClientPath) + var psi = new ProcessStartInfo(discordClientPath, ["--allow-insecure-localhost", "--disable-features=OutOfBlinkCors"]) { Environment = { - { "DISCORD_WEBAPP_ENDPOINT", "https://app.spacebar.chat" }, + // { "DISCORD_WEBAPP_ENDPOINT", "http://discord.localhost" }, { "DISCORD_USER_DATA_DIR", userDataPath }, } }; -- cgit 1.4.1