summaryrefslogtreecommitdiff
path: root/app.tsx
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-19 15:04:57 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-19 15:04:57 +1100
commit1a0816655d3eb857ed84951b52558a47724875c3 (patch)
tree30fe48571d2a3e60d8913aa298e52f6e4c9b3450 /app.tsx
parentbar: fix being too tall when vertical (diff)
downloadcaelestia-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.tsx14
1 files changed, 10 insertions, 4 deletions
diff --git a/app.tsx b/app.tsx
index f6ed759..113644e 100644
--- a/app.tsx
+++ b/app.tsx
@@ -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);
};