-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean
More file actions
executable file
·26 lines (19 loc) · 762 Bytes
/
clean
File metadata and controls
executable file
·26 lines (19 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
CACHE_EXCLUDE=".*/\(borg\|thumbnails\|pacaur\|ccache\|yay\)"
# Kill browsers
echo "Closing browsers"
pgrep chromium && pkill --oldest chromium > /dev/null
pgrep chrome && pkill --oldest chrome > /dev/null
pgrep firefox && pkill --oldest firefox > /dev/null
sleep 1
# Clean downloads folder
echo "Cleaning downloads"
compgen -G ~/Downloads/\*.nzb > /dev/null && rm ~/Downloads/*.nzb
compgen -G ~/Downloads/\*.torrent > /dev/null && rm ~/Downloads/*.torrent
# Clear cache
echo "Clearing cache"
find ~/.cache -maxdepth 1 -not -path ~/.cache -not -regex "$CACHE_EXCLUDE" -print0 | xargs -0 rm -r
[ -n "$(ls -A ~/.compose-cache/)" ] && rm ~/.compose-cache/*
# Compact browser databases
echo "Compacting browser databases"
profile-cleaner