From 1410269dfd079ea88454890f5d2d8a89938d7ba4 Mon Sep 17 00:00:00 2001 From: Lysec Date: Sun, 18 Jan 2026 16:24:57 +0100 Subject: [PATCH] cleanup --- .../Terminal/alacritty.toml | 0 Assets/{Theming => Templates}/Terminal/foot | 0 .../{Theming => Templates}/Terminal/ghostty | 0 .../Terminal/kitty.conf | 0 .../Terminal/wezterm.toml | 0 Assets/{Theming => Templates}/btop.theme | 0 Assets/{Theming => Templates}/cava.ini | 0 Assets/{Theming => Templates}/code.json | 0 Assets/{Theming => Templates}/emacs.el | 6 +- Assets/{Theming => Templates}/fuzzel.conf | 2 +- Assets/{Theming => Templates}/gtk.css | 2 +- Assets/{Theming => Templates}/helix.toml | 4 +- Assets/{Theming => Templates}/hyprland.conf | 0 .../{Theming => Templates}/hyprtoolkit.conf | 0 .../kcolorscheme.colors | 2 +- Assets/{Theming => Templates}/mango.conf | 0 Assets/{Theming => Templates}/niri.kdl | 0 Assets/{Theming => Templates}/noctalia.json | 0 Assets/{Theming => Templates}/pywalfox.json | 0 Assets/{Theming => Templates}/qtct.conf | 0 Assets/{Theming => Templates}/spicetify.ini | 0 .../telegram.tdesktop-theme | 2 +- Assets/{Theming => Templates}/vesktop.css | 0 Assets/{Theming => Templates}/vicinae.toml | 0 Assets/{Theming => Templates}/walker.css | 0 Assets/{Theming => Templates}/yazi.toml | 0 Assets/{Theming => Templates}/zed.json | 0 .../zen-browser/zen-userChrome.css | 0 .../zen-browser/zen-userContent.css | 0 Assets/settings-default.json | 4 +- CREDITS.md | 3 - Commons/Settings.qml | 3 +- {Bin => Scripts}/calendar/calendar-events.py | 0 {Bin => Scripts}/calendar/check-calendar.py | 0 {Bin => Scripts}/calendar/list-calendars.py | 0 {Bin => Scripts}/dev/colorscheme-registry.sh | 0 {Bin => Scripts}/dev/i18n-pull.sh | 0 {Bin => Scripts}/dev/i18n-push.sh | 0 .../dev/notifications-test-replace.sh | 0 {Bin => Scripts}/dev/notifications-test.sh | 0 {Bin => Scripts}/dev/qmlfmt.sh | 0 {Bin => Scripts}/dev/shaders-compile.sh | 0 {Bin => Scripts}/network/bluetooth-connect.sh | 0 {Bin => Scripts}/theming/template-apply.sh | 0 .../theming/template-processor.py | 6 +- Services/Location/CalendarService.qml | 6 +- Services/Networking/BluetoothService.qml | 2 +- Services/Theming/AppThemeService.qml | 2 +- Services/Theming/TemplateProcessor.qml | 66 ++++++++----------- Services/Theming/TemplateRegistry.qml | 4 +- lefthook.yml | 2 +- nix/package.nix | 2 +- 52 files changed, 51 insertions(+), 67 deletions(-) rename Assets/{Theming => Templates}/Terminal/alacritty.toml (100%) rename Assets/{Theming => Templates}/Terminal/foot (100%) rename Assets/{Theming => Templates}/Terminal/ghostty (100%) rename Assets/{Theming => Templates}/Terminal/kitty.conf (100%) rename Assets/{Theming => Templates}/Terminal/wezterm.toml (100%) rename Assets/{Theming => Templates}/btop.theme (100%) rename Assets/{Theming => Templates}/cava.ini (100%) rename Assets/{Theming => Templates}/code.json (100%) rename Assets/{Theming => Templates}/emacs.el (98%) rename Assets/{Theming => Templates}/fuzzel.conf (94%) rename Assets/{Theming => Templates}/gtk.css (96%) rename Assets/{Theming => Templates}/helix.toml (98%) rename Assets/{Theming => Templates}/hyprland.conf (100%) rename Assets/{Theming => Templates}/hyprtoolkit.conf (100%) rename Assets/{Theming => Templates}/kcolorscheme.colors (99%) rename Assets/{Theming => Templates}/mango.conf (100%) rename Assets/{Theming => Templates}/niri.kdl (100%) rename Assets/{Theming => Templates}/noctalia.json (100%) rename Assets/{Theming => Templates}/pywalfox.json (100%) rename Assets/{Theming => Templates}/qtct.conf (100%) rename Assets/{Theming => Templates}/spicetify.ini (100%) rename Assets/{Theming => Templates}/telegram.tdesktop-theme (99%) rename Assets/{Theming => Templates}/vesktop.css (100%) rename Assets/{Theming => Templates}/vicinae.toml (100%) rename Assets/{Theming => Templates}/walker.css (100%) rename Assets/{Theming => Templates}/yazi.toml (100%) rename Assets/{Theming => Templates}/zed.json (100%) rename Assets/{Theming => Templates}/zen-browser/zen-userChrome.css (100%) rename Assets/{Theming => Templates}/zen-browser/zen-userContent.css (100%) rename {Bin => Scripts}/calendar/calendar-events.py (100%) rename {Bin => Scripts}/calendar/check-calendar.py (100%) rename {Bin => Scripts}/calendar/list-calendars.py (100%) rename {Bin => Scripts}/dev/colorscheme-registry.sh (100%) rename {Bin => Scripts}/dev/i18n-pull.sh (100%) rename {Bin => Scripts}/dev/i18n-push.sh (100%) rename {Bin => Scripts}/dev/notifications-test-replace.sh (100%) rename {Bin => Scripts}/dev/notifications-test.sh (100%) rename {Bin => Scripts}/dev/qmlfmt.sh (100%) rename {Bin => Scripts}/dev/shaders-compile.sh (100%) rename {Bin => Scripts}/network/bluetooth-connect.sh (100%) rename {Bin => Scripts}/theming/template-apply.sh (100%) rename {Bin => Scripts}/theming/template-processor.py (99%) diff --git a/Assets/Theming/Terminal/alacritty.toml b/Assets/Templates/Terminal/alacritty.toml similarity index 100% rename from Assets/Theming/Terminal/alacritty.toml rename to Assets/Templates/Terminal/alacritty.toml diff --git a/Assets/Theming/Terminal/foot b/Assets/Templates/Terminal/foot similarity index 100% rename from Assets/Theming/Terminal/foot rename to Assets/Templates/Terminal/foot diff --git a/Assets/Theming/Terminal/ghostty b/Assets/Templates/Terminal/ghostty similarity index 100% rename from Assets/Theming/Terminal/ghostty rename to Assets/Templates/Terminal/ghostty diff --git a/Assets/Theming/Terminal/kitty.conf b/Assets/Templates/Terminal/kitty.conf similarity index 100% rename from Assets/Theming/Terminal/kitty.conf rename to Assets/Templates/Terminal/kitty.conf diff --git a/Assets/Theming/Terminal/wezterm.toml b/Assets/Templates/Terminal/wezterm.toml similarity index 100% rename from Assets/Theming/Terminal/wezterm.toml rename to Assets/Templates/Terminal/wezterm.toml diff --git a/Assets/Theming/btop.theme b/Assets/Templates/btop.theme similarity index 100% rename from Assets/Theming/btop.theme rename to Assets/Templates/btop.theme diff --git a/Assets/Theming/cava.ini b/Assets/Templates/cava.ini similarity index 100% rename from Assets/Theming/cava.ini rename to Assets/Templates/cava.ini diff --git a/Assets/Theming/code.json b/Assets/Templates/code.json similarity index 100% rename from Assets/Theming/code.json rename to Assets/Templates/code.json diff --git a/Assets/Theming/emacs.el b/Assets/Templates/emacs.el similarity index 98% rename from Assets/Theming/emacs.el rename to Assets/Templates/emacs.el index 2a69691ce..ffff4de11 100644 --- a/Assets/Theming/emacs.el +++ b/Assets/Templates/emacs.el @@ -1,4 +1,4 @@ -;;; noctalia-theme.el --- Theme using Matugen SCSS variables +;;; noctalia-theme.el --- Theme using Template SCSS variables ;; Copyright (C) 2025 @@ -9,7 +9,7 @@ ;;; Commentary: -;; A theme using Matugen SCSS variables with quality of life improvements: +;; A theme using Template SCSS variables with quality of life improvements: ;; - Better source block distinction ;; - Improved text visibility when selected ;; - Refined org-mode styling with hidden asterisks @@ -18,7 +18,7 @@ ;;; Code: -(deftheme noctalia "Theme using Matugen variables with quality of life improvements.") +(deftheme noctalia "Theme using Template variables with quality of life improvements.") ;; Define all the color variables (replaced by template processor) (let* ((bg "{{colors.background.default.hex}}") diff --git a/Assets/Theming/fuzzel.conf b/Assets/Templates/fuzzel.conf similarity index 94% rename from Assets/Theming/fuzzel.conf rename to Assets/Templates/fuzzel.conf index da0055373..aa34ef5e7 100644 --- a/Assets/Theming/fuzzel.conf +++ b/Assets/Templates/fuzzel.conf @@ -1,5 +1,5 @@ # Fuzzel Colors -# Generated with Matugen +# Generated with Template Processor [colors] background={{colors.background.default.hex_stripped}}CC diff --git a/Assets/Theming/gtk.css b/Assets/Templates/gtk.css similarity index 96% rename from Assets/Theming/gtk.css rename to Assets/Templates/gtk.css index e0e76e4a8..6305f28eb 100644 --- a/Assets/Theming/gtk.css +++ b/Assets/Templates/gtk.css @@ -1,6 +1,6 @@ /* * GTK Colors -* Generated with Matugen +* Generated with Template Processor */ @define-color accent_color {{colors.primary.default.hex}}; diff --git a/Assets/Theming/helix.toml b/Assets/Templates/helix.toml similarity index 98% rename from Assets/Theming/helix.toml rename to Assets/Templates/helix.toml index 81d706dfc..c118a2734 100644 --- a/Assets/Theming/helix.toml +++ b/Assets/Templates/helix.toml @@ -113,14 +113,14 @@ hint = "hint" "diagnostic.unnecessary" = { modifiers = ["dim"] } [palette] -# Constants to be used in syntax highlighting, not meant for matugen. +# Constants to be used in syntax highlighting, not meant for template processor. warning = "#f9e2af" info = "#89dceb" hint = "#94e2d5" plus = "#a6e3a1" delta = "#89b4fa" -# Matugen colors +# Template colors primary = "{{colors.primary.default.hex}}" surfaceTint = "{{colors.primary.default.hex}}" onPrimary = "{{colors.on_primary.default.hex}}" diff --git a/Assets/Theming/hyprland.conf b/Assets/Templates/hyprland.conf similarity index 100% rename from Assets/Theming/hyprland.conf rename to Assets/Templates/hyprland.conf diff --git a/Assets/Theming/hyprtoolkit.conf b/Assets/Templates/hyprtoolkit.conf similarity index 100% rename from Assets/Theming/hyprtoolkit.conf rename to Assets/Templates/hyprtoolkit.conf diff --git a/Assets/Theming/kcolorscheme.colors b/Assets/Templates/kcolorscheme.colors similarity index 99% rename from Assets/Theming/kcolorscheme.colors rename to Assets/Templates/kcolorscheme.colors index c3a8ed4c8..b4a61a792 100644 --- a/Assets/Theming/kcolorscheme.colors +++ b/Assets/Templates/kcolorscheme.colors @@ -2,7 +2,7 @@ contrast=4 [General] -ColorScheme=Matugen +ColorScheme=Noctalia Name=noctalia [ColorEffects:Disabled] diff --git a/Assets/Theming/mango.conf b/Assets/Templates/mango.conf similarity index 100% rename from Assets/Theming/mango.conf rename to Assets/Templates/mango.conf diff --git a/Assets/Theming/niri.kdl b/Assets/Templates/niri.kdl similarity index 100% rename from Assets/Theming/niri.kdl rename to Assets/Templates/niri.kdl diff --git a/Assets/Theming/noctalia.json b/Assets/Templates/noctalia.json similarity index 100% rename from Assets/Theming/noctalia.json rename to Assets/Templates/noctalia.json diff --git a/Assets/Theming/pywalfox.json b/Assets/Templates/pywalfox.json similarity index 100% rename from Assets/Theming/pywalfox.json rename to Assets/Templates/pywalfox.json diff --git a/Assets/Theming/qtct.conf b/Assets/Templates/qtct.conf similarity index 100% rename from Assets/Theming/qtct.conf rename to Assets/Templates/qtct.conf diff --git a/Assets/Theming/spicetify.ini b/Assets/Templates/spicetify.ini similarity index 100% rename from Assets/Theming/spicetify.ini rename to Assets/Templates/spicetify.ini diff --git a/Assets/Theming/telegram.tdesktop-theme b/Assets/Templates/telegram.tdesktop-theme similarity index 99% rename from Assets/Theming/telegram.tdesktop-theme rename to Assets/Templates/telegram.tdesktop-theme index 70854823e..beebe2289 100644 --- a/Assets/Theming/telegram.tdesktop-theme +++ b/Assets/Templates/telegram.tdesktop-theme @@ -1,5 +1,5 @@ // Material You theme for Telegram Desktop -// Generated by matugen +// Generated by Template Processor COLOR_GRAY: {{colors.outline.default.hex}}; COLOR_DARK: {{colors.surface_variant.default.hex}}; diff --git a/Assets/Theming/vesktop.css b/Assets/Templates/vesktop.css similarity index 100% rename from Assets/Theming/vesktop.css rename to Assets/Templates/vesktop.css diff --git a/Assets/Theming/vicinae.toml b/Assets/Templates/vicinae.toml similarity index 100% rename from Assets/Theming/vicinae.toml rename to Assets/Templates/vicinae.toml diff --git a/Assets/Theming/walker.css b/Assets/Templates/walker.css similarity index 100% rename from Assets/Theming/walker.css rename to Assets/Templates/walker.css diff --git a/Assets/Theming/yazi.toml b/Assets/Templates/yazi.toml similarity index 100% rename from Assets/Theming/yazi.toml rename to Assets/Templates/yazi.toml diff --git a/Assets/Theming/zed.json b/Assets/Templates/zed.json similarity index 100% rename from Assets/Theming/zed.json rename to Assets/Templates/zed.json diff --git a/Assets/Theming/zen-browser/zen-userChrome.css b/Assets/Templates/zen-browser/zen-userChrome.css similarity index 100% rename from Assets/Theming/zen-browser/zen-userChrome.css rename to Assets/Templates/zen-browser/zen-userChrome.css diff --git a/Assets/Theming/zen-browser/zen-userContent.css b/Assets/Templates/zen-browser/zen-userContent.css similarity index 100% rename from Assets/Theming/zen-browser/zen-userContent.css rename to Assets/Templates/zen-browser/zen-userContent.css diff --git a/Assets/settings-default.json b/Assets/settings-default.json index d65b47247..c88643d06 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -381,13 +381,11 @@ "schedulingMode": "off", "manualSunrise": "06:30", "manualSunset": "18:30", - "matugenSchemeType": "scheme-fruit-salad", - "generationBackend": "matugen", "internalThemerMode": "material" }, "templates": { "activeTemplates": [], - "enableUserTemplates": false + "enableUserTheming": false }, "nightLight": { "enabled": false, diff --git a/CREDITS.md b/CREDITS.md index a626fdd22..699ef3dbb 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -24,9 +24,6 @@ Noctalia Shell is made possible by the incredible work of many open-source proje - **[gpu-screen-recorder](https://git.dec05eba.com/gpu-screen-recorder/about/)** - Hardware-accelerated screen recording - **[Cava](https://github.com/karlstav/cava)** - Audio visualizer component -### Theming & Appearance -- **[Matugen](https://github.com/InioX/matugen)** - Material You color scheme generation from wallpapers - ### Utilities - **[cliphist](https://github.com/sentriz/cliphist)** - Clipboard history support diff --git a/Commons/Settings.qml b/Commons/Settings.qml index ffc227ac8..2860c09e6 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -602,7 +602,6 @@ Singleton { property string schedulingMode: "off" property string manualSunrise: "06:30" property string manualSunset: "18:30" - property string generationBackend: "internal" property string internalThemerMode: "material" } @@ -610,7 +609,7 @@ Singleton { property JsonObject templates: JsonObject { property list activeTemplates: [] // Format: [{ "id": "gtk", "enabled": true }, { "id": "qt", "enabled": true }, ...] - property bool enableUserTemplates: false + property bool enableUserTheming: false } // night light diff --git a/Bin/calendar/calendar-events.py b/Scripts/calendar/calendar-events.py similarity index 100% rename from Bin/calendar/calendar-events.py rename to Scripts/calendar/calendar-events.py diff --git a/Bin/calendar/check-calendar.py b/Scripts/calendar/check-calendar.py similarity index 100% rename from Bin/calendar/check-calendar.py rename to Scripts/calendar/check-calendar.py diff --git a/Bin/calendar/list-calendars.py b/Scripts/calendar/list-calendars.py similarity index 100% rename from Bin/calendar/list-calendars.py rename to Scripts/calendar/list-calendars.py diff --git a/Bin/dev/colorscheme-registry.sh b/Scripts/dev/colorscheme-registry.sh similarity index 100% rename from Bin/dev/colorscheme-registry.sh rename to Scripts/dev/colorscheme-registry.sh diff --git a/Bin/dev/i18n-pull.sh b/Scripts/dev/i18n-pull.sh similarity index 100% rename from Bin/dev/i18n-pull.sh rename to Scripts/dev/i18n-pull.sh diff --git a/Bin/dev/i18n-push.sh b/Scripts/dev/i18n-push.sh similarity index 100% rename from Bin/dev/i18n-push.sh rename to Scripts/dev/i18n-push.sh diff --git a/Bin/dev/notifications-test-replace.sh b/Scripts/dev/notifications-test-replace.sh similarity index 100% rename from Bin/dev/notifications-test-replace.sh rename to Scripts/dev/notifications-test-replace.sh diff --git a/Bin/dev/notifications-test.sh b/Scripts/dev/notifications-test.sh similarity index 100% rename from Bin/dev/notifications-test.sh rename to Scripts/dev/notifications-test.sh diff --git a/Bin/dev/qmlfmt.sh b/Scripts/dev/qmlfmt.sh similarity index 100% rename from Bin/dev/qmlfmt.sh rename to Scripts/dev/qmlfmt.sh diff --git a/Bin/dev/shaders-compile.sh b/Scripts/dev/shaders-compile.sh similarity index 100% rename from Bin/dev/shaders-compile.sh rename to Scripts/dev/shaders-compile.sh diff --git a/Bin/network/bluetooth-connect.sh b/Scripts/network/bluetooth-connect.sh similarity index 100% rename from Bin/network/bluetooth-connect.sh rename to Scripts/network/bluetooth-connect.sh diff --git a/Bin/theming/template-apply.sh b/Scripts/theming/template-apply.sh similarity index 100% rename from Bin/theming/template-apply.sh rename to Scripts/theming/template-apply.sh diff --git a/Bin/theming/template-processor.py b/Scripts/theming/template-processor.py similarity index 99% rename from Bin/theming/template-processor.py rename to Scripts/theming/template-processor.py index 7beb91be5..05882d83e 100644 --- a/Bin/theming/template-processor.py +++ b/Scripts/theming/template-processor.py @@ -1457,6 +1457,9 @@ def main() -> int: return 1 + # Initialize result dictionary + result: dict[str, dict[str, str]] = {} + # Check if input is a JSON palette (Predefined Scheme bypass) if args.image.suffix.lower() == '.json': try: @@ -1478,8 +1481,6 @@ def main() -> int: # Best effort fallback flat_colors[k] = str(v) - # Pre-populate result (bypass extraction) - result = {} # Assign to both/all modes since predefined scheme usually provides the correct palette for the requested mode result["dark"] = flat_colors result["light"] = flat_colors @@ -1531,7 +1532,6 @@ def main() -> int: arg_light = True arg_both = False - result: dict[str, dict[str, str]] = {} if palette: if arg_dark: diff --git a/Services/Location/CalendarService.qml b/Services/Location/CalendarService.qml index b2fa4d2f9..fd32a19b8 100644 --- a/Services/Location/CalendarService.qml +++ b/Services/Location/CalendarService.qml @@ -19,9 +19,9 @@ Singleton { property string cacheFile: Settings.cacheDir + "calendar.json" // Python scripts - readonly property string checkCalendarAvailableScript: Quickshell.shellDir + '/Bin/calendar/check-calendar.py' - readonly property string listCalendarsScript: Quickshell.shellDir + '/Bin/calendar/list-calendars.py' - readonly property string calendarEventsScript: Quickshell.shellDir + '/Bin/calendar/calendar-events.py' + readonly property string checkCalendarAvailableScript: Quickshell.shellDir + '/Scripts/calendar/check-calendar.py' + readonly property string listCalendarsScript: Quickshell.shellDir + '/Scripts/calendar/list-calendars.py' + readonly property string calendarEventsScript: Quickshell.shellDir + '/Scripts/calendar/calendar-events.py' // Cache file handling FileView { diff --git a/Services/Networking/BluetoothService.qml b/Services/Networking/BluetoothService.qml index ac596bcc3..73f9878fd 100644 --- a/Services/Networking/BluetoothService.qml +++ b/Services/Networking/BluetoothService.qml @@ -540,7 +540,7 @@ Singleton { _pauseDiscoveryFor(totalPauseMs); // Prefer external dev script for pairing/connecting; executed detached - const scriptPath = Quickshell.shellDir + "/Bin/network/bluetooth-connect.sh"; + const scriptPath = Quickshell.shellDir + "/Scripts/network/bluetooth-connect.sh"; // Use bash explicitly to avoid relying on executable bit in all environments btExec(["bash", scriptPath, String(addr), String(pairWait), String(attempts), String(intervalSec)]); } diff --git a/Services/Theming/AppThemeService.qml b/Services/Theming/AppThemeService.qml index 2336a7da2..806fd98e5 100644 --- a/Services/Theming/AppThemeService.qml +++ b/Services/Theming/AppThemeService.qml @@ -8,7 +8,7 @@ import qs.Services.UI Singleton { id: root - readonly property string colorsApplyScript: Quickshell.shellDir + '/Bin/colors-apply.sh' + readonly property string colorsApplyScript: Quickshell.shellDir + '/Scripts/theming/template-apply.sh' Connections { target: WallpaperService diff --git a/Services/Theming/TemplateProcessor.qml b/Services/Theming/TemplateProcessor.qml index 7622280d3..a18f36bda 100644 --- a/Services/Theming/TemplateProcessor.qml +++ b/Services/Theming/TemplateProcessor.qml @@ -59,12 +59,8 @@ Singleton { return; const wp = wallpaperPath.replace(/'/g, "'\\''"); - // Always use internal backend (colors.py) - let backend = "internal"; + const script = buildGenerationScript(content, wp, mode); - const script = buildGenerationScript(content, wp, mode, backend); - - generateProcess.generator = backend; generateProcess.command = ["sh", "-lc", script]; generateProcess.running = true; } @@ -145,10 +141,10 @@ Singleton { var mode = Settings.data.colorSchemes.darkMode ? "dark" : "light"; if (Settings.data.colorSchemes.useWallpaperColors) { - addWallpaperTemplates(lines, mode); + addWallpaperTheming(lines, mode); } - addApplicationTemplates(lines, mode); + addApplicationTheming(lines, mode); if (lines.length > 0) { return ["[config]"].concat(lines).join("\n") + "\n"; @@ -156,18 +152,18 @@ Singleton { return ""; } - function addWallpaperTemplates(lines, mode) { + function addWallpaperTheming(lines, mode) { const homeDir = Quickshell.env("HOME"); // Noctalia colors JSON lines.push("[templates.noctalia]"); - lines.push('input_path = "' + Quickshell.shellDir + '/Assets/Theming/noctalia.json"'); + lines.push('input_path = "' + Quickshell.shellDir + '/Assets/Templates/noctalia.json"'); lines.push('output_path = "' + Settings.configDir + 'colors.json"'); // Terminal templates TemplateRegistry.terminals.forEach(terminal => { if (isTemplateEnabled(terminal.id)) { lines.push(`\n[templates.${terminal.id}]`); - lines.push(`input_path = "${Quickshell.shellDir}/Assets/Theming/${terminal.templatePath}"`); + lines.push(`input_path = "${Quickshell.shellDir}/Assets/Templates/${terminal.templatePath}"`); const outputPath = terminal.outputPath.replace("~", homeDir); lines.push(`output_path = "${outputPath}"`); const postHook = terminal.postHook || `${TemplateRegistry.colorsApplyScript} ${terminal.id}`; @@ -177,7 +173,7 @@ Singleton { }); } - function addApplicationTemplates(lines, mode) { + function addApplicationTheming(lines, mode) { const homeDir = Quickshell.env("HOME"); TemplateRegistry.applications.forEach(app => { if (app.id === "discord") { @@ -187,7 +183,7 @@ Singleton { // Check if this specific client is detected if (isDiscordClientEnabled(client.name)) { lines.push(`\n[templates.discord_${client.name}]`); - lines.push(`input_path = "${Quickshell.shellDir}/Assets/Theming/${app.input}"`); + lines.push(`input_path = "${Quickshell.shellDir}/Assets/Templates/${app.input}"`); const outputPath = client.path.replace("~", homeDir) + "/themes/noctalia.theme.css"; lines.push(`output_path = "${outputPath}"`); } @@ -200,7 +196,7 @@ Singleton { // Check if this specific client is detected if (isCodeClientEnabled(client.name)) { lines.push(`\n[templates.code_${client.name}]`); - lines.push(`input_path = "${Quickshell.shellDir}/Assets/Theming/${app.input}"`); + lines.push(`input_path = "${Quickshell.shellDir}/Assets/Templates/${app.input}"`); const expandedPath = client.path.replace("~", homeDir); lines.push(`output_path = "${expandedPath}"`); } @@ -216,7 +212,7 @@ Singleton { const doomDir = doomPath.substring(0, doomPath.lastIndexOf('/')); lines.push(`\n[templates.emacs]`); - lines.push(`input_path = "${Quickshell.shellDir}/Assets/Theming/${app.input}"`); + lines.push(`input_path = "${Quickshell.shellDir}/Assets/Templates/${app.input}"`); lines.push(`output_path = "${standardPath}"`); // Move to doom if doom exists, then remove empty .emacs.d/themes and .emacs.d directories // Check directories are empty before removing @@ -230,7 +226,7 @@ Singleton { app.outputs.forEach((output, idx) => { lines.push(`\n[templates.${app.id}_${idx}]`); const inputFile = output.input || app.input; - lines.push(`input_path = "${Quickshell.shellDir}/Assets/Theming/${inputFile}"`); + lines.push(`input_path = "${Quickshell.shellDir}/Assets/Templates/${inputFile}"`); const outputPath = output.path.replace("~", homeDir); lines.push(`output_path = "${outputPath}"`); if (app.postProcess) { @@ -263,7 +259,7 @@ Singleton { return false; } - function buildGenerationScript(content, wallpaper, mode, backend) { + function buildGenerationScript(content, wallpaper, mode) { const delimiter = "THEME_CONFIG_EOF_" + Math.random().toString(36).substr(2, 9); const pathEsc = dynamicConfigPath.replace(/'/g, "'\\''"); const wpDelimiter = "WALLPAPER_PATH_EOF_" + Math.random().toString(36).substr(2, 9); @@ -272,13 +268,13 @@ Singleton { let script = `cat > '${pathEsc}' << '${delimiter}'\n${content}\n${delimiter}\n`; script += `NOCTALIA_WP_PATH=$(cat << '${wpDelimiter}'\n${wallpaper}\n${wpDelimiter}\n)\n`; - // Use colors.py (Python implementation) - const scriptPath = Quickshell.shellDir + "/Bin/theming/template-processor.py"; + // Use template-processor.py (Python implementation) + const scriptPath = Quickshell.shellDir + "/Scripts/theming/template-processor.py"; const styleFlag = (Settings.data.colorSchemes.internalThemerMode === "normal") ? "--normal" : "--material"; // We pass --type for compatibility but it is ignored by internal logic unless needed script += `python3 "${scriptPath}" "$NOCTALIA_WP_PATH" ${styleFlag} --config '${pathEsc}' --mode ${mode} `; - script += buildUserTemplateCommand("$NOCTALIA_WP_PATH", mode, backend); + script += buildUserTemplateCommand("$NOCTALIA_WP_PATH", mode); return script + "\n"; } @@ -294,7 +290,7 @@ Singleton { if (!isDiscordClientEnabled(client.name)) return; - const templatePath = `${Quickshell.shellDir}/Assets/Theming/${discordApp.input}`; + const templatePath = `${Quickshell.shellDir}/Assets/Templates/${discordApp.input}`; const outputPath = `${client.path}/themes/noctalia.theme.css`.replace("~", homeDir); const outputDir = outputPath.substring(0, outputPath.lastIndexOf('/')); const baseConfigDir = outputDir.replace("/themes", ""); @@ -324,7 +320,7 @@ Singleton { if (!isCodeClientEnabled(client.name)) return; - const templatePath = `${Quickshell.shellDir}/Assets/Theming/${codeApp.input}`; + const templatePath = `${Quickshell.shellDir}/Assets/Templates/${codeApp.input}`; const outputPath = client.path.replace("~", homeDir); const outputDir = outputPath.substring(0, outputPath.lastIndexOf('/')); @@ -369,7 +365,7 @@ Singleton { const doomConfigDir = doomDir.substring(0, doomDir.lastIndexOf('/')); const standardPath = app.outputs[1].path.replace("~", homeDir); const standardDir = standardPath.substring(0, standardPath.lastIndexOf('/')); - const templatePath = `${Quickshell.shellDir}/Assets/Theming/${app.input}`; + const templatePath = `${Quickshell.shellDir}/Assets/Templates/${app.input}`; let script = ""; script += `if [ -d "${doomConfigDir}" ]; then\n`; @@ -389,13 +385,13 @@ Singleton { }); } else { app.outputs.forEach((output, idx) => { - const templatePath = `${Quickshell.shellDir}/Assets/Theming/${app.input}`; + const templatePath = `${Quickshell.shellDir}/Assets/Templates/${app.input}`; const outputPath = output.path.replace("~", homeDir); const outputDir = outputPath.substring(0, outputPath.lastIndexOf('/')); let script = ""; script += `mkdir -p ${outputDir}\n`; - const templateFile = output.input ? `${Quickshell.shellDir}/Assets/Theming/${output.input}` : templatePath; + const templateFile = output.input ? `${Quickshell.shellDir}/Assets/Templates/${output.input}` : templatePath; script += `cp '${templateFile}' '${outputPath}'\n`; script += replaceColorsInFile(outputPath, palette); if (hasDualModePatterns && darkPalette && lightPalette) { @@ -555,8 +551,8 @@ Singleton { // ================================================================================ // USER TEMPLATES, advanced usage // ================================================================================ - function buildUserTemplateCommand(input, mode, backend) { - if (!Settings.data.templates.enableUserTemplates) + function buildUserTemplateCommand(input, mode) { + if (!Settings.data.templates.enableUserTheming) return ""; const userConfigPath = getUserConfigPath(); @@ -566,22 +562,16 @@ Singleton { // Otherwise, use single quotes for safety with file paths const inputQuoted = input.startsWith("$") ? `"${input}"` : `'${input.replace(/'/g, "'\\''")}'`; - if (backend === "internal") { - const scriptPath = Quickshell.shellDir + "/Bin/theming/template-processor.py"; - const styleFlag = (Settings.data.colorSchemes.internalThemerMode === "normal") ? "--normal" : "--material"; - script += ` python3 "${scriptPath}" ${inputQuoted} ${styleFlag} --config '${userConfigPath}' --mode ${mode}\n`; - } else { - // Fallback to internal if backend param is weird - const scriptPath = Quickshell.shellDir + "/Bin/theming/template-processor.py"; - script += ` python3 "${scriptPath}" ${inputQuoted} --material --config '${userConfigPath}' --mode ${mode}\n`; - } + const scriptPath = Quickshell.shellDir + "/Scripts/theming/template-processor.py"; + const styleFlag = (Settings.data.colorSchemes.internalThemerMode === "normal") ? "--normal" : "--material"; + script += ` python3 "${scriptPath}" ${inputQuoted} ${styleFlag} --config '${userConfigPath}' --mode ${mode}\n`; script += "fi"; return script; } function buildUserTemplateCommandForPredefined(schemeData, mode) { - if (!Settings.data.templates.enableUserTemplates) + if (!Settings.data.templates.enableUserTheming) return ""; const userConfigPath = getUserConfigPath(); @@ -599,8 +589,8 @@ Singleton { }, null, 2) + "\n"; script += "EOF\n"; - const scriptPath = Quickshell.shellDir + "/Bin/theming/template-processor.py"; - // Call colors.py with JSON file as first arg (it will detect extension) + const scriptPath = Quickshell.shellDir + "/Scripts/theming/template-processor.py"; + // Call template-processor.py with JSON file as first arg (it will detect extension) script += ` python3 "${scriptPath}" '${tempJsonPathEsc}' --config '${userConfigPath}' --mode ${mode}\n`; script += "fi"; diff --git a/Services/Theming/TemplateRegistry.qml b/Services/Theming/TemplateRegistry.qml index cca051899..354c8d0fa 100644 --- a/Services/Theming/TemplateRegistry.qml +++ b/Services/Theming/TemplateRegistry.qml @@ -8,7 +8,7 @@ import qs.Commons Singleton { id: root - readonly property string colorsApplyScript: Quickshell.shellDir + '/Bin/theming/template-apply.sh' + readonly property string colorsApplyScript: Quickshell.shellDir + '/Scripts/theming/template-apply.sh' // Terminal configurations (for wallpaper-based templates) readonly property var terminals: [ @@ -430,7 +430,7 @@ Singleton { lines.push(""); lines.push("# Remove this section and add your own templates"); lines.push("#[templates.placeholder]"); - lines.push("#input_path = \"" + Quickshell.shellDir + "/Assets/Theming/noctalia.json\""); + lines.push("#input_path = \"" + Quickshell.shellDir + "/Assets/Templates/noctalia.json\""); lines.push("#output_path = \"" + Settings.cacheDir + "placeholder.json\""); lines.push(""); diff --git a/lefthook.yml b/lefthook.yml index 30dcc6596..f3dcf05c3 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -1,4 +1,4 @@ pre-commit: jobs: - name: format qml - run: cd "$(git rev-parse --show-toplevel)" && ./Bin/dev/qmlfmt.sh && git update-index --again + run: cd "$(git rev-parse --show-toplevel)" && ./Scripts/dev/qmlfmt.sh && git update-index --again diff --git a/nix/package.nix b/nix/package.nix index bb91c4055..61f0a9532 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -33,7 +33,7 @@ let /.github /.gitignore /Assets/Screenshots - /Bin/dev + /Scripts/dev /nix /LICENSE /README.md