1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-06 13:42:57 +00:00

I don't like emojis anymore

This commit is contained in:
Tw93
2025-10-08 23:21:52 +08:00
parent 1657ff584b
commit 6c60c0f01b
8 changed files with 42 additions and 41 deletions

View File

@@ -42,7 +42,7 @@ select_apps_for_uninstall() {
# Use paginated menu - result will be stored in MOLE_SELECTION_RESULT
MOLE_SELECTION_RESULT=""
paginated_multi_select "🗑️ Select Apps to Remove" "${menu_options[@]}"
paginated_multi_select "Select Apps to Remove" "${menu_options[@]}"
local exit_code=$?
if [[ $exit_code -ne 0 ]]; then
@@ -76,4 +76,4 @@ select_apps_for_uninstall() {
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
echo "This is a library file. Source it from other scripts." >&2
exit 1
fi
fi

View File

@@ -63,13 +63,15 @@ batch_uninstall_applications() {
if sudo -n true 2>/dev/null; then
echo "◎ Admin access confirmed for: ${sudo_apps[*]}"
else
echo -n "◎ Admin required for: ${sudo_apps[*]}. "
if ! sudo -v; then
echo "◎ Admin required for: ${sudo_apps[*]}"
echo ""
if ! request_sudo_access "Uninstalling system apps requires admin access"; then
echo ""
log_error "Admin access denied"
return 1
fi
echo "✓ Granted"
echo ""
echo "✓ Admin access granted"
fi
echo "◎ Gathering targets..."
(while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null) &
@@ -145,7 +147,7 @@ batch_uninstall_applications() {
printf " ${GREEN}OK${NC} %-20s%s\n" "$app_name" $([[ $files_removed -gt 0 ]] && echo "+$files_removed" )
else
((failed_count++))
failed_items+=("$app_name:$reason")
failed_items+=("$app_name:$reason")
fi
done
@@ -165,17 +167,17 @@ batch_uninstall_applications() {
echo ""
echo "$bar"
if [[ $failed_count -gt 0 ]]; then
echo -e "🚀 Removed: ${GREEN}$success_count${NC} | Failed: ${RED}$failed_count${NC} | Freed: ${GREEN}$freed_display${NC}"
echo -e "Removed: ${GREEN}$success_count${NC} | Failed: ${RED}$failed_count${NC} | Freed: ${GREEN}$freed_display${NC}"
if [[ $failed_count -eq 1 ]]; then
local first="${failed_items[0]}"
local name=${first%%:*}
local reason=${first#*:}
echo "😉 ${name} $(map_uninstall_reason "$reason")"
echo "${name} $(map_uninstall_reason "$reason")"
else
local joined="${failed_items[*]}"; echo "😉 Failures: $joined"
local joined="${failed_items[*]}"; echo "Failures: $joined"
fi
else
echo -e "🚀 Removed: ${GREEN}$success_count${NC} | Failed: ${RED}$failed_count${NC} | Freed: ${GREEN}$freed_display${NC}"
echo -e "Removed: ${GREEN}$success_count${NC} | Failed: ${RED}$failed_count${NC} | Freed: ${GREEN}$freed_display${NC}"
fi
echo "$bar"

View File

@@ -50,8 +50,8 @@ paginated_multi_select() {
restore_terminal() {
show_cursor
if [[ -n "$original_stty" ]]; then
stty "$original_stty" 2>/dev/null || stty sane 2>/dev/null || stty echo icanon 2>/dev/null || true
if [[ -n "${original_stty-}" ]]; then
stty "${original_stty}" 2>/dev/null || stty sane 2>/dev/null || stty echo icanon 2>/dev/null || true
else
stty sane 2>/dev/null || stty echo icanon 2>/dev/null || true
fi

View File

@@ -255,7 +255,7 @@ get_description_for_pattern() {
manage_whitelist() {
clear
echo ""
echo -e "${PURPLE}📋 Whitelist Manager${NC}"
echo -e "${PURPLE}Whitelist Manager${NC}"
echo ""
# Load user-defined whitelist