From 4d6eca3ee8fba643489e2c3aaf6f266fc84046f8 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 25 Feb 2024 22:20:59 +0700 Subject: [PATCH] styles: compile to cache (more) three's still something compiling styles to ags folder... idk --- .config/ags/config.js | 4 ++-- .config/ags/modules/indicators/musiccontrols.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.config/ags/config.js b/.config/ags/config.js index 07b849f19..59d5e74ba 100644 --- a/.config/ags/config.js +++ b/.config/ags/config.js @@ -17,6 +17,7 @@ import Session from './modules/session/main.js'; import SideLeft from './modules/sideleft/main.js'; import SideRight from './modules/sideright/main.js'; +const COMPILED_STYLE_DIR = `${GLib.get_user_cache_dir()}/ags/user/generated` const range = (length, start = 1) => Array.from({ length }, (_, i) => i + start); function forMonitors(widget) { const n = Gdk.Display.get_default()?.get_n_monitors() || 1; @@ -27,7 +28,6 @@ function forMonitors(widget) { Utils.exec(`bash -c 'echo "" > ${App.configDir}/scss/_musicwal.scss'`); // reset music styles Utils.exec(`bash -c 'echo "" > ${App.configDir}/scss/_musicmaterial.scss'`); // reset music styles async function applyStyle() { - const COMPILED_STYLE_DIR = `${GLib.get_user_cache_dir()}/ags/user/generated` Utils.exec(`mkdir -p ${COMPILED_STYLE_DIR}`); Utils.exec(`sass ${App.configDir}/scss/main.scss ${COMPILED_STYLE_DIR}/style.css`); App.resetCss(); @@ -56,7 +56,7 @@ const Windows = () => [ ]; const CLOSE_ANIM_TIME = 210; // Longer than actual anim time to make sure widgets animate fully export default { - css: `${App.configDir}/style.css`, + css: `${COMPILED_STYLE_DIR}/style.css`, stackTraceOnError: true, closeWindowDelay: { // For animations 'sideright': CLOSE_ANIM_TIME, diff --git a/.config/ags/modules/indicators/musiccontrols.js b/.config/ags/modules/indicators/musiccontrols.js index 5bf8971bb..c4e54853d 100644 --- a/.config/ags/modules/indicators/musiccontrols.js +++ b/.config/ags/modules/indicators/musiccontrols.js @@ -9,6 +9,8 @@ const { Box, EventBox, Icon, Scrollable, Label, Button, Revealer } = Widget; import { AnimatedCircProg } from "../.commonwidgets/cairo_circularprogress.js"; import { showMusicControls } from '../../variables.js'; +const COMPILED_STYLE_DIR = `${GLib.get_user_cache_dir()}/ags/user/generated` + function expandTilde(path) { if (path.startsWith('~')) { return GLib.get_home_dir() + path.slice(1); @@ -187,7 +189,7 @@ const CoverArt = ({ player, ...rest }) => { // Note that cover path still remains, so we're checking title if (!player || player.trackTitle == "") { self.css = `background-image: none;`; - App.applyCss(`${App.configDir}/style.css`); + App.applyCss(`${COMPILED_STYLE_DIR}/style.css`); return; }