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

feat: add new system optimization tasks and implement orphaned startup item cleanup

This commit is contained in:
Tw93
2025-12-29 19:06:04 +08:00
parent 7af6b39875
commit 44e91be007
9 changed files with 682 additions and 185 deletions

View File

@@ -122,12 +122,22 @@ EOF
# Collect all optimization items
local -a items=()
# Always-on items (no size checks - instant)
items+=('system_maintenance|System Database Maintenance|Rebuild LaunchServices, refresh DNS & verify Spotlight|true')
items+=('cache_refresh|Finder & Safari Cache Refresh|Refresh QuickLook, icon services & Safari caches|true')
items+=('maintenance_scripts|System Log Rotation|Rotate and compress system logs with newsyslog|true')
items+=('swap_cleanup|Virtual Memory Refresh|Reset swap files and dynamic pager service|true')
items+=('network_optimization|Network Stack Optimization|Refresh DNS, rebuild ARP & restart mDNSResponder|true')
# Core optimizations (safe and valuable)
items+=('system_maintenance|DNS & Spotlight Check|Refresh DNS cache & verify Spotlight status|true')
items+=('cache_refresh|Finder Cache Refresh|Refresh QuickLook thumbnails & icon services cache|true')
items+=('saved_state_cleanup|App State Cleanup|Remove old saved application states (7+ days)|true')
items+=('fix_broken_configs|Broken Config Repair|Fix corrupted preferences files|true')
items+=('network_optimization|Network Cache Refresh|Optimize DNS cache & restart mDNSResponder|true')
# Advanced optimizations (high value, auto-run with safety checks)
items+=('sqlite_vacuum|Database Optimization|Compress SQLite databases for Mail, Safari & Messages (skips if apps are running)|true')
items+=('launch_services_rebuild|LaunchServices Repair|Repair "Open with" menu & file associations|true')
items+=('font_cache_rebuild|Font Cache Rebuild|Rebuild font database to fix rendering issues|true')
items+=('startup_items_cleanup|Startup Items Cleanup|Remove broken login items & optimize boot time|true')
items+=('dyld_cache_update|App Launch Optimization|Rebuild dyld cache to speed up app launches|true')
items+=('system_services_refresh|System Services Refresh|Restart system services to apply optimization changes|true')
items+=('dock_refresh|Dock Refresh|Fix broken icons and visual glitches in the Dock|true')
# Output items as JSON
local first=true
for item in "${items[@]}"; do