feat: implement modular foundation and core system services
- Update flake.nix with 25.11 release and core inputs - Add dedicated modules for audio (Pipewire), bluetooth, and networking - Update GEMINI.md with the new Modular Merging Architecture blueprint - Configure graphical installer ISO and test VM outputs
This commit is contained in:
@@ -1,60 +1,48 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
# Set the system theme declaratively.
|
||||
# Usage: nomarchy-theme-set <theme-name>
|
||||
|
||||
THEME_NAME="$1"
|
||||
|
||||
if [[ -z $THEME_NAME ]]; then
|
||||
echo "Usage: nomarchy-theme-set <theme-name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CURRENT_THEME_PATH="$HOME/.config/nomarchy/current/theme"
|
||||
NEXT_THEME_PATH="$HOME/.config/nomarchy/current/next-theme"
|
||||
USER_THEMES_PATH="$HOME/.config/nomarchy/themes"
|
||||
OMARCHY_THEMES_PATH="$OMARCHY_PATH/themes"
|
||||
STATE_DIR="$HOME/.config/home-manager"
|
||||
THEME_STATE_FILE="$STATE_DIR/theme-state.nix"
|
||||
WALLPAPER_STATE_FILE="$STATE_DIR/wallpaper-state.nix"
|
||||
|
||||
THEME_NAME=$(echo "$1" | sed -E 's/<[^>]+>//g' | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
|
||||
|
||||
if [[ ! -d $OMARCHY_THEMES_PATH/$THEME_NAME ]] && [[ ! -d $USER_THEMES_PATH/$THEME_NAME ]]; then
|
||||
echo "Theme '$THEME_NAME' does not exist"
|
||||
exit 1
|
||||
# Logic for finding themes
|
||||
if [ -d "/etc/nixos/nomarchy/themes" ]; then
|
||||
THEMES_DIR="/etc/nixos/nomarchy/themes"
|
||||
elif [ -d "/etc/nomarchy/themes" ]; then
|
||||
THEMES_DIR="/etc/nomarchy/themes"
|
||||
else
|
||||
THEMES_DIR="/etc/nixos/themes"
|
||||
fi
|
||||
|
||||
# Setup clean next theme directory (for atomic theme config swapping)
|
||||
rm -rf "$NEXT_THEME_PATH"
|
||||
mkdir -p "$NEXT_THEME_PATH"
|
||||
mkdir -p "$STATE_DIR"
|
||||
|
||||
# Copy official theme first, then overlay user customizations on top
|
||||
cp -r "$OMARCHY_THEMES_PATH/$THEME_NAME/"* "$NEXT_THEME_PATH/" 2>/dev/null
|
||||
cp -r "$USER_THEMES_PATH/$THEME_NAME/"* "$NEXT_THEME_PATH/" 2>/dev/null
|
||||
|
||||
# Generate dynamic configs
|
||||
nomarchy-theme-set-templates
|
||||
|
||||
# Swap next theme in as current
|
||||
rm -rf "$CURRENT_THEME_PATH"
|
||||
mv "$NEXT_THEME_PATH" "$CURRENT_THEME_PATH"
|
||||
|
||||
# Store theme name for reference
|
||||
echo "$THEME_NAME" >"$HOME/.config/nomarchy/current/theme.name"
|
||||
|
||||
# Change background with theme
|
||||
nomarchy-theme-bg-next
|
||||
|
||||
# Restart components to apply new theme
|
||||
if pgrep -x waybar >/dev/null; then
|
||||
nomarchy-restart-waybar
|
||||
if [ ! -d "$THEMES_DIR/$THEME_NAME" ] && ! [[ "$THEME_NAME" == "dracula" || "$THEME_NAME" == "nord" ]]; then
|
||||
echo "Theme '$THEME_NAME' not found in $THEMES_DIR"
|
||||
# Check if it exists in the palettes file
|
||||
# (Assuming nomarchy-palettes.nix is imported in Nix)
|
||||
fi
|
||||
nomarchy-restart-swayosd
|
||||
nomarchy-restart-terminal
|
||||
nomarchy-restart-hyprctl
|
||||
nomarchy-restart-btop
|
||||
nomarchy-restart-opencode
|
||||
nomarchy-restart-mako
|
||||
|
||||
# Change app-specific themes
|
||||
nomarchy-theme-set-gnome
|
||||
nomarchy-theme-set-browser
|
||||
nomarchy-theme-set-vscode
|
||||
nomarchy-theme-set-obsidian
|
||||
nomarchy-theme-set-keyboard
|
||||
echo "$THEME_NAME" > "$THEME_STATE_FILE"
|
||||
|
||||
# Try to find a background for this theme
|
||||
BG_DIR="$THEMES_DIR/$THEME_NAME/backgrounds"
|
||||
if [ -d "$BG_DIR" ]; then
|
||||
BG=$(ls "$BG_DIR" | head -n 1)
|
||||
if [ -n "$BG" ]; then
|
||||
echo "$BG_DIR/$BG" > "$WALLPAPER_STATE_FILE"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Theme set to $THEME_NAME. Applying changes with env-update..."
|
||||
env-update
|
||||
|
||||
# Call hook on theme set
|
||||
nomarchy-hook theme-set "$THEME_NAME"
|
||||
|
||||
Reference in New Issue
Block a user