1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-14 22:15:09 +00:00

Simplified words

This commit is contained in:
Tw93
2025-11-22 14:00:27 +08:00
parent 42b19569fd
commit 198077de76
5 changed files with 38 additions and 38 deletions

View File

@@ -19,10 +19,10 @@
## Features ## Features
1. All-in-one toolkit equal to CleanMyMac + AppCleaner + DaisyDisk + Sensei + iStat in one trusted binary. 1. All-in-one toolkit equal to CleanMyMac + AppCleaner + DaisyDisk + Sensei + iStat in one trusted binary.
2. Deep cleanup digs through caches, temp files, browser leftovers, and junk to reclaim tens of gigabytes. 2. Deep cleanup finds and removes caches, temp files, browser leftovers, and junk to free up tens of gigabytes.
3. Smart uninstall hunts down app bundles plus launch agents, preference panes, caches, logs, and debris. 3. Smart uninstall finds app bundles plus launch agents, settings, caches, logs, and leftover files.
4. Disk insight + optimization reveal storage hogs, visualize folders, rebuild caches, trim swap, refresh services. 4. Disk insight + optimization show large files, display folders, rebuild caches, clean swap, refresh services.
5. Live status surfaces CPU, GPU, memory, disk, network, battery, and proxy telemetry so you spot bottlenecks. 5. Live status shows CPU, GPU, memory, disk, network, battery, and proxy data so you can find problems.
## Quick Start ## Quick Start
@@ -60,8 +60,8 @@ mo --version # Show installed version
## Tips ## Tips
- Safety first, if your Mac is mission-critical, wait for Mole to mature before full cleanups. - Safety first, if your Mac is very important, wait for Mole to become stable before full cleanups.
- Preview the cleanup by running `mo clean --dry-run` and reviewing the generated list. - Preview the cleanup by running `mo clean --dry-run` and reviewing the list.
- Use `mo clean --whitelist` to manage protected caches. - Use `mo clean --whitelist` to manage protected caches.
- Use `mo touchid` to approve sudo with Touch ID instead of typing your password. - Use `mo touchid` to approve sudo with Touch ID instead of typing your password.
@@ -117,11 +117,11 @@ $ mo optimize
System: 5/32 GB RAM | 333/460 GB Disk (72%) | Uptime 6d System: 5/32 GB RAM | 333/460 GB Disk (72%) | Uptime 6d
✓ Rebuild system databases and flush caches ✓ Rebuild system databases and clear caches
✓ Reset network services ✓ Reset network services
✓ Refresh Finder and Dock ✓ Refresh Finder and Dock
✓ Clean diagnostic and crash logs ✓ Clean diagnostic and crash logs
Purge swap files and restart dynamic pager Remove swap files and restart dynamic pager
✓ Rebuild launch services and spotlight index ✓ Rebuild launch services and spotlight index
==================================================================== ====================================================================
@@ -142,7 +142,7 @@ Analyze Disk ~/Documents | Total: 156.8GB
4. ███░░░░░░░░░░░░░░░░ 10.8% | 📁 Documents 16.9GB 4. ███░░░░░░░░░░░░░░░░ 10.8% | 📁 Documents 16.9GB
5. ██░░░░░░░░░░░░░░░░░ 5.2% | 📄 backup_2023.zip 8.2GB 5. ██░░░░░░░░░░░░░░░░░ 5.2% | 📄 backup_2023.zip 8.2GB
↑↓←→ Navigate | O Open | F Reveal | ⌫ Delete | L Large(24) | Q Quit ↑↓←→ Navigate | O Open | F Show | ⌫ Delete | L Large(24) | Q Quit
``` ```
### Live System Status ### Live System Status
@@ -182,7 +182,7 @@ Launch Mole commands instantly from Raycast or Alfred:
curl -fsSL https://raw.githubusercontent.com/tw93/Mole/main/scripts/setup-quick-launchers.sh | bash curl -fsSL https://raw.githubusercontent.com/tw93/Mole/main/scripts/setup-quick-launchers.sh | bash
``` ```
Adds 5 commands: `clean`, `uninstall`, `optimize`, `analyze`, `status`. Auto-detects your terminal or set `MO_LAUNCHER_APP=<name>` to override. Adds 5 commands: `clean`, `uninstall`, `optimize`, `analyze`, `status`. Finds your terminal automatically or set `MO_LAUNCHER_APP=<name>` to override.
Reload Raycast by running `Reload Script Directories`, or simply restarting Raycast. Reload Raycast by running `Reload Script Directories`, or simply restarting Raycast.
@@ -190,8 +190,8 @@ Reload Raycast by running `Reload Script Directories`, or simply restarting Rayc
<a href="https://miaoyan.app/cats.html?name=Mole"><img src="https://miaoyan.app/assets/sponsors.svg" width="1000px" /></a> <a href="https://miaoyan.app/cats.html?name=Mole"><img src="https://miaoyan.app/assets/sponsors.svg" width="1000px" /></a>
- If Mole reclaimed storage for you, consider starring the repo or sharing it with friends needing a cleaner Mac. - If Mole freed storage for you, consider starring the repo or sharing it with friends needing a cleaner Mac.
- Have ideas or fixes? Open an issue or PR and help shape Mole's roadmap together with the community. - Have ideas or fixes? Open an issue or PR and help shape Mole's future together with the community.
- Love cats? Treat Tangyuan and Cola to canned food via <a href="https://miaoyan.app/cats.html?name=Mole" target="_blank">this link</a> and keep the mascots purring. - Love cats? Treat Tangyuan and Cola to canned food via <a href="https://miaoyan.app/cats.html?name=Mole" target="_blank">this link</a> and keep the mascots purring.
## License ## License

