Files
Nomarchy/themes/engine/scripts/nomarchy-theme-remove
Bernardo Magri bbdf34ced8 refactor: implement component-based architecture for enhanced maintainability
- Reorganize directory structure into core/, features/, and themes/
- Colocate application Nix logic, configs, scripts, and theme overrides
- Implement 'Inversion of Control' for theming: apps now pull theme-specific layouts
- Update flake.nix and shared library paths to match the new structure
- Document the new Feature-Centric architecture in README.md
2026-04-12 14:51:15 +01:00

36 lines
899 B
Bash
Executable File

#!/bin/bash
# nomarchy-theme-remove: Remove a theme from Nomarchy by name
# Usage: nomarchy-theme-remove <theme-name>
if [[ -z $1 ]]; then
mapfile -t extra_themes < <(find ~/.config/nomarchy/themes -mindepth 1 -maxdepth 1 -type d ! -xtype l -printf '%f\n')
if (( ${#extra_themes[@]} > 0 )); then
THEME_NAME=$(printf '%s\n' "${extra_themes[@]}" | sort | gum choose --header="Remove extra theme")
else
echo "No extra themes installed."
exit 1
fi
else
THEME_NAME="$1"
fi
THEMES_DIR="$HOME/.config/nomarchy/themes"
CURRENT_DIR="$HOME/.config/nomarchy/current"
THEME_PATH="$THEMES_DIR/$THEME_NAME"
# Ensure a theme was set
if [[ -z $THEME_NAME ]]; then
exit 1
fi
# Check if theme exists before attempting removal
if [[ ! -d $THEME_PATH ]]; then
echo "Error: Theme '$THEME_NAME' not found."
exit 1
fi
# Now remove the theme directory for THEME_NAME
rm -rf "$THEME_PATH"