From 60c63308db330a818406fa18e247ae07183e1aec Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Thu, 14 May 2026 15:20:06 +0545 Subject: [PATCH] feat(root): add Modugen template configuration to install script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change adds automatic configuration of Matugen templates for Modus themes, ensuring a consistent look‑and‑feel across Hyprland and terminal setups. It introduces checks to prevent duplicate entries and provides user feedback via progress and success messages. - New Features: - Added Modus template blocks for Matugen (modus and hyprland) - Integrated progress and success messaging for template installation - Enhancements: - Updated Hyprland Lua path to an absolute location - Added validation for existing Matugen config file - Bug Fixes: - None --- install.sh | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index bbc0dbe..4dbfc8a 100755 --- a/install.sh +++ b/install.sh @@ -288,7 +288,7 @@ fi progress "Configuring Hyprland" HYPR_CONFIG="$HOME/.config/hypr/hyprland.lua" -MODUS_MODULE_LINE='require("modus")' +MODUS_MODULE_LINE='dofile("/home/sankalp/.config/Modus/config/hypr/modus.lua")' if [ -f "$HYPR_CONFIG" ]; then step "Checking Hyprland Lua configuration..." @@ -321,6 +321,47 @@ else info "No existing instance found" fi + +progress "Configuring Matugen" +MATUGEN_CONFIG="$HOME/.config/matugen/config.toml" + +MODUS_BLOCK='[templates.modus] +input_path = "~/.config/Modus/config/matugen/templates/modus.css" +output_path = "~/.config/Modus/src/shared/styles/colors.css" +post_hook = "fabric-cli exec modus '\''app.set_css()'\'' &"' + +HYPR_BLOCK='[templates.hyprland] +input_path = "~/.config/Modus/config/matugen/templates/hyprland-colors.lua" +output_path = "~/.config/Modus/config/matugen/colors.lua"' + +if [ -f "$MATUGEN_CONFIG" ]; then + step "Checking matugen config..." + + # ---- Modus1 ---- + if grep -qF "[templates.modus]" "$MATUGEN_CONFIG"; then + success "modus1 template already exists" + else + step "Adding modus1 template..." + echo "" >> "$MATUGEN_CONFIG" + echo "$MODUS_BLOCK" >> "$MATUGEN_CONFIG" + success "modus template added" + fi + + # ---- Hyprland ---- + if grep -qF "[templates.hyprland]" "$MATUGEN_CONFIG"; then + success "hyprland template already exists" + else + step "Adding hyprland template..." + echo "" >> "$MATUGEN_CONFIG" + echo "$HYPR_BLOCK" >> "$MATUGEN_CONFIG" + success "hyprland template added" + fi + +else + warn "matugen config not found at $MATUGEN_CONFIG" + info "Create it first or install matugen" +fi + step "Starting Modus..." if uwsm app -- uv run --project "$INSTALL_DIR" start >/dev/null 2>&1 & then disown