Skip to content

Commit

Permalink
fix windows icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex313031 committed May 17, 2024
1 parent 5153d25 commit 124081d
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 7 deletions.
Binary file added assets/desktop.ico
Binary file not shown.
Binary file modified assets/desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed build/icon.png
Binary file not shown.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export async function checkIfConfigIsBroken(): Promise<void> {
export function setup(): void {
console.log("Setting up temporary ArmCord settings.");
const isLinux = process.platform === "linux";
const isWin = process.platform === "win32";
const defaults: Settings = {
windowStyle: isLinux ? "native" : "default",
channel: "stable",
Expand All @@ -150,7 +151,9 @@ export function setup(): void {
trayIcon: "default",
doneSetup: false,
clientName: "ArmCord",
customIcon: path.join(__dirname, "../", "/assets/desktop.png")
customIcon: isWin
? path.join(__dirname, "../", "/assets/desktop.ico")
: path.join(__dirname, "../", "/assets/desktop.png")
};
setConfigBulk({
...defaults
Expand Down
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if (!app.requestSingleInstanceLock() && getConfigSync("multiInstance") == (false
app.commandLine.appendSwitch("enable-features", "WebRTCPipeWireCapturer");
console.log("Wayland detected, using PipeWire for video capture.");
}
// work around chrome 66 disabling autoplay by default
// work around chromium 66 disabling autoplay by default
app.commandLine.appendSwitch("autoplay-policy", "no-user-gesture-required");
// WinRetrieveSuggestionsOnlyOnDemand: Work around electron 13 bug w/ async spellchecking on Windows.
// HardwareMediaKeyHandling,MediaSessionService: Prevent Discord from registering as a media service.
Expand All @@ -85,6 +85,8 @@ if (!app.requestSingleInstanceLock() && getConfigSync("multiInstance") == (false
app.whenReady().then(async () => {
if ((await getConfig("customIcon")) !== undefined ?? null) {
iconPath = await getConfig("customIcon");
} else if (process.platform === "win32") {
iconPath = path.join(__dirname, "../", "/assets/desktop.ico");
} else {
iconPath = path.join(__dirname, "../", "/assets/desktop.png");
}
Expand Down
8 changes: 4 additions & 4 deletions src/setup/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@
"linuxNotice"
).innerHTML = `Linux may not work well with tray icons. Depending on your system configuration, you may not be able to see the tray icon. Enable at your own risk. Can be changed later.`;
}
let useNativeLinux;
let windowStyleDefault;
if (window.armcordinternal.getOS == "linux") {
useNativeLinux = "native";
windowStyleDefault = "native";
} else {
useNativeLinux = "default";
windowStyleDefault = "default";
}
document.getElementById("next-page4").addEventListener("click", () => {
window.armcordinternal.saveSettings({
windowStyle: useNativeLinux,
windowStyle: windowStyleDefault,
channel: options.channel,
armcordCSP: true,
minimizeToTray: true,
Expand Down

0 comments on commit 124081d

Please sign in to comment.