-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcleaner.bash
More file actions
73 lines (59 loc) · 2.44 KB
/
cleaner.bash
File metadata and controls
73 lines (59 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
#Author Rachid Oudouch
#42login : roudouch
StorageBefore=$(df -h "$HOME" | grep "$HOME" | awk '{print($4)}' | tr 'i' 'B')
if [ "$StorageBefore" == "0BB" ];
then
StorageBefore="0B"
fi
printf "\n\033[32mBleach is cleaning your computer, pls wait...\033[0m\n"
clean42Caches() {
/bin/rm -rf ~/Library/*.42* &>/dev/null
/bin/rm -rf ~/*.42* &>/dev/null
/bin/rm -rf ~/.zcompdump* &>/dev/null
/bin/rm -rf ~/.cocoapods.42_cache_bak* &>/dev/null
}
# cleanTrash() {
# /bin/rm -rf ~/.Trash/* &>/dev/null
# }
cleanGeneralCacheFiles() {
/bin/rm -rf ~/Library/Caches/* &>/dev/null
/bin/rm -rf ~/Library/Application\ Support/Caches/* &>/dev/null
}
cleanAppsCaches() {
/bin/rm -rf ~/Library/Application\ Support/Slack/Service\ Worker/CacheStorage/* &>/dev/null
/bin/rm -rf ~/Library/Application\ Support/Code/User/workspaceStorage/* &>/dev/null
/bin/rm -rf ~/Library/Application\ Support/discord/Cache/* &>/dev/null
/bin/rm -rf ~/Library/Application\ Support/discord/Code\ Cache/js* &>/dev/null
/bin/rm -rf ~/Library/Application\ Support/Google/Chrome/Profile\ [0-9]/Service\ Worker/CacheStorage/* &>/dev/null
/bin/rm -rf ~/Library/Application\ Support/Google/Chrome/Default/Service\ Worker/CacheStorage/* &>/dev/null
/bin/rm -rf ~/Library/Application\ Support/Google/Chrome/Profile\ [0-9]/Application\ Cache/* &>/dev/null
/bin/rm -rf ~/Library/Application\ Support/Google/Chrome/Default/Application\ Cache/* &>/dev/null
}
cleanDS_StoreFiles() {
find ~/Desktop -name .DS_Store -depth -exec /bin/rm {} \; &>/dev/null
}
cleanTmpDownloadsFiles() {
/bin/rm -rf ~/Library/Application\ Support/Chromium/Default/File\ System &>/dev/null
/bin/rm -rf ~/Library/Application\ Support/Chromium/Profile\ [0-9]/File\ System &>/dev/null
/bin/rm -rf ~/Library/Application\ Support/Google/Chrome/Default/File\ System &>/dev/null
/bin/rm -rf ~/Library/Application\ Support/Google/Chrome/Profile\ [0-9]/File\ System &>/dev/null
}
cleanPoolThings() {
/bin/rm -rf ~/Desktop/Piscine\ Rules\ *.mp4
/bin/rm -rf ~/Desktop/PLAY_ME.webloc
}
clean42Caches;
# cleanTrash;
cleanGeneralCacheFiles;
cleanAppsCaches;
cleanDS_StoreFiles;
cleanTmpDownloadsFiles;
cleanPoolThings
Storage=$(df -h "$HOME" | grep "$HOME" | awk '{print($4)}' | tr 'i' 'B')
if [ "$Storage" == "0BB" ];
then
Storage="0B"
fi
printf "\n\033[32m[ storage : \033[0;31mbefore= $StorageBefore \033[32m=> \033[0m"
printf "\033[32mafter= $Storage ]\033[0m\n\n"