mirror of
https://github.com/tw93/Mole.git
synced 2026-02-16 19:20:16 +00:00
Optimize actual usage effect
This commit is contained in:
107
README.md
107
README.md
@@ -47,8 +47,8 @@ mo clean # System cleanup
|
|||||||
mo clean --dry-run # Preview mode
|
mo clean --dry-run # Preview mode
|
||||||
mo clean --whitelist # Manage protected caches
|
mo clean --whitelist # Manage protected caches
|
||||||
mo uninstall # Uninstall apps
|
mo uninstall # Uninstall apps
|
||||||
mo optimize # System optimization
|
|
||||||
mo analyze # Disk analyzer
|
mo analyze # Disk analyzer
|
||||||
|
mo optimize # System optimization
|
||||||
|
|
||||||
mo touchid # Configure Touch ID for sudo
|
mo touchid # Configure Touch ID for sudo
|
||||||
mo update # Update Mole
|
mo update # Update Mole
|
||||||
@@ -73,8 +73,7 @@ One command sets up Raycast + Alfred shortcuts for `mo clean` and `mo uninstall`
|
|||||||
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/integrations/setup-quick-launchers.sh | bash
|
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/integrations/setup-quick-launchers.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
Done! Raycast gets `clean` / `uninstall`, Alfred gets the same keywords.
|
Done! Use `mo` search to quickly find them. See [integrations/README.md](integrations/README.md) for details.
|
||||||
Details and manual options live in [integrations/README.md](integrations/README.md).
|
|
||||||
|
|
||||||
## Features in Detail
|
## Features in Detail
|
||||||
|
|
||||||
@@ -83,47 +82,17 @@ Details and manual options live in [integrations/README.md](integrations/README.
|
|||||||
```bash
|
```bash
|
||||||
$ mo clean
|
$ mo clean
|
||||||
|
|
||||||
▶ System essentials
|
Scanning cache directories...
|
||||||
✓ User app cache (45.2GB)
|
|
||||||
✓ User app logs (2.1GB)
|
|
||||||
✓ Trash (12.3GB)
|
|
||||||
|
|
||||||
▶ Browser cleanup
|
✓ User app cache 45.2GB
|
||||||
✓ Chrome cache (8.4GB)
|
✓ Browser cache (Chrome, Safari, Firefox) 10.5GB
|
||||||
✓ Safari cache (2.1GB)
|
✓ Developer tools (Xcode, Node.js, npm) 23.3GB
|
||||||
|
✓ System logs and temp files 3.8GB
|
||||||
▶ Developer tools
|
✓ App-specific cache (Spotify, Dropbox, Slack) 8.4GB
|
||||||
✓ Xcode derived data (9.1GB)
|
✓ Trash 12.3GB
|
||||||
✓ Node.js cache (14.2GB)
|
|
||||||
|
|
||||||
▶ Others
|
|
||||||
✓ Dropbox cache (5.2GB)
|
|
||||||
✓ Spotify cache (3.1GB)
|
|
||||||
|
|
||||||
====================================================================
|
====================================================================
|
||||||
CLEANUP COMPLETE!
|
Space freed: 95.5GB | Free space now: 223.5GB
|
||||||
Space freed: 95.50GB | Free space now: 223.5GB
|
|
||||||
====================================================================
|
|
||||||
```
|
|
||||||
|
|
||||||
### System Optimization
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ mo optimize
|
|
||||||
|
|
||||||
System: 5/32 GB RAM | 333/460 GB Disk (72%) | Uptime 6d
|
|
||||||
|
|
||||||
▶ System Maintenance - Rebuild system databases & flush caches
|
|
||||||
▶ Network Services - Reset network services
|
|
||||||
▶ Finder & Dock Refresh - Clear Finder/Dock caches and restart
|
|
||||||
▶ Diagnostics Cleanup - Purge old diagnostic & crash logs
|
|
||||||
▶ Mail Downloads - Recover Mail attachment space
|
|
||||||
▶ Memory & Swap - Purge swapfiles, restart dynamic pager
|
|
||||||
|
|
||||||
====================================================================
|
|
||||||
System optimization completed
|
|
||||||
Automations: 8 sections optimized end-to-end.
|
|
||||||
Highlights: caches refreshed, services restarted, startup assets rebuilt.
|
|
||||||
====================================================================
|
====================================================================
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -139,16 +108,14 @@ Select Apps to Remove
|
|||||||
☐ Final Cut Pro (3.8G) | Recent
|
☐ Final Cut Pro (3.8G) | Recent
|
||||||
|
|
||||||
Uninstalling: Adobe Creative Cloud
|
Uninstalling: Adobe Creative Cloud
|
||||||
✓ Removed application # /Applications/
|
|
||||||
✓ Cleaned 52 related files # ~/Library/ across 12 locations
|
✓ Removed application
|
||||||
- Support files & caches # Application Support, Caches
|
✓ Cleaned 52 related files across 12 locations
|
||||||
- Preferences & logs # Preferences, Logs
|
- Application Support, Caches, Preferences
|
||||||
- WebKit storage & cookies # WebKit, HTTPStorages
|
- Logs, WebKit storage, Cookies
|
||||||
- Extensions & plugins # Internet Plug-Ins, Services
|
- Extensions, Plugins, Launch daemons
|
||||||
- System files with sudo # /Library/, Launch daemons
|
|
||||||
|
|
||||||
====================================================================
|
====================================================================
|
||||||
UNINSTALLATION COMPLETE!
|
|
||||||
Space freed: 12.8GB
|
Space freed: 12.8GB
|
||||||
====================================================================
|
====================================================================
|
||||||
```
|
```
|
||||||
@@ -158,25 +125,35 @@ Space freed: 12.8GB
|
|||||||
```bash
|
```bash
|
||||||
$ mo analyze
|
$ mo analyze
|
||||||
|
|
||||||
Analyzing: /Users/You
|
Analyze Disk ~/Documents | Total: 156.8GB
|
||||||
═══════════════════════════════════════════════════════
|
|
||||||
Total: 156.8GB
|
|
||||||
|
|
||||||
├─ 📁 Library 45.2GB
|
▶ 1. ███████████████████ 48.2% | 📁 Library 75.4GB >6mo
|
||||||
│ ├─ 📁 Caches 28.4GB
|
2. ██████████░░░░░░░░░ 22.1% | 📁 Downloads 34.6GB
|
||||||
│ └─ 📁 Application Support 16.8GB
|
3. ████░░░░░░░░░░░░░░░ 14.3% | 📁 Movies 22.4GB
|
||||||
├─ 📁 Downloads 32.6GB
|
4. ███░░░░░░░░░░░░░░░░ 10.8% | 📁 Documents 16.9GB
|
||||||
│ ├─ 📄 Xcode-14.3.1.dmg 12.3GB
|
5. ██░░░░░░░░░░░░░░░░░ 5.2% | 📄 backup_2023.zip 8.2GB
|
||||||
│ ├─ 📄 backup_2023.zip 8.6GB
|
|
||||||
│ └─ 📄 old_projects.tar.gz 5.2GB
|
↑↓←→ Navigate | O Open | F Reveal | ⌫ Delete | L Large(24) | Q Quit
|
||||||
├─ 📁 Movies 28.9GB
|
|
||||||
│ ├─ 📄 vacation_2023.mov 15.4GB
|
|
||||||
│ └─ 📄 screencast_raw.mp4 8.8GB
|
|
||||||
├─ 📁 Documents 18.4GB
|
|
||||||
└─ 📁 Desktop 12.7GB
|
|
||||||
```
|
```
|
||||||
|
|
||||||
> The analyzer now runs inside a Go/Bubble Tea TUI: use arrow keys + Enter to drill into folders, Backspace to go up, `r` to refresh, and `q` to quit. Large files and occupancy bars refresh after each scan so you can see the heaviest items immediately.
|
### System Optimization
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ mo optimize
|
||||||
|
|
||||||
|
System: 5/32 GB RAM | 333/460 GB Disk (72%) | Uptime 6d
|
||||||
|
|
||||||
|
✓ Rebuild system databases and flush caches
|
||||||
|
✓ Reset network services
|
||||||
|
✓ Refresh Finder and Dock
|
||||||
|
✓ Clean diagnostic and crash logs
|
||||||
|
✓ Purge swap files and restart dynamic pager
|
||||||
|
✓ Rebuild launch services and spotlight index
|
||||||
|
|
||||||
|
====================================================================
|
||||||
|
System optimization completed
|
||||||
|
====================================================================
|
||||||
|
```
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
|
|||||||
44
mole
44
mole
@@ -455,14 +455,12 @@ show_main_menu() {
|
|||||||
|
|
||||||
printf '\r\033[2K%s\n' "$(show_menu_option 1 "Clean Mac - Remove junk files and optimize" "$([[ $selected -eq 1 ]] && echo true || echo false)")"
|
printf '\r\033[2K%s\n' "$(show_menu_option 1 "Clean Mac - Remove junk files and optimize" "$([[ $selected -eq 1 ]] && echo true || echo false)")"
|
||||||
printf '\r\033[2K%s\n' "$(show_menu_option 2 "Uninstall Apps - Remove applications completely" "$([[ $selected -eq 2 ]] && echo true || echo false)")"
|
printf '\r\033[2K%s\n' "$(show_menu_option 2 "Uninstall Apps - Remove applications completely" "$([[ $selected -eq 2 ]] && echo true || echo false)")"
|
||||||
printf '\r\033[2K%s\n' "$(show_menu_option 3 "Optimize Mac - System health & tuning" "$([[ $selected -eq 3 ]] && echo true || echo false)")"
|
printf '\r\033[2K%s\n' "$(show_menu_option 3 "Analyze Disk - Interactive space explorer" "$([[ $selected -eq 3 ]] && echo true || echo false)")"
|
||||||
printf '\r\033[2K%s\n' "$(show_menu_option 4 "Analyze Disk - Interactive space explorer" "$([[ $selected -eq 4 ]] && echo true || echo false)")"
|
printf '\r\033[2K%s\n' "$(show_menu_option 4 "Optimize Mac - System health & tuning" "$([[ $selected -eq 4 ]] && echo true || echo false)")"
|
||||||
printf '\r\033[2K%s\n' "$(show_menu_option 5 "Help & Information - Usage guide and tips" "$([[ $selected -eq 5 ]] && echo true || echo false)")"
|
|
||||||
printf '\r\033[2K%s\n' "$(show_menu_option 6 "Exit - Close Mole" "$([[ $selected -eq 6 ]] && echo true || echo false)")"
|
|
||||||
|
|
||||||
if [[ -t 0 ]]; then
|
if [[ -t 0 ]]; then
|
||||||
printf '\r\033[2K\n'
|
printf '\r\033[2K\n'
|
||||||
printf '\r\033[2K%s\n' " ${GRAY}↑/↓${NC} Navigate ${GRAY}|${NC} ${GRAY}Enter${NC} Select ${GRAY}|${NC} ${GRAY}Q/ESC${NC} Quit"
|
printf '\r\033[2K%s\n' " ${GRAY}↑/↓${NC} Navigate ${GRAY}|${NC} ${GRAY}Enter${NC} Select ${GRAY}|${NC} ${GRAY}H${NC} Help ${GRAY}|${NC} ${GRAY}ESC${NC} Quit"
|
||||||
printf '\r\033[2K\n'
|
printf '\r\033[2K\n'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -523,40 +521,30 @@ interactive_main_menu() {
|
|||||||
|
|
||||||
case "$key" in
|
case "$key" in
|
||||||
"UP") ((current_option > 1)) && ((current_option--)) ;;
|
"UP") ((current_option > 1)) && ((current_option--)) ;;
|
||||||
"DOWN") ((current_option < 6)) && ((current_option++)) ;;
|
"DOWN") ((current_option < 4)) && ((current_option++)) ;;
|
||||||
"ENTER" | "$current_option")
|
"ENTER" | "$current_option")
|
||||||
show_cursor
|
show_cursor
|
||||||
case $current_option in
|
case $current_option in
|
||||||
1)
|
1) exec "$SCRIPT_DIR/bin/clean.sh" ;;
|
||||||
exec "$SCRIPT_DIR/bin/clean.sh"
|
|
||||||
;;
|
|
||||||
2) exec "$SCRIPT_DIR/bin/uninstall.sh" ;;
|
2) exec "$SCRIPT_DIR/bin/uninstall.sh" ;;
|
||||||
3) exec "$SCRIPT_DIR/bin/optimize.sh" ;;
|
3) exec "$SCRIPT_DIR/bin/analyze.sh" ;;
|
||||||
4) exec "$SCRIPT_DIR/bin/analyze.sh" ;;
|
4) exec "$SCRIPT_DIR/bin/optimize.sh" ;;
|
||||||
5)
|
|
||||||
clear
|
|
||||||
show_help
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
6) cleanup_and_exit ;;
|
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
"QUIT") cleanup_and_exit ;;
|
"h" | "H")
|
||||||
[1-6])
|
|
||||||
show_cursor
|
show_cursor
|
||||||
case $key in
|
|
||||||
1)
|
|
||||||
exec "$SCRIPT_DIR/bin/clean.sh"
|
|
||||||
;;
|
|
||||||
2) exec "$SCRIPT_DIR/bin/uninstall.sh" ;;
|
|
||||||
3) exec "$SCRIPT_DIR/bin/optimize.sh" ;;
|
|
||||||
4) exec "$SCRIPT_DIR/bin/analyze.sh" ;;
|
|
||||||
5)
|
|
||||||
clear
|
clear
|
||||||
show_help
|
show_help
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
6) cleanup_and_exit ;;
|
"QUIT") cleanup_and_exit ;;
|
||||||
|
[1-4])
|
||||||
|
show_cursor
|
||||||
|
case $key in
|
||||||
|
1) exec "$SCRIPT_DIR/bin/clean.sh" ;;
|
||||||
|
2) exec "$SCRIPT_DIR/bin/uninstall.sh" ;;
|
||||||
|
3) exec "$SCRIPT_DIR/bin/analyze.sh" ;;
|
||||||
|
4) exec "$SCRIPT_DIR/bin/optimize.sh" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user