2013-05-15 11:08:39 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-05-15 14:46:08 +02:00
|
|
|
RMLIST="$HOME/.cache/dwb
|
2013-06-03 20:18:14 +02:00
|
|
|
$HOME/.cache/emacs
|
2013-05-15 14:46:08 +02:00
|
|
|
$HOME/.cache/mutt
|
2013-07-03 23:24:01 +02:00
|
|
|
$HOME/.cache/rtorrent
|
2013-07-26 18:01:16 +02:00
|
|
|
$HOME/.cache/zsh
|
2013-05-15 14:46:08 +02:00
|
|
|
$HOME/.cmus/autosave
|
|
|
|
$HOME/.cmus/cache
|
|
|
|
$HOME/.cmus/lib.pl
|
|
|
|
$HOME/.cmus/playlist.pl
|
|
|
|
$HOME/.cmus/queue.pl
|
|
|
|
$HOME/.cmus/resume
|
|
|
|
$HOME/.cmus/search-history
|
|
|
|
$HOME/.config/gtk-2.0
|
|
|
|
$HOME/.config/gtk-3.0
|
|
|
|
$HOME/.config/ranger/bookmarks
|
|
|
|
$HOME/.config/ranger/history
|
|
|
|
$HOME/.config/ranger/tagged
|
2013-07-26 18:01:16 +02:00
|
|
|
$HOME/.fehbg
|
2013-05-15 14:46:08 +02:00
|
|
|
$HOME/.gtk-bookmarks
|
2013-07-26 18:01:16 +02:00
|
|
|
$HOME/.lesshst
|
2013-05-15 14:46:08 +02:00
|
|
|
$HOME/.local/share/newsbeuter
|
|
|
|
$HOME/.local/share/webkit
|
2013-07-26 18:01:16 +02:00
|
|
|
$HOME/.mtap.fuseiso
|
2013-07-03 23:24:01 +02:00
|
|
|
$HOME/.mutt.pwds.cpt
|
2013-07-26 18:01:16 +02:00
|
|
|
$HOME/.pulse-cookie
|
2013-05-15 14:46:08 +02:00
|
|
|
$HOME/.ssh
|
2013-07-26 18:01:16 +02:00
|
|
|
$HOME/.viminfo
|
2013-07-03 23:24:01 +02:00
|
|
|
$HOME/.w3m
|
2013-07-26 18:01:16 +02:00
|
|
|
$HOME/.zcompdump"
|
2013-05-15 11:08:39 +02:00
|
|
|
|
2013-05-15 14:22:08 +02:00
|
|
|
echo "==> List of files to be cleaned."
|
2013-05-15 14:46:08 +02:00
|
|
|
echo "$RMLIST"
|
2013-05-15 11:08:39 +02:00
|
|
|
|
|
|
|
CHOICE="N"
|
2013-05-15 14:22:08 +02:00
|
|
|
echo
|
2013-05-15 11:08:39 +02:00
|
|
|
echo "==> Clean home? [y/N]"
|
|
|
|
read CHOICE
|
|
|
|
CHOICE="$(echo $CHOICE | tr [:lower:] [:upper:])"
|
|
|
|
if [ "$CHOICE" != "Y" ]; then
|
|
|
|
echo "Nothing done."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2013-05-15 14:46:08 +02:00
|
|
|
## Delete git repo if any.
|
2013-07-03 23:24:01 +02:00
|
|
|
if [ -d "$HOME/.git" ]; then
|
|
|
|
echo
|
|
|
|
echo "==> Cleaning git repo."
|
|
|
|
rm -rf "$HOME/.git"
|
|
|
|
fi
|
2013-05-15 14:46:08 +02:00
|
|
|
|
|
|
|
## Delete Dropbox folder if any.
|
2013-07-03 23:24:01 +02:00
|
|
|
if [ -d "$HOME/Dropbox" ] || [ -d "$HOME/.dropbox" ]; then
|
|
|
|
echo
|
|
|
|
echo "==> Cleaning Dropbox folder."
|
|
|
|
rm -rvf "$HOME/Dropbox"
|
|
|
|
rm -rvf "$HOME/.dropbox"
|
|
|
|
fi
|
2013-05-15 11:08:39 +02:00
|
|
|
|
|
|
|
## Clean trash if possible.
|
|
|
|
if [ -z "$(command -v trash-empty)" ]; then
|
2013-05-15 14:46:08 +02:00
|
|
|
echo
|
2013-07-03 23:24:01 +02:00
|
|
|
echo "==> Emptying trash."
|
|
|
|
echo ":: 'trash-empty' not installed, you have to clean trash manually."
|
|
|
|
rm -rvf "$HOME/.local/share/Trash"
|
2013-05-15 11:08:39 +02:00
|
|
|
else
|
2013-05-15 14:46:08 +02:00
|
|
|
echo
|
|
|
|
echo "==> Emptying trash."
|
2013-05-15 11:08:39 +02:00
|
|
|
trash-empty
|
|
|
|
fi
|
|
|
|
|
|
|
|
## Clear data.
|
2013-05-15 14:46:08 +02:00
|
|
|
echo
|
|
|
|
while read -r i; do
|
|
|
|
rm -rvf "$i"
|
|
|
|
done <<EOF
|
|
|
|
$RMLIST
|
|
|
|
EOF
|
2013-05-15 11:08:39 +02:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "==> Cleaning done."
|