refactor: consolidate app configurations and utility scripts
- Move 32+ app-specific scripts from features/apps/scripts/ to features/scripts/utils/ for centralized packaging. - Create individual Nix modules for orphaned app configurations (btop, kitty, tmux, etc.) in features/apps/ using xdg.configFile. - Fix broken paths in core/system/makima.nix and features/apps/vscode.nix. - Update VSCode configuration to use the modern 'profiles.default.userSettings' API, resolving deprecation warnings. - Merge duplicate 'nomarchy-launch-walker' scripts into a single robust utility. - Remove stale root 'config/' directory. - Update README.md and docs/creating-themes.md to reflect the new architecture and keybindings. - Ensure all modules are correctly imported and verified via nix flake check.
This commit is contained in:
43
features/scripts/utils/nomarchy-tui-remove
Executable file
43
features/scripts/utils/nomarchy-tui-remove
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
DESKTOP_DIR="$HOME/.local/share/applications/"
|
||||
|
||||
if (( $# == 0 )); then
|
||||
# Find all TUIs
|
||||
while IFS= read -r -d '' file; do
|
||||
if grep -qE '^Exec=.*(\$TERMINAL|xdg-terminal-exec).*-e' "$file"; then
|
||||
TUIS+=("$(basename "${file%.desktop}")")
|
||||
fi
|
||||
done < <(find "$DESKTOP_DIR" -name '*.desktop' -print0)
|
||||
|
||||
if ((${#TUIS[@]})); then
|
||||
IFS=$'\n' SORTED_TUIS=($(sort <<<"${TUIS[*]}"))
|
||||
unset IFS
|
||||
APP_NAMES_STRING=$(gum choose --no-limit --header "Select TUI to remove..." --selected-prefix="✗ " "${SORTED_TUIS[@]}")
|
||||
# Convert newline-separated string to array
|
||||
APP_NAMES=()
|
||||
while IFS= read -r line; do
|
||||
[[ -n $line ]] && APP_NAMES+=("$line")
|
||||
done <<< "$APP_NAMES_STRING"
|
||||
else
|
||||
echo "No TUIs to remove."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# Use array to preserve spaces in app names
|
||||
APP_NAMES=("$@")
|
||||
fi
|
||||
|
||||
if (( ${#APP_NAMES[@]} == 0 )); then
|
||||
echo "You must provide TUI names."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for APP_NAME in "${APP_NAMES[@]}"; do
|
||||
rm -f "$DESKTOP_DIR/$APP_NAME.desktop"
|
||||
rm -f "$ICON_DIR/$APP_NAME.png"
|
||||
echo "Removed $APP_NAME"
|
||||
done
|
||||
Reference in New Issue
Block a user