feat(root): add Modugen template configuration to install script

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
This commit is contained in:
sankalp committed 2026-05-14 15:20:46 +05:45
1 parent 6a23002738
commit 60c63308db
1 file changed
+42 -1
+42 -1
View File
@@ -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