From 67b4971b6557b8829b0ac3dcc66e5dd913b10857 Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Sun, 30 Nov 2025 12:42:47 +0100 Subject: [PATCH] Matugen/emacs: more logic fixes --- Services/Theming/TemplateProcessor.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Services/Theming/TemplateProcessor.qml b/Services/Theming/TemplateProcessor.qml index bc960073..cff93b92 100644 --- a/Services/Theming/TemplateProcessor.qml +++ b/Services/Theming/TemplateProcessor.qml @@ -140,7 +140,9 @@ Singleton { lines.push(`\n[templates.emacs]`); lines.push(`input_path = "${Quickshell.shellDir}/Assets/MatugenTemplates/${app.input}"`); lines.push(`output_path = "${standardPathTemplate}"`); - lines.push(`post_hook = "sh -c 'if [ -d \\"${doomConfigDir}\\" ]; then mkdir -p \\"${doomDir}\\" && mv \\"${standardPath}\\" \\"${doomPath}\\" && rmdir \\"${homeDir}/.emacs.d/themes\\" 2>/dev/null; rmdir \\"${homeDir}/.emacs.d\\" 2>/dev/null; fi'"`); + // Move to doom if doom exists, then remove empty .emacs.d/themes and .emacs.d directories + // Check directories are empty before removing + lines.push(`post_hook = "sh -c 'if [ -d \\"${doomConfigDir}\\" ] && [ -f \\"${standardPath}\\" ]; then mkdir -p \\"${doomDir}\\" && mv \\"${standardPath}\\" \\"${doomPath}\\" && rmdir \\"${homeDir}/.emacs.d/themes\\" 2>/dev/null && rmdir \\"${homeDir}/.emacs.d\\" 2>/dev/null || true; fi'"`); } } else { // Handle regular apps