mirror of
https://github.com/tw93/Mole.git
synced 2026-02-06 20:05:37 +00:00
feat: add system maintenance cleanup module
- Add broken preferences detection using plutil -lint validation - Add broken login items cleanup (LaunchAgents pointing to missing files) - Add universal binary slimming (opt-in via MOLE_SLIM_BINARIES=true) - Protect Spotify cache if >500MB (likely contains offline music) - Warn when browsers are running before cache cleanup - All cleanup stats properly counted in final summary
This commit is contained in:
29
lib/clean_user_data.sh
Normal file → Executable file
29
lib/clean_user_data.sh
Normal file → Executable file
@@ -100,7 +100,36 @@ clean_sandboxed_app_caches() {
|
||||
}
|
||||
|
||||
# Clean browser caches (Safari, Chrome, Edge, Firefox, etc.)
|
||||
# Warns if browsers are running (some cache files may be locked)
|
||||
clean_browsers() {
|
||||
# Check for running browsers and warn user
|
||||
local running_browsers=""
|
||||
local -a browser_checks=(
|
||||
"Safari"
|
||||
"Google Chrome"
|
||||
"Firefox"
|
||||
"Microsoft Edge"
|
||||
"Brave Browser"
|
||||
"Arc"
|
||||
"Opera"
|
||||
"Vivaldi"
|
||||
)
|
||||
|
||||
for browser in "${browser_checks[@]}"; do
|
||||
if pgrep -x "$browser" > /dev/null 2>&1; then
|
||||
if [[ -z "$running_browsers" ]]; then
|
||||
running_browsers="$browser"
|
||||
else
|
||||
running_browsers="$running_browsers, $browser"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -n "$running_browsers" ]]; then
|
||||
echo -e " ${YELLOW}${ICON_WARNING}${NC} Running: $running_browsers (some files may be locked)"
|
||||
note_activity
|
||||
fi
|
||||
|
||||
safe_clean ~/Library/Caches/com.apple.Safari/* "Safari cache"
|
||||
|
||||
# Chrome/Chromium
|
||||
|
||||
Reference in New Issue
Block a user