diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-02-19 15:04:57 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-02-19 15:04:57 +1100 |
| commit | 1a0816655d3eb857ed84951b52558a47724875c3 (patch) | |
| tree | 30fe48571d2a3e60d8913aa298e52f6e4c9b3450 /app.tsx | |
| parent | bar: fix being too tall when vertical (diff) | |
| download | caelestia-shell-1a0816655d3eb857ed84951b52558a47724875c3.tar.gz caelestia-shell-1a0816655d3eb857ed84951b52558a47724875c3.tar.bz2 caelestia-shell-1a0816655d3eb857ed84951b52558a47724875c3.zip | |
scheme: use new scheme backend
Diffstat (limited to 'app.tsx')
| -rw-r--r-- | app.tsx | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -11,12 +11,18 @@ import { execAsync, GLib, monitorFile, readFileAsync, writeFileAsync } from "ast import { App } from "astal/gtk3"; const loadStyleAsync = async () => { - let scheme = "mocha"; + let schemeColours; if (GLib.file_test(`${CACHE}/scheme/current.txt`, GLib.FileTest.EXISTS)) { const currentScheme = await readFileAsync(`${CACHE}/scheme/current.txt`); - if (GLib.file_test(`${SRC}/scss/scheme/_${currentScheme}.scss`, GLib.FileTest.EXISTS)) scheme = currentScheme; - } - await writeFileAsync(`${SRC}/scss/scheme/_index.scss`, `@forward "${scheme}";`); + schemeColours = currentScheme + .split("\n") + .map(l => { + const [name, hex] = l.split(" "); + return `$${name}: #${hex};`; + }) + .join("\n"); + } else schemeColours = await readFileAsync(`${SRC}/scss/scheme/_default.scss`); + await writeFileAsync(`${SRC}/scss/scheme/_index.scss`, schemeColours); App.apply_css(await execAsync(`sass ${SRC}/style.scss`), true); }; |