diff --git a/src/system/Desktop.ts b/src/system/Desktop.ts index ffc4876..57e167f 100644 --- a/src/system/Desktop.ts +++ b/src/system/Desktop.ts @@ -100,7 +100,7 @@ const BootLoader: Process = { const dataString = Buffer.from(data).toString() const config = parse(dataString) document.body.style.backgroundImage = "url(" + config.BACKGROUND.toString() + ")"}) - + document.body.style.backgroundSize = "cover" await statusBar.element.appendTo(document.body) await launcher.element.appendTo(document.body) await wm.windowArea.appendTo(document.body) diff --git a/src/system/VirtualFS.ts b/src/system/VirtualFS.ts index 49a85d9..a6db212 100644 --- a/src/system/VirtualFS.ts +++ b/src/system/VirtualFS.ts @@ -377,7 +377,8 @@ export const defaultFS: { root: Directory } = { 'SERVER=http://localhost:3000/', '24_HOUR=false', 'THEME=Mocha', - 'THEME_PRIMARY=blue' + 'THEME_PRIMARY=blue', + 'BACKGROUND=' ].join('\n')) }, hostname: { @@ -449,6 +450,10 @@ class VirtualFS { config.THEME_PRIMARY = 'blue' await this.writeFile('/etc/flow', stringify(config)) } + if (config.BACKGROUND == null) { + config.BACKGROUND = '' + await this.writeFile('/etc/flow', stringify(config)) + } }) } diff --git a/src/system/apps/Settings.ts b/src/system/apps/Settings.ts index e5cdf0c..2bdef80 100644 --- a/src/system/apps/Settings.ts +++ b/src/system/apps/Settings.ts @@ -39,12 +39,6 @@ const Settings: Process = { } else if (item === 'THEME') { input = Dropdown.new((await fs.readdir('/etc/themes')).map((theme: string) => theme.replace('.theme', ''))) } - if (item === 'BACKGROUND') { - const { background } = JSON.parse(Buffer.from(await fs.readFile(`/etc/flow/${config.BACKGROUND as string}.BACKGROUND`)).toString()) - document.cookie = "background=" + background + "; expires=Thu, 18 Dec 9999 12:00:00 UTC; path=/"; - } else if (item === 'THEME') { - input = Dropdown.new((await fs.readdir('/etc/themes')).map((theme: string) => theme.replace('.theme', ''))) - } if (item === 'THEME_PRIMARY' || item === 'THEME') { (input.elm as HTMLSelectElement).value = config[item]