View File

@@ -221,7 +221,7 @@ start_section() {
end_section() { end_section() {
if [[ $TRACK_SECTION -eq 1 && $SECTION_ACTIVITY -eq 0 ]]; then if [[ $TRACK_SECTION -eq 1 && $SECTION_ACTIVITY -eq 0 ]]; then
echo -e " ${GREEN}${ICON_SUCCESS}${NC} Nothing to tidy" echo -e " ${GREEN}${ICON_SUCCESS}${NC} Nothing to clean"
fi fi
TRACK_SECTION=0 TRACK_SECTION=0
} }
@@ -1240,7 +1240,7 @@ perform_cleanup() {
end_section end_section
# ===== 10. Virtualization tools ===== # ===== 10. Virtualization tools =====
start_section "Virtualization tools" start_section "Virtual machine tools"
safe_clean ~/Library/Caches/com.vmware.fusion "VMware Fusion cache" safe_clean ~/Library/Caches/com.vmware.fusion "VMware Fusion cache"
safe_clean ~/Library/Caches/com.parallels.* "Parallels cache" safe_clean ~/Library/Caches/com.parallels.* "Parallels cache"
safe_clean ~/VirtualBox\ VMs/.cache "VirtualBox cache" safe_clean ~/VirtualBox\ VMs/.cache "VirtualBox cache"
@@ -1279,7 +1279,7 @@ perform_cleanup() {
# ===== 12. Orphaned app data cleanup ===== # ===== 12. Orphaned app data cleanup =====
# Only touch apps missing from scan + 60+ days inactive # Only touch apps missing from scan + 60+ days inactive
# Skip protected vendors, keep Preferences/Application Support # Skip protected vendors, keep Preferences/Application Support
start_section "Orphaned app data" start_section "Leftover app data"
local -r ORPHAN_AGE_THRESHOLD=60 # 60 days - good balance between safety and cleanup local -r ORPHAN_AGE_THRESHOLD=60 # 60 days - good balance between safety and cleanup
@@ -1419,14 +1419,14 @@ perform_cleanup() {
done done
stop_inline_spinner stop_inline_spinner
echo -e " ${GREEN}${ICON_SUCCESS}${NC} Found $orphaned_count orphaned app resources" echo -e " ${GREEN}${ICON_SUCCESS}${NC} Found $orphaned_count leftover app files"
if [[ $orphaned_count -gt 0 ]]; then if [[ $orphaned_count -gt 0 ]]; then
local orphaned_mb=$(echo "$total_orphaned_kb" | awk '{printf "%.1f", $1/1024}') local orphaned_mb=$(echo "$total_orphaned_kb" | awk '{printf "%.1f", $1/1024}')
echo " ${GREEN}${ICON_SUCCESS}${NC} Cleaned $orphaned_count orphaned items (~${orphaned_mb}MB)" echo " ${GREEN}${ICON_SUCCESS}${NC} Cleaned $orphaned_count leftover items (~${orphaned_mb}MB)"
note_activity note_activity
else else
echo " ${GREEN}${ICON_SUCCESS}${NC} No orphaned app data found" echo " ${GREEN}${ICON_SUCCESS}${NC} No leftover app data found"
fi fi
rm -f "$installed_bundles" rm -f "$installed_bundles"
@@ -1435,7 +1435,7 @@ perform_cleanup() {
# ===== 13. Apple Silicon optimizations ===== # ===== 13. Apple Silicon optimizations =====
if [[ "$IS_M_SERIES" == "true" ]]; then if [[ "$IS_M_SERIES" == "true" ]]; then
start_section "Apple Silicon optimizations" start_section "Apple Silicon updates"
safe_clean /Library/Apple/usr/share/rosetta/rosetta_update_bundle "Rosetta 2 cache" safe_clean /Library/Apple/usr/share/rosetta/rosetta_update_bundle "Rosetta 2 cache"
safe_clean ~/Library/Caches/com.apple.rosetta.update "Rosetta 2 user cache" safe_clean ~/Library/Caches/com.apple.rosetta.update "Rosetta 2 user cache"
safe_clean ~/Library/Caches/com.apple.amp.mediasevicesd "Apple Silicon media service cache" safe_clean ~/Library/Caches/com.apple.amp.mediasevicesd "Apple Silicon media service cache"

View File

@@ -174,18 +174,18 @@ execute_optimization() {
timeout 10 /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user > /dev/null 2>&1 || true timeout 10 /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user > /dev/null 2>&1 || true
echo -e "${GREEN}${ICON_SUCCESS}${NC} LaunchServices database rebuilt" echo -e "${GREEN}${ICON_SUCCESS}${NC} LaunchServices database rebuilt"
echo -e "${BLUE}${ICON_ARROW}${NC} Flushing DNS cache..." echo -e "${BLUE}${ICON_ARROW}${NC} Clearing DNS cache..."
if sudo dscacheutil -flushcache 2> /dev/null && sudo killall -HUP mDNSResponder 2> /dev/null; then if sudo dscacheutil -flushcache 2> /dev/null && sudo killall -HUP mDNSResponder 2> /dev/null; then
echo -e "${GREEN}${ICON_SUCCESS}${NC} DNS cache flushed" echo -e "${GREEN}${ICON_SUCCESS}${NC} DNS cache cleared"
else else
echo -e "${RED}${ICON_ERROR}${NC} Failed to flush DNS cache" echo -e "${RED}${ICON_ERROR}${NC} Failed to clear DNS cache"
fi fi
echo -e "${BLUE}${ICON_ARROW}${NC} Purging memory cache..." echo -e "${BLUE}${ICON_ARROW}${NC} Clearing memory cache..."
if sudo purge 2> /dev/null; then if sudo purge 2> /dev/null; then
echo -e "${GREEN}${ICON_SUCCESS}${NC} Memory cache purged" echo -e "${GREEN}${ICON_SUCCESS}${NC} Memory cache cleared"
else else
echo -e "${RED}${ICON_ERROR}${NC} Failed to purge memory" echo -e "${RED}${ICON_ERROR}${NC} Failed to clear memory"
fi fi
echo -e "${BLUE}${ICON_ARROW}${NC} Rebuilding font cache..." echo -e "${BLUE}${ICON_ARROW}${NC} Rebuilding font cache..."
@@ -215,7 +215,7 @@ execute_optimization() {
cleanup_path "$target_path" "$label" cleanup_path "$target_path" "$label"
done done
echo -e "${GREEN}${ICON_SUCCESS}${NC} Finder and Safari caches refreshed" echo -e "${GREEN}${ICON_SUCCESS}${NC} Finder and Safari caches updated"
;; ;;
maintenance_scripts) maintenance_scripts)
@@ -231,9 +231,9 @@ execute_optimization() {
fi fi
fi fi
echo -e "${BLUE}${ICON_ARROW}${NC} Rotating system logs..." echo -e "${BLUE}${ICON_ARROW}${NC} Moving old system logs..."
if sudo newsyslog > /dev/null 2>&1; then if sudo newsyslog > /dev/null 2>&1; then
echo -e "${GREEN}${ICON_SUCCESS}${NC} Log rotation complete" echo -e "${GREEN}${ICON_SUCCESS}${NC} Log move complete"
else else
echo -e "${YELLOW}!${NC} newsyslog reported an issue" echo -e "${YELLOW}!${NC} newsyslog reported an issue"
fi fi
@@ -295,7 +295,7 @@ execute_optimization() {
sudo rm -f /Library/Preferences/com.apple.Bluetooth.plist 2> /dev/null || true sudo rm -f /Library/Preferences/com.apple.Bluetooth.plist 2> /dev/null || true
echo -e " ${GREEN}${ICON_SUCCESS}${NC} Bluetooth caches refreshed" echo -e " ${GREEN}${ICON_SUCCESS}${NC} Bluetooth caches refreshed"
echo -e "${BLUE}${ICON_ARROW}${NC} Resetting Wi-Fi configuration..." echo -e "${BLUE}${ICON_ARROW}${NC} Resetting Wi-Fi settings..."
local sysconfig="/Library/Preferences/SystemConfiguration" local sysconfig="/Library/Preferences/SystemConfiguration"
if [[ -d "$sysconfig" ]]; then if [[ -d "$sysconfig" ]]; then
sudo cp "$sysconfig"/com.apple.airport.preferences.plist "$sysconfig"/com.apple.airport.preferences.plist.bak 2> /dev/null || true sudo cp "$sysconfig"/com.apple.airport.preferences.plist "$sysconfig"/com.apple.airport.preferences.plist.bak 2> /dev/null || true
@@ -325,7 +325,7 @@ execute_optimization() {
;; ;;
saved_state_cleanup) saved_state_cleanup)
echo -e "${BLUE}${ICON_ARROW}${NC} Purging saved application states..." echo -e "${BLUE}${ICON_ARROW}${NC} Removing saved application states..."
local state_dir="$HOME/Library/Saved Application State" local state_dir="$HOME/Library/Saved Application State"
cleanup_path "$state_dir" "Saved Application State" cleanup_path "$state_dir" "Saved Application State"
ensure_directory "$state_dir" ensure_directory "$state_dir"

View File

@@ -181,7 +181,7 @@ func newModel(path string, isOverview bool) model {
m.offset = 0 m.offset = 0
if nextPendingOverviewIndex(m.entries) >= 0 { if nextPendingOverviewIndex(m.entries) >= 0 {
m.overviewScanning = true m.overviewScanning = true
m.status = "Estimating system roots..." m.status = "Checking system folders..."
} else { } else {
m.status = "Ready" m.status = "Ready"
} }
@@ -669,7 +669,7 @@ func (m model) updateKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
defer cancel() defer cancel()
_ = exec.CommandContext(ctx, "open", "-R", path).Run() _ = exec.CommandContext(ctx, "open", "-R", path).Run()
}(selected.Path) }(selected.Path)
m.status = fmt.Sprintf("Revealing %s in Finder...", selected.Name) m.status = fmt.Sprintf("Showing %s in Finder...", selected.Name)
} }
} else if len(m.entries) > 0 { } else if len(m.entries) > 0 {
selected := m.entries[m.selected] selected := m.entries[m.selected]
@@ -678,7 +678,7 @@ func (m model) updateKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
defer cancel() defer cancel()
_ = exec.CommandContext(ctx, "open", "-R", path).Run() _ = exec.CommandContext(ctx, "open", "-R", path).Run()
}(selected.Path) }(selected.Path)
m.status = fmt.Sprintf("Revealing %s in Finder...", selected.Name) m.status = fmt.Sprintf("Showing %s in Finder...", selected.Name)
} }
case "delete", "backspace": case "delete", "backspace":
// Delete selected file or directory // Delete selected file or directory
@@ -1078,15 +1078,15 @@ func (m model) View() string {
fmt.Fprintln(&b) fmt.Fprintln(&b)
if m.inOverviewMode() { if m.inOverviewMode() {
fmt.Fprintf(&b, "%s↑↓→ | Enter | O Open | F Reveal | Q Quit%s\n", colorGray, colorReset) fmt.Fprintf(&b, "%s↑↓→ | Enter | O Open | F Show | Q Quit%s\n", colorGray, colorReset)
} else if m.showLargeFiles { } else if m.showLargeFiles {
fmt.Fprintf(&b, "%s↑↓ | O Open | F Reveal | ⌫ Delete | L Back | Q Quit%s\n", colorGray, colorReset) fmt.Fprintf(&b, "%s↑↓ | O Open | F Show | ⌫ Delete | L Back | Q Quit%s\n", colorGray, colorReset)
} else { } else {
largeFileCount := len(m.largeFiles) largeFileCount := len(m.largeFiles)
if largeFileCount > 0 { if largeFileCount > 0 {
fmt.Fprintf(&b, "%s↑↓←→ | Enter | O Open | F Reveal | ⌫ Delete | L Large(%d) | Q Quit%s\n", colorGray, largeFileCount, colorReset) fmt.Fprintf(&b, "%s↑↓←→ | Enter | O Open | F Show | ⌫ Delete | L Large(%d) | Q Quit%s\n", colorGray, largeFileCount, colorReset)
} else { } else {
fmt.Fprintf(&b, "%s↑↓←→ | Enter | O Open | F Reveal | ⌫ Delete | Q Quit%s\n", colorGray, colorReset) fmt.Fprintf(&b, "%s↑↓←→ | Enter | O Open | F Show | ⌫ Delete | Q Quit%s\n", colorGray, colorReset)
} }
} }
if m.deleteConfirm && m.deleteTarget != nil { if m.deleteConfirm && m.deleteTarget != nil {

2
mole
View File

@@ -22,7 +22,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/lib/common.sh" source "$SCRIPT_DIR/lib/common.sh"
# Version info # Version info
VERSION="1.10.2" VERSION="1.10.3"
MOLE_TAGLINE="can dig deep to clean your Mac." MOLE_TAGLINE="can dig deep to clean your Mac."
# Check if Touch ID is already configured # Check if Touch ID is already configured