Merge branch 'main' into screenshare
This commit is contained in:
commit
b5ee5b1bbe
2 changed files with 8 additions and 4 deletions
|
@ -15,7 +15,8 @@ interface AutoStart {
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeAutoStartLinux(): AutoStart {
|
function makeAutoStartLinux(): AutoStart {
|
||||||
const dir = join(process.env.HOME!, ".config", "autostart");
|
const configDir = process.env.XDG_CONFIG_HOME || join(process.env.HOME!, ".config");
|
||||||
|
const dir = join(configDir, "autostart");
|
||||||
const file = join(dir, "vencord.desktop");
|
const file = join(dir, "vencord.desktop");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { readFileSync, writeFileSync } from "fs";
|
import { mkdirSync, readFileSync, writeFileSync } from "fs";
|
||||||
import { join } from "path";
|
import { dirname, join } from "path";
|
||||||
import type { Settings as TSettings } from "shared/settings";
|
import type { Settings as TSettings } from "shared/settings";
|
||||||
import { SettingsStore } from "shared/utils/SettingsStore";
|
import { SettingsStore } from "shared/utils/SettingsStore";
|
||||||
|
|
||||||
|
@ -25,7 +25,10 @@ function loadSettings<T extends object = any>(file: string, name: string) {
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
const store = new SettingsStore(settings);
|
const store = new SettingsStore(settings);
|
||||||
store.addGlobalChangeListener(o => writeFileSync(file, JSON.stringify(o, null, 4)));
|
store.addGlobalChangeListener(o => {
|
||||||
|
mkdirSync(dirname(file), { recursive: true });
|
||||||
|
writeFileSync(file, JSON.stringify(o, null, 4));
|
||||||
|
});
|
||||||
|
|
||||||
return store;
|
return store;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